WSL icon indicating copy to clipboard operation
WSL copied to clipboard

All WSL commands hang (including wsl --shutdown) but WSL is constantly using 30-40% CPU

Open dennisameling opened this issue 3 years ago • 350 comments

Version

Microsoft Windows [Version 10.0.22621.160]

WSL Version

  • [X] WSL 2
  • [ ] WSL 1

Kernel Version

5.10.102.1

Distro Version

Ubuntu 20.04

Other Software

No response

Repro Steps

This mostly seems to be happening when the device wakes from sleep - after a system restart, I can access the WSL distro as expected

  • Start a WSL distro (Ubuntu 20.04)
  • See it hang
  • Try to do a wsl --shutdown
  • See that hang as well

image

Expected Behavior

  • Start a WSL distro (Ubuntu 20.04)
  • The command line should open

Actual Behavior

  • Start a WSL distro (Ubuntu 20.04)
  • The terminal hangs completely (see screenshot above)

Diagnostic Logs

Feedback Hub logs: https://aka.ms/AAh9fcl

dennisameling avatar Jun 19 '22 15:06 dennisameling

I have this issue as well. Killing the WSL process from taskmanager recovers, but it does it again. Especially (but not only) after it comes back from sleep.

mmichal3 avatar Jun 25 '22 19:06 mmichal3

Looks like something is wrong with your trace, could you please collect a trace using these instructions? /logs

benhillis avatar Jun 28 '22 21:06 benhillis

Hello! Could you please provide more logs to help us better diagnose your issue?

To collect WSL logs, download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The scipt will output the path of the log file once done.

Once completed please upload the output files to this Github issue.

Click here for more info on logging

Thank you!

ghost avatar Jun 28 '22 21:06 ghost

Could you also share the output of wsl.exe dmesg?

Thanks!

benhillis avatar Jun 28 '22 21:06 benhillis

This issue has been automatically closed since it has not had any author activity for the past 7 days. If you're still experiencing this issue please re-open it.

Thank you!

ghost avatar Jul 05 '22 23:07 ghost

I'm not the original poster, but I'm having a similar issue: every wsl command hangs (including wsl --shutdown), this causes problems with Docker, but because of the issues with WSL I can't even reinstall Docker itself (I initially thought it was a Docker issue but everything seems to point back to WSL).

wsl.exe dmesg also hangs so I can't post its output.

I attached the logs from collect-wsl-logs.ps1:

WslLogs-2022-08-25_08-34-21.zip

berzi avatar Aug 25 '22 06:08 berzi

Same problem here. Killing WSL from Task Manager solves the issue but is obviously not ideal.

CarlosRosuero avatar Sep 13 '22 15:09 CarlosRosuero

Same here; this just started happening in the last few days; Please re-open this MSFT!

pontusvision avatar Sep 14 '22 11:09 pontusvision

Same here. Need to terminate the process from task manager. This issue started after updated WSL to the Store version.

georcon avatar Sep 17 '22 08:09 georcon

This should not have been closed - maybe the person went on vacation (7days?) Happens often when attempting to switch folders using VSCode. Hangs -- generally just reboot to get back to working again for a while.

Heavy CPU from vmmemwsl

Windows ARM64 image

pernsdorff avatar Sep 20 '22 03:09 pernsdorff

Please reopen, this issue should not have been closed. This happens all the time, usually after waking the computer from sleep. Usually a simple wsl --shutdown worked after a ~30s wait, but today even this method failed as all wsl commands hang indefinitely. I need to go into task manager and shut down vmwp.exe, as otherwise the vmmem process persists even if I kill all wsl processes manually, and the wsl commands hang anyways.

This problem is really frustrating as it forces me to restart Docker and all containers, as well as my IDE, which with large projects can take some time.

rstepinski avatar Sep 20 '22 12:09 rstepinski

Please reopen, this issue should not have been closed. This happens all the time, usually after waking the computer from sleep. Usually a simple wsl --shutdown worked after a ~30s wait, but today even this method failed as all wsl commands hang indefinitely. I need to go into task manager and shut down vmwp.exe, as otherwise the vmmem process persists even if I kill all wsl processes manually, and the wsl commands hang anyways.

This problem is really frustrating as it forces me to restart Docker and all containers, as well as my IDE, which with large projects can take some time.

I was literally about to comment the same thing! This issues has been driving me CRAZY!!!

My wsl version is:

WSL version: 0.66.2.0
Kernel version: 5.15.57.1
WSLg version: 1.0.42
MSRDC version: 1.2.3401
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22000.978

Please can we reopen and address this?

JPStrydom avatar Sep 21 '22 12:09 JPStrydom

Please reopen, this issue should not have been closed. This happens all the time, usually after waking the computer from sleep. Usually a simple wsl --shutdown worked after a ~30s wait, but today even this method failed as all wsl commands hang indefinitely. I need to go into task manager and shut down vmwp.exe, as otherwise the vmmem process persists even if I kill all wsl processes manually, and the wsl commands hang anyways.

This problem is really frustrating as it forces me to restart Docker and all containers, as well as my IDE, which with large projects can take some time.

What's worse, if this happens and I forget to close my IDE before terminating WSL, when I reopen the project everything needs to be reindexed. While the entire restart process takes seconds to do and I could live with this inconvenience, indexing can take minutes, which is not inconvenient - it's infuriating. It is simply unacceptable that this issue persists and I'm absolutely blown away that this seems to be ignored on purpose.

rstepinski avatar Sep 22 '22 16:09 rstepinski

Same issue here. After coming back from sleep Vmmem brings CPU usage to 100% wsl --shutdown hangs. Happened 3 times in a row, reboot helps. Tried killing vmwp.exe but it crashed the OS. WSL version: 0.66.2.0 Kernel version: 5.15.57.1 WSLg version: 1.0.42 MSRDC version: 1.2.3401 Direct3D version: 1.606.4 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.22000.978

ddonov avatar Sep 30 '22 11:09 ddonov

Same here @ddonov, when docker desktop is running and notebook awakes from sleep.

My workaround is to kill the wslservice.exe in a admin powershell: taskkill /f /im wslservice.exe

tricodon avatar Sep 30 '22 11:09 tricodon

Same here @ddonov, when docker desktop is running and notebook awakes from sleep.

My workaround is to kill the wslservice.exe in a admin powershell: taskkill /f /im wslservice.exe

ERROR: The process "wslservice.exe" not found

indeed-a-genius avatar Oct 05 '22 13:10 indeed-a-genius

Same here @ddonov, when docker desktop is running and notebook awakes from sleep.

My workaround is to kill the wslservice.exe in a admin powershell: taskkill /f /im wslservice.exe

This worked for me. Thanks a lot! Previously I would do a hard reset.

Terryfeek avatar Oct 08 '22 07:10 Terryfeek

Same here @ddonov, when docker desktop is running and notebook awakes from sleep. My workaround is to kill the wslservice.exe in a admin powershell: taskkill /f /im wslservice.exe

ERROR: The process "wslservice.exe" not found

did you start powershell as admin?

nico-is-coding avatar Oct 08 '22 11:10 nico-is-coding

Same here @ddonov, when docker desktop is running and notebook awakes from sleep. My workaround is to kill the wslservice.exe in a admin powershell: taskkill /f /im wslservice.exe

ERROR: The process "wslservice.exe" not found

did you start powershell as admin?

yes

indeed-a-genius avatar Oct 10 '22 15:10 indeed-a-genius

Same here @ddonov, when docker desktop is running and notebook awakes from sleep. My workaround is to kill the wslservice.exe in a admin powershell: taskkill /f /im wslservice.exe

ERROR: The process "wslservice.exe" not found

This workaround doesn't work for me either but wsl --shutdown does (taking a minute or so to complete)

ajohn25 avatar Oct 15 '22 04:10 ajohn25

@benhillis

This issue has been automatically closed since it has not had any author activity for the past 7 days. If you're still experiencing this issue please re-open it.

Thank you!

This is some kind of joke, right?

niekvb avatar Nov 10 '22 20:11 niekvb

Facing same issues, Couldn't end process (vmmem) from task manager, it says access denied, also powershell command to taskkill also says process not found.

hanzlahabib avatar Nov 13 '22 08:11 hanzlahabib

+1 this issue occurs for me on a new SP9 SQ3 on 22H2 22621.755 in debian bullseye on WSL2 with the systemctl flag enabled in wslconfig.

WSL hangs when I stop a docker container. I then need to restart wsl but wsl --shutdown hangs.

only rebooting or taskkill /f /im wslservice.exe seems to fix it.

Issue should not be closed @craigloewen-msft hello friend can you help us? If there's anything I can do to share more info on how to reproduce please let me know. Thanks and big shoutout to you folks working on WSL, it TOTALLY ROCKS <3

Macmee avatar Nov 13 '22 09:11 Macmee

To all those affected here, as this is already closed.

I can't reproduce on my work laptop, but can reproduce on both my weak, 'personal' laptops.

Work machine has 64GB Ram and personal laptops have 16GB (Yeah, I know).

Worse when multiple instances of vscode are running under WSL. If everyone here has low-ish memory, this could be the culprit.

georcon avatar Nov 13 '22 11:11 georcon

Hi folks, reopening this so it can be visible to the WSL team. It was closed automatically since we didn't get any feedback from the original author. Thanks for flagging us on it!

craigloewen-msft avatar Nov 14 '22 22:11 craigloewen-msft

PLEASE FIX WHATEVER IS CAUSING THIS!!! There are literally DOZENS of threads online about this issue, including several on this GitHub repo! All was good in Win10, now WSL goes zombie after a sleep/hybernate and it is not even clear how to bring it back without rebooting the WHOLE SYSTEM.

fayora avatar Nov 17 '22 03:11 fayora

@fayora @niekvb Hey. The team here is doing a wonderful job IMO adding updates and addressing issues in WSL. They've been kind enough to re-open this issue and I'm sure they'll prioritize and get to this issue too when they have time. As developers ourselves I'm sure we can all relate!

Macmee avatar Nov 17 '22 05:11 Macmee

@craigloewen-msft

What information can the community provide to assist in identifying the root cause?

dimepues avatar Nov 17 '22 18:11 dimepues

To all those affected here, as this is already closed.

I can't reproduce on my work laptop, but can reproduce on both my weak, 'personal' laptops.

Work machine has 64GB Ram and personal laptops have 16GB (Yeah, I know).

Worse when multiple instances of vscode are running under WSL. If everyone here has low-ish memory, this could be the culprit.

I am having the issue regardless the availability of RAM, currently having this issue non-stop on a Lenovo T14s with 48GB of RAM and gen 12 i7-1280P CPU. I do not expect that being underpowered is the root of this issue...

LouisPhilippe avatar Nov 22 '22 09:11 LouisPhilippe

I'm not the original poster, but I'm having a similar issue: every wsl command hangs (including wsl --shutdown), I can't even close it in Task manager most of the time since it causes that to hang too. My only option would be to restart my computer, which causes me to lose progress. Please fix soon, as this is causing me to lose work.

seanjedi avatar Nov 23 '22 00:11 seanjedi