Windows Version
Microsoft Windows [Version 10.0.26200.8655]
WSL Version
2.7.8.0
Are you using WSL 1 or WSL 2?
Kernel Version
6.18.33.1-1
Distro Version
Ubuntu 24.04
Other Software
Docker Desktop 4.77.0 (its docker-desktop distro is also affected, see below)
Repro Steps
Machine has two fixed NTFS drives: C: (NVMe) and P: (SATA). Both automount fine via 9p when virtiofs is disabled.
- Add
virtiofs=true to the [wsl2] section of .wslconfig
wsl --shutdown, start the distro
mount | grep /mnt
Expected Behavior
/mnt/c and /mnt/p are automounted (virtiofs where possible, 9p fallback otherwise), as documented for the virtiofs opt-in.
Actual Behavior
No fixed drive is automounted at all — /mnt/c and /mnt/p simply don't exist as mounts. There is no warning on the terminal, nothing in dmesg and nothing in the boot log. Interop path translation also degrades (wsl: Failed to translate 'C:\...' warnings for every PATH entry when launching Windows executables from another distro).
The virtiofs device for C: is created and works — the tag is visible at kernel boot and a manual mount succeeds:
[ 0.253334] virtiofs virtio1: discovered new tag: f8407c95-93b2-41f6-ac92-7b8deb88fd19
$ sudo mount -t virtiofs f8407c95-... /mnt/c # works fine
Meanwhile the share for P: is never created. Requesting it manually shows the failure that I believe poisons the whole automount:
$ sudo mount -t drvfs 'P:\' /mnt/p
WSL (...) WARNING: Add virtiofs share for P:\ failed 22, falling back to Plan9
(P: is a plain healthy NTFS volume on a SATA SSD, DriveType: Fixed; the 9p fallback works fine, so per-drive fallback clearly exists for the runtime path — just not for the boot path.)
Analysis (from the 2.7.8 sources)
WslCoreVm::AddDrvFsShare (src/windows/service/exe/WslCoreVm.cpp, around line 859) loops over the fixed-drive bitmap and calls AddVirtioFsShare for each drive without any per-drive error handling:
auto fixedDrives = wsl::windows::common::filesystem::EnumerateFixedDrives(UserToken).first;
while (fixedDrives != 0)
{
...
AddVirtioFsShare(Admin, fixedDrivePath, TEXT(LX_INIT_DEFAULT_PLAN9_MOUNT_OPTIONS), UserToken);
fixedDrives ^= (1 << index);
}
If AddVirtioFsShare throws for any single drive (here: P:, error 22/EINVAL), the exception propagates out of InitializeDrvFs, so the instance reports LxInitDrvfsMountNone to init. On the Linux side (src/linux/init/config.cpp:726):
if (Config.AutoMount && (Message->DrvfsMount != LxInitDrvfsMountNone))
{
ConfigMountDrvFsVolumes(Message->DrvFsVolumesBitmap, DefaultUid, Elevated, Config);
}
…which silently skips all volumes, including the perfectly healthy C: whose virtiofs device already exists. Since InitializeDrvFs is VM-wide, every distro in the VM loses its drive mounts (Docker Desktop's docker-desktop distro ends up without /mnt/host/c as well, which breaks Windows-path bind mounts).
Two issues, in order of impact:
- One failing drive should not disable automount for all drives. A per-drive try/catch around
AddVirtioFsShare with a 9p fallback (like the runtime path in MountVirtioFs already does) would keep everything working.
- The failure is completely silent — an
EMIT_USER_WARNING would have saved a lot of debugging.
I have not been able to determine from the outside why AddVirtioFsShare fails with EINVAL for this particular volume — happy to collect WslLogs / networking.sh output or test a private build if that helps.
Workaround
A boot script that, when /mnt/c is not mounted, finds the drive tag via /sys/fs/virtiofs/*/tag, mounts it manually, recreates the /run/wsl/virtiofs/<tag> symlink (needed for interop path translation), and mounts the remaining drives via mount -t drvfs (9p fallback). Works reliably across reboots.
Windows Version
Microsoft Windows [Version 10.0.26200.8655]
WSL Version
2.7.8.0
Are you using WSL 1 or WSL 2?
Kernel Version
6.18.33.1-1
Distro Version
Ubuntu 24.04
Other Software
Docker Desktop 4.77.0 (its
docker-desktopdistro is also affected, see below)Repro Steps
Machine has two fixed NTFS drives:
C:(NVMe) andP:(SATA). Both automount fine via 9p when virtiofs is disabled.virtiofs=trueto the[wsl2]section of.wslconfigwsl --shutdown, start the distromount | grep /mntExpected Behavior
/mnt/cand/mnt/pare automounted (virtiofs where possible, 9p fallback otherwise), as documented for the virtiofs opt-in.Actual Behavior
No fixed drive is automounted at all —
/mnt/cand/mnt/psimply don't exist as mounts. There is no warning on the terminal, nothing indmesgand nothing in the boot log. Interop path translation also degrades (wsl: Failed to translate 'C:\...'warnings for every PATH entry when launching Windows executables from another distro).The virtiofs device for
C:is created and works — the tag is visible at kernel boot and a manual mount succeeds:Meanwhile the share for
P:is never created. Requesting it manually shows the failure that I believe poisons the whole automount:(
P:is a plain healthy NTFS volume on a SATA SSD,DriveType: Fixed; the 9p fallback works fine, so per-drive fallback clearly exists for the runtime path — just not for the boot path.)Analysis (from the 2.7.8 sources)
WslCoreVm::AddDrvFsShare(src/windows/service/exe/WslCoreVm.cpp, around line 859) loops over the fixed-drive bitmap and callsAddVirtioFsSharefor each drive without any per-drive error handling:If
AddVirtioFsSharethrows for any single drive (here:P:, error 22/EINVAL), the exception propagates out ofInitializeDrvFs, so the instance reportsLxInitDrvfsMountNoneto init. On the Linux side (src/linux/init/config.cpp:726):…which silently skips all volumes, including the perfectly healthy
C:whose virtiofs device already exists. SinceInitializeDrvFsis VM-wide, every distro in the VM loses its drive mounts (Docker Desktop'sdocker-desktopdistro ends up without/mnt/host/cas well, which breaks Windows-path bind mounts).Two issues, in order of impact:
AddVirtioFsSharewith a 9p fallback (like the runtime path inMountVirtioFsalready does) would keep everything working.EMIT_USER_WARNINGwould have saved a lot of debugging.I have not been able to determine from the outside why
AddVirtioFsSharefails with EINVAL for this particular volume — happy to collect WslLogs / networking.sh output or test a private build if that helps.Workaround
A boot script that, when
/mnt/cis not mounted, finds the drive tag via/sys/fs/virtiofs/*/tag, mounts it manually, recreates the/run/wsl/virtiofs/<tag>symlink (needed for interop path translation), and mounts the remaining drives viamount -t drvfs(9p fallback). Works reliably across reboots.