virtiofs=true: drvfs umask/fmask parsed as decimal and fmask applied to directories
Windows Version
Microsoft Windows [Version 10.0.26200.9457] (Windows 11 Pro, 25H2)
WSL Version
2.9.13.0 (pre-release)
Are you using WSL 1 or WSL 2?
- WSL 2
- WSL 1
Kernel Version
6.18.40.1-1
Distro Version
Debian 13.7 (trixie)
Other Software
Full wsl --version output:
WSL version: 2.9.13.0
Kernel version: 6.18.40.1-1
WSLg version: 1.0.79
MSRDC version: 1.2.7214
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.26200.9457Relevant .wslconfig:
[wsl2]
virtiofs=trueRepro Steps
With virtiofs=true, mount C: with different permission mask options and inspect the resulting modes:
sudo mkdir -p /tmp/ctest
for o in \
"metadata" \
"metadata,umask=022" \
"metadata,umask=022,fmask=111" \
"metadata,umask=022,dmask=022,fmask=111" \
"metadata,umask=18" \
"metadata,umask=18,fmask=73"
do
echo "===== $o"
sudo mount -t drvfs C: /tmp/ctest -o "$o" 2>&1
mount | grep ' /tmp/ctest '
ls -ld /tmp/ctest /tmp/ctest/Users /tmp/ctest/Windows/System32/cmd.exe 2>&1
sudo umount /tmp/ctest
doneThen repeat with virtiofs=false (Plan 9) for comparison.
The same happens with automount via /etc/wsl.conf:
[automount]
options = "metadata,umask=022,fmask=111"After wsl --shutdown, /mnt/c becomes drw------- and wsl.exe fails to start in the Windows user profile directory:
<3>WSL (209 - Relay) ERROR: CreateProcessCommon:809: chdir(/mnt/c/Users/<user>) failed 13Expected Behavior
Per the documentation, umask applies to files and directories, fmask only to files and dmask only to directories, with octal values:
https://learn.microsoft.com/en-us/windows/wsl/file-permissions
https://learn.microsoft.com/en-us/windows/wsl/wsl-config
With metadata,umask=022,fmask=111 directories should be 755 and files 644. Plan 9 behaves exactly like this on the same machine.
Actual Behavior
A/B comparison using the repro loop above, same machine and WSL version, only toggling virtiofs in .wslconfig.
| Options | Plan 9 (virtiofs=false) dir / file |
virtiofs (virtiofs=true) dir / file |
|---|---|---|
metadata |
777 / 555 | 777 / 555 |
metadata,umask=022 |
755 / 555 | 751 / 551 |
metadata,umask=022,fmask=111 |
755 / 444 | 600 / not accessible |
metadata,umask=022,dmask=022,fmask=111 |
755 / 444 | 600 / not accessible |
metadata,umask=18 |
776 / not accessible | 755 / 555 |
metadata,umask=18,fmask=73 |
776 / not accessible | 644 / not accessible |
Plan 9 behaves as documented. virtiofs deviates in two ways:
- Mask values are interpreted as decimal, not octal.
umask=022behaves as octal 026 (decimal 22).umask=18(decimal 18 = octal 022) gives the documented 755. fmaskis applied to directories. With virtiofs,umask=18,fmask=73(octal 022 and 111) gives directories 644 instead of 755.umask=022,fmask=111gives 600, which matches octal 026 | 157 = 177 applied to directories.
As a result, the documented example metadata,umask=022,fmask=111 makes every directory under the mount non-traversable when virtiofs is enabled, while the same options work correctly with Plan 9.
The host-side trace shows WslCoreVmAddVirtioFsShare receiving the options unchanged (;metadata;umask=022;fmask=111;symlinkroot=/mnt/), so the deviation seems to happen when the options are interpreted by the virtiofs device host or the guest.
Workaround in use: options = "metadata,umask=18" with virtiofs only (directories 755, files keep the execute bit since fmask cannot be used). This value breaks directory traversal if virtiofs is later disabled.
Unrelated, also visible in the logs: sharing G:\ and H:\ via virtiofs fails with 0x80070005 in GetCanonicalPath. /mnt/c is not affected.
Diagnostic Logs
Logs emailed to [email protected] (see comment below).
- File:
WslLogs-2026-09-28_15-27-28.tar.gz - Collected with:
collect-wsl-logs.ps1 -LogProfile storage - Collection window: 2026-09-28 15:27:29 to about 15:38 (UTC+02:00)
- Covers both the Plan 9 (
virtiofs=false) and the virtiofs (virtiofs=true) runs of the repro loop
Source: microsoft/WSL