DrvFs: Directory listing on mapped Windows network drives fails with EINVAL while direct file access works
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- cpp, linux
- Domain
- operating-systems
Research direction
Start by tracing the DrvFs/9P directory enumeration path for mapped SMB drives; the report identifies getdents64 returning EINVAL while direct file access succeeds. Reproduce with the supplied /etc/fstab automount setup and compare directory listing with direct access. Done means listing entries on the mapped drive succeeds; the issue does not name source files or tests.
Written by the indexing model from the issue text.
Description
Windows Version
Windows 11 26H2 Build 26300.9457
WSL Version
3.0.3.0
Are you using WSL 1, WSL 2, or WSLC?
- WSL 2
- WSL 1
- WSLC
Kernel Version
6.18.54.1-1
Distro Version
Ubuntu 24.04.5 LTS
Other Software
wsl --version
WSL-Version: 3.0.3.0
Kernelversion: 6.18.54.1-1
WSLg-Version: 1.0.79
MSRDC-Version: 1.2.7391
Direct3D-Version: 1.611.1-81528511
DXCore-Version: 10.0.26100.1-240331-1435.ge-release
Windows-Version: 10.0.26300.9457
Environment
Windows 11: 10.0.26300.9457
WSL package version: 3.0.3.0
Distribution: Ubuntu 24.04.5 LTS (WSL2)
Filesystem: DrvFs via 9P
Network storage: SMB share on an mapped as drive in Windows
Windows SMB network share mapped to drive The share is accessible through Windows Explorer and PowerShell.
systemd: enabled
Repro Steps
-
Map an accessible SMB network share to drive
F:in Windows. -
Verify that Windows can enumerate its directories using
Get-ChildItem. -
In WSL2 (Ubuntu), ensure
/mnt/fexists. (yes its defaulted exists here) -
Add the following entry to
/etc/fstab:F: /mnt/f drvfs noauto,nofail,x-systemd.automount 0 0 -
Reload systemd and activate the automount:
sudo systemctl daemon-reloadsudo systemctl start mnt-f.automount -
Access the mounted directory:
ls -la /mnt/f -
Try listing an existing subdirectory:
ls -la /mnt/f/<existing-directory> -
Attempt to access a known file directly using
stator a file-reading command.
The mount succeeds, and direct access to known files works. However, directory enumeration consistently fails with EINVAL.
Expected Behavior
WSL should enumerate the contents of a mapped Windows network drive through DrvFs, just as Windows Explorer and PowerShell do.
Commands such as ls, find, and other applications relying on directory enumeration should be able to access the directory entries.
Actual Behavior
getdents64(3, ..., 32768) = -1 EINVAL (Invalid argument)
ls: reading directory '/mnt/f': Invalid argument
The DrvFs mount succeeds and the network drive is accessible.
However, directory enumeration fails.
GNU ls reports:
ls: reading directory '/mnt/f': Invalid argument
In a Zsh session using a different ls frontend, the error is displayed as:
ls: .: Invalid argument (os error 22)
Both failures correspond to EINVAL (error 22).
A system call trace confirms:
getdents64(3, ..., 32768) = -1 EINVAL (Invalid argument)
Interestingly, accessing individual files by their known paths works correctly. File metadata can be retrieved, and file contents can be read successfully.
Windows PowerShell can enumerate the same directories without errors.
The problem appears to affect directory enumeration through DrvFs/9P rather than mounting or file access in general.
Diagnostic Logs
Relevant strace output:
getdents64(3, ..., 32768) = -1 EINVAL (Invalid argument)
Mount network drives in wsl
- #5302
- #1954 1954
- Dominant language
- C++
- Stars
- 34.4k
- Forks
- 1.9k
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 166
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/WSL
-
feature wsl2
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
microsoft/WSL#42306 · 3 comments ·
Maintainers usually reply within 1 day
-
feature
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
microsoft/WSL#42114 · 3 comments ·
Maintainers usually reply within 1 day
-
feature kernel wsl2
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
microsoft/WSL#41107 · 3 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
feature kernel
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
microsoft/WSL#41054 · 9 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
feature GPU
Difficulty 1/5 1-3 hours Newbie friendliness 70/100
microsoft/WSL#13592 · 4 comments ·
Maintainers usually reply within 1 day
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
nextcloud/passman-android#214 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
2026.11.0 fails to install on Intel macOS: requirements.txt pins cryptography==50.0.2 for Darwin x86_64May be free again A pull request for this issue was closed without being merged. Open
Difficulty 1/5 Under an hour Newbie friendliness 87/100
esphome/esphome#22892 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
distante/esphome-components#50 · 1 comment ·
Maintainers usually reply within 1 day
-
arch-based hyprland
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
noctalia-dev/noctalia#5423 ·
Maintainers usually reply within 1 day