WSL2 mounted host drive access hangs after a short while
Version
Microsoft Windows [Version 10.0.22621.1265]
WSL Version
- [X] WSL 2
- [ ] WSL 1
Kernel Version
5.15.79.1-microsoft-standard-WSL2
Distro Version
docker-desktop
Other Software
Docker Desktop
Repro Steps
Use Docker Desktop to build some software using ninja -j9 in an Ubuntu 20.04 LTS container.
Expected Behavior
The build runs fast.
Actual Behavior
The build gets slower and slower until it eventually hangs.
Once it hangs, running df -ah in the WSL2 instance hangs right before it shows the /mnt point of the drive.
wsl --shutdown also hangs.
Diagnostic Logs
No response
Noticing continued high reported CPU usage in Task Manager after running a docker container in WSL2 for a while...

Except this CPU usage is not inside the VM. And at the same time Task Manager also doesn't report any actual process using this much CPU.

Yet the CPU usage graphs remain high... Doing nothing?
No difference after wsl --shutdown
Also of note, while the build processes are running inside the WSL2, Task Manager in the Details and Processes pages runs extremely sluggish.
(Using Docker Desktop with Hyper-V backend instead now, it goes super fast.)
Your CMD window title is wsl -d docker-desktop. The Docker distros docker-desktop and docker-desktop-data are not to be invoked directly.
Hi, it's just to check if the processes in there are doing anything, and to find out what is blocking.
On Sat, Feb 18, 2023, at 23:35, zcobol wrote:
Your CMD window title is
wsl -d docker-desktop. The Docker distrosdocker-desktopanddocker-desktop-dataare not to be invoked directly.— Reply to this email directly, view it on GitHub https://github.com/microsoft/WSL/issues/9654#issuecomment-1435701401, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMB77NZVOZKAIHKJ3OGUF3WYDT4DANCNFSM6AAAAAAVAJTOYU. You are receiving this because you authored the thread.Message ID: @.***>
I also noticed heavy access to the ext4 drive image after a while (after the mounted host drive starts becoming slow and getting stuck). Seems to be some heavy swapping going on once that happens?
(I already tried upping the WSL2 memory to 24GB, host memory is 64GB, still the same behavior.)
+1 - I also experience this same issue with Docker for Desktop under WSL2.
The disk being accessed is a Tiered Storage Space.
Same issue after sometime with heavy read, WSL2 mounted host disk access hangs !!! HELP!
Same issue under WSL2. WSL2 mounted host disk access hangs in 20 minutes,and I execute wsl --shutdown...
+1 I also have the same issue, the disk being mounted is a windows storage space device.
The same issue, help
Same here!!
Same issue !!
same when running node.js building or linting
This looks very similar to #9473, which unfortunately is closed. There seems to be some I/O exhaustion, possibly related to mounted network drives. df hangs, as does ls /mnt.
My workflow is dependent on accessing network and local files, so this is quite disruptive. For me, the hang typically manifested as VS Code grinding to a halt. If I reopened VS Code, it could no longer connect to WSL. The obvious "solution" is to restart wsl, which is also disruptive.
I ran strace df to discover exactly which mount caused the problem. In my case it was an SSHFS mount (mounted in Windows using SSHFS-Win). Fortunately, it was the one network share I don't need in WSL (the others are CIFS mounts and I do need them). So I exclude that mount, which in Windows is my W: drive.
/etc/wsl.conf:
[automount]
options="metadata,umask=0033"
mountFsTab=true
enabled=true
Create an empty directory to mount:
mkdir /mnt/emptyW
Override the mounting of the Windows W: drive. /etc/fstab:
/mnt/emptyW /mnt/w none bind 0 0
This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.
Thank you!