WSL icon indicating copy to clipboard operation
WSL copied to clipboard

WSL2 mounted host drive access hangs after a short while

Open kaetemi opened this issue 3 years ago • 16 comments

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

kaetemi avatar Feb 18 '23 11:02 kaetemi

Noticing continued high reported CPU usage in Task Manager after running a docker container in WSL2 for a while...

image

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.

image

Yet the CPU usage graphs remain high... Doing nothing?

No difference after wsl --shutdown

kaetemi avatar Feb 18 '23 12:02 kaetemi

Also of note, while the build processes are running inside the WSL2, Task Manager in the Details and Processes pages runs extremely sluggish.

kaetemi avatar Feb 18 '23 13:02 kaetemi

(Using Docker Desktop with Hyper-V backend instead now, it goes super fast.)

kaetemi avatar Feb 18 '23 13:02 kaetemi

Your CMD window title is wsl -d docker-desktop. The Docker distros docker-desktop and docker-desktop-data are not to be invoked directly.

zcobol avatar Feb 18 '23 15:02 zcobol

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 distros docker-desktop and docker-desktop-data are 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: @.***>

kaetemi avatar Feb 18 '23 15:02 kaetemi

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.)

kaetemi avatar Feb 19 '23 00:02 kaetemi

+1 - I also experience this same issue with Docker for Desktop under WSL2.

The disk being accessed is a Tiered Storage Space.

jamescarter-le avatar Feb 22 '23 22:02 jamescarter-le

Same issue after sometime with heavy read, WSL2 mounted host disk access hangs !!! HELP!

thusinh1969 avatar Apr 14 '23 02:04 thusinh1969

Same issue under WSL2. WSL2 mounted host disk access hangs in 20 minutes,and I execute wsl --shutdown...

muchkanensys avatar Jun 03 '23 04:06 muchkanensys

+1 I also have the same issue, the disk being mounted is a windows storage space device.

00Asgaroth00 avatar Jun 28 '23 11:06 00Asgaroth00

The same issue, help

alanchen222 avatar Sep 18 '23 08:09 alanchen222

Same here!!

sydsim avatar Nov 24 '23 06:11 sydsim

Same issue !!

ancelade-marc avatar Feb 25 '24 18:02 ancelade-marc

same when running node.js building or linting

osipovrb avatar Sep 20 '24 12:09 osipovrb

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

robpomeroy avatar Mar 25 '25 09:03 robpomeroy

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!