microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.49k stars 822 forks source link

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

Open dennisameling opened 2 years ago

dennisameling commented 2 years ago

Version

Microsoft Windows [Version 10.0.22621.160]

WSL Version

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

image

Expected Behavior

Actual Behavior

Diagnostic Logs

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

mmichal3 commented 2 years ago

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.

benhillis commented 2 years ago

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

ghost commented 2 years ago

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!

benhillis commented 2 years ago

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

Thanks!

ghost commented 2 years ago

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!

berzi commented 2 years ago

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

CarlosRosuero commented 2 years ago

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

pontusvision commented 2 years ago

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

georcon commented 2 years ago

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

pernsdorff commented 2 years ago

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

rstepinski commented 2 years ago

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.

JPStrydom commented 2 years ago

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?

rstepinski commented 2 years ago

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.

ddonov commented 2 years ago

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

tricodon commented 2 years ago

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

indeed-a-genius commented 2 years ago

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

Terryfeek commented 2 years ago

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.

nico-is-coding commented 2 years ago

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?

indeed-a-genius commented 2 years ago

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

ajohn25 commented 2 years ago

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)

niekvb commented 2 years ago

@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?

hanzlahabib commented 2 years ago

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.

Macmee commented 2 years ago

+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

georcon commented 2 years ago

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.

craigloewen-msft commented 2 years ago

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!

fayora commented 2 years ago

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.

Macmee commented 2 years ago

@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!

dimepues commented 2 years ago

@craigloewen-msft

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

LouisPhilippe commented 1 year ago

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

seanjedi commented 1 year ago

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.

LouisPhilippe commented 1 year ago

I've just had some success after completely removing WSL & Linux distros, and then installing everything from the windows store (instead of using command line). Been working for 2 days now, including going to standby five times. Specifically installing ubuntu from the windows store instead of command line seems to be the main difference.

georcon commented 1 year ago

@LouisPhilippe Can you confirm (or deny :D ) using Docker Desktop on that machine?

mmichal3 commented 1 year ago

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.

This happens to me on my Surface Pro X with an SQ2 cput and 16GB. Just like you said, it happens after returning from sleep.

berzi commented 1 year ago

I've just had some success after completely removing WSL & Linux distros, and then installing everything from the windows store (instead of using command line). Been working for 2 days now, including going to standby five times. Specifically installing ubuntu from the windows store instead of command line seems to be the main difference.

I've had the issue happen to me while on a machine that only ever had WSL installed through the windows store, so don't get your hopes up too much.

LouisPhilippe commented 1 year ago

I've just had some success after completely removing WSL & Linux distros, and then installing everything from the windows store (instead of using command line). Been working for 2 days now, including going to standby five times. Specifically installing ubuntu from the windows store instead of command line seems to be the main difference.

I've had the issue happen to me while on a machine that only ever had WSL installed through the windows store, so don't get your hopes up too much.

I stand corrected indeed, disconnected from my docking station and everything again grinds to a halt...

LouisPhilippe commented 1 year ago

@LouisPhilippe Can you confirm (or deny :D ) using Docker Desktop on that machine?

I was not (yet) using Docker Desktop, but as mentioned above the problem appeared again after disconnecting from my docking station...

danrossi commented 1 year ago

I'm having all my foreground services hang and can't control-c to sigint. Have to do wsl --shutdown to get a prompt again. But doing this blue screens sometimes just did it before. I've changed to accept auto updating WSL via windows updates and I updated WSL twice recently.

zakimirza88 commented 1 year ago

Related: https://stackoverflow.com/q/70567543/100836

UmanShahzad commented 1 year ago

Having the same issue. Quite annoying as it slows down all other workloads.

danrossi commented 1 year ago
wsl --shutdown

Is the only way and have to setup prompts again. This caused me two blue screens so far though.

ghost commented 1 year ago

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!

UmanShahzad commented 1 year ago

Stop closing this.

mmichal3 commented 1 year ago

I still have the problem but I've realized Microsoft has no interest in actually making wsl usable. They just keep closing it.

mmichal3 commented 1 year ago

If I go in to task manager and end it it fixes it. But as it stands now wsl is an 8nteresting toy but not actually useful for anything.

danrossi commented 1 year ago

A sigint seems to take minutes to close the process. I don't see high resource issue while its hanging. It was after a windows update recently

dennisameling commented 1 year ago

@craigloewen-msft could you please reopen? I'm the author of this issue but not running into it myself anymore. Looks like some folks are still experiencing this. I can't seem to reopen myself. Thanks!

swebs commented 1 year ago

For me the CPU usage for vmmem is more like 90% when this occurs. Seems to be related to something like network changes or docking station connect/disconnect or laptop sleep.

igorMIA commented 1 year ago

Same issue. Fixed by taskkill /f /im wslservice.exe


WSL version: 1.0.0.0 Kernel version: 5.15.74.2 WSLg version: 1.0.47 MSRDC version: 1.2.3575 Direct3D version: 1.606.4 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.22621.900

danrossi commented 1 year ago

You just need to do

wsl --shutdown
MartinNeundorfer commented 1 year ago

You just need to do

wsl --shutdown

Would be nice, if that would work, tho It does not, however as was referenced by multiple people and I can confirm that as well. You are just stuck with a black shell.

The only thing that works if it happens was mentioned here: https://github.com/microsoft/WSL/issues/8529#issuecomment-1263463528