Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 of 2 tasks
dennisameling opened this issue Jun 19, 2022 · 311 comments
Open
1 of 2 tasks
Assignees
Labels

Comments

@dennisameling
Copy link

dennisameling commented Jun 19, 2022

Version

Microsoft Windows [Version 10.0.22621.160]

WSL Version

  • 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

@ghost ghost self-assigned this Jun 20, 2022
@mmichal3
Copy link

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
Copy link
Member

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

@ghost
Copy link

ghost commented Jun 28, 2022

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
Copy link
Member

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

Thanks!

@ghost ghost closed this as completed Jul 5, 2022
@ghost
Copy link

ghost commented Jul 5, 2022

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
Copy link

berzi commented Aug 25, 2022

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
Copy link

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

@pontusvision
Copy link

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

@georcon
Copy link

georcon commented Sep 17, 2022

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

@pernsdorff
Copy link

pernsdorff commented Sep 20, 2022

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
Copy link

rstepinski commented Sep 20, 2022

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
Copy link

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
Copy link

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
Copy link

ddonov commented Sep 30, 2022

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
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

ajohn25 commented Oct 15, 2022

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
Copy link

niekvb commented Nov 10, 2022

@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
Copy link

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
Copy link

Macmee commented Nov 13, 2022

+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
Copy link

georcon commented Nov 13, 2022

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
Copy link
Member

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
Copy link

fayora commented Nov 17, 2022

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.

@mirabilos
Copy link

mirabilos commented Jul 15, 2024 via email

@onereal7
Copy link

It's incredible that after more than 2 years this problem is still there .. and nobody seems to care or work to solve it.
Microsoft please wake up.

If it is the same problem as in the issues #8696 and #6982 then I would like to shed some light - it is being collectively solved in this thread and talked with Microsoft already.

Meanwhile, you can make a test using custom WSL kernel to check if that solves this issue for you (and, of course, report to that thread also).

P.S. this issue is since late 2019 :)

@ceciogit
Copy link

Having said this, I leave you with my personal hypothesis: I noticed that the bug doesn't happen if the running distro DOES NOT HAVE systemd (and therefore no systemctl) activated. (consider that after systemd disabled all services that actually goes up at boot need to be manully started) please try insert this into /etc/wsl.conf and let us know if im on the right way..

Actually not related.. ive retried without SystemD on Boot - Same Issue ,also tried with last Kernel as suggested by @onereal7 , and .. no.

i give up on this. VmWare and LetsGo..

@mazugrin
Copy link

Just a heads up - there's another similar but unrelated (I assume) bug for WSL on ARM that seems to have been fixed in the latest pre-release of Windows 11 (24H2). It seems as though some work has been done on WSL for this release. It may be worth trying out 24H2 to see if this issue is resolved too.

@zptan
Copy link

zptan commented Jul 19, 2024

pre-release 2.3.11 released yesterday.

@will824
Copy link

will824 commented Jul 19, 2024

I suspect in my case it is being cause by the Sophos security software. Normally vmmem would not hang, but when it does, I see a constant sophos security scan taking place. I also had to kill it using: taskkill /f /im wslservice.exe

@Jvk1166z
Copy link

Jvk1166z commented Jul 19, 2024

I ended up finding my way to this issue, because I've just encountered this same problem years later. I recently reinstalled Windows 10 after upgrading my system from an I9-9900k with 32GB RAM to a R9 7950x3d, with 128GB RAM. So no, unfortunately I don't think it has to do with RAM capacity. Prior to upgrading I'd never noticed this issue. But today I noticed that after waking up from hibernation vmmem was using about 50% of my CPU, and all wsl commands hung indefinitely. Killing the process hung my whole computer and I had to hit the reset button. I'm amazed, and also not surprised at the same time that this issue is still a problem years later. Hopefully this doesn't become a regular occurrence, I just spent a lot of time getting my Windows installation set up the way I like it, and I really don't want to have to immediately tackle the project of setting up Debian with KVM to run my Windows install after days of setup work. Though with the whole forced Win11 update looming, I guess that's inevitable anyways...

Edit: I didn't see the custom kernel or the update before posting, I'll try updating WSL and see what happens.

@IUJakob
Copy link

IUJakob commented Jul 22, 2024

...from an I9-9900k with 32GB RAM to a R9 7950x3d, with 128GB RAM. So no, unfortunately I don't think it has to do with RAM capacity

Whether it's a RAM issue or not I cannot say, however, I can say, that in this regard, it definitely does not matter how much RAM your machine has, what matters is how much of that RAM you assign to the WSL-virtual machine

@baterja
Copy link

baterja commented Jul 23, 2024

Do you need to collect some diagnostic info? It happens pretty often to me (i.e. right now) so I can try to collect it (given instructions)

WSL version: 2.2.4.0
Kernel version: 5.15.153.1-2
WSLg version: 1.0.61
MSRDC version: 1.2.5326
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26091.1-240325-1447.ge-release
Windows version: 10.0.19045.4651

Ubuntu 24.04 LTS in WSL2.
It might be important: I hibernate my laptop and rarely restart.
I also frequently encounter #5401 but now Restart-Service vmcompute returns normally but doesn't restart the WSL.

@mirabilos
Copy link

mirabilos commented Jul 23, 2024 via email

@Sunhaihua1
Copy link

I want to use remote ssh service ,so I modified .wslconfig, and all wsl commands hang as described.
Since I changed some options in .wslconfig and everything seems to be OK.

[wsl2]
#memory=24GB
networkingMode=mirrored
#dnsTunneling=true
#firewall=true
#autoProxy=false

[experimental]

#autoMemoryReclaim=gradual
hostAddressLoopback=true
#ignoredPorts=22
#sparseVhd=true

I think firewall=true is the problem.

@brantje
Copy link

brantje commented Jul 26, 2024

This process is eating up 16GB of memory without anyway of killing it, just awesome!

@0xnex
Copy link

0xnex commented Aug 1, 2024

I can't believe this issue is still opening after 3 years.
MS awesome

@mazugrin
Copy link

mazugrin commented Aug 1, 2024

Has anyone who's experienced this issue upgraded to 24H2 and then still experienced it? Other very similar bugs with the WSL have been fixed on ARM using 24H2. But before I ever get an x64 machine with Windows I'd love to hear if it's also been fixed on that platform.

@douglasg14b
Copy link

douglasg14b commented Aug 3, 2024

WSLg apps will randomly freeze, and CANNOT be killed. When this happens wsl --shutdown is no long effective, and requires a full restart.

It's insanely frustrating, and wastes so much time every week.

@IUJakob
Copy link

IUJakob commented Aug 5, 2024

WSLg apps will randomly freeze, and CANNOT be killed. When this happens wsl --shutdown is no long effective, and requires a full restart.

It's insanely frustrating, and wastes so much time every week.

The taskkill command from further up in the thread has saved me all my restarts. When wsl freezes, I run that command, and open wsl again. No more reboots necessary.

@scscgit
Copy link

scscgit commented Aug 5, 2024

@benhillis Can you maybe assign someone else to this task if you aren't working on it? And have you escalated it to someone like a manager yet, or are there any experts who understand the problem? Same for related issues like

@kaizh102
Copy link

kaizh102 commented Aug 9, 2024

updated to latest wsl prerelease. issue seems to be gone now.

@kaizh102
Copy link

kaizh102 commented Aug 9, 2024

updated to latest wsl prerelease. issue seems to be gone now.

I said that too early, issue still present.

@mujo93
Copy link

mujo93 commented Aug 13, 2024

I am having a freeze in Powershell after running wsl --shutdown command.
WslLogs-2024-08-13_21-21-25.zip

@RalfKow
Copy link

RalfKow commented Aug 14, 2024

Same problem here.

@timadye
Copy link

timadye commented Aug 14, 2024

I have been using the custom kernel that was mentioned by onereal7, following these instructions.

So far, after a month with the new kernel, I have not had another hang like the ones that previously plagued me every few days. I don't know if it really has fixed the issue, but it is very promising. I'm using Windows 10 22H2, WSL 2.2.4.0, with CentOS7 and Alma9 distros.

@faturachmanyusup
Copy link

faturachmanyusup commented Aug 27, 2024

wsl.exe dmesg

[    1.349572] clocksource: Switched to clocksource tsc
[    2.169143] misc dxg: dxgk: dxgkio_is_feature_enabled: Ioctl failed: -22
[    2.182711] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[    2.183785] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[    2.184162] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[    2.184933] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[    2.187688] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[    2.188421] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[    2.189034] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[    2.189466] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[    2.189816] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2

@oldbuilding
Copy link

WSLg apps will randomly freeze, and CANNOT be killed. When this happens wsl --shutdown is no long effective, and requires a full restart.

It's insanely frustrating, and wastes so much time every week.

I just posted this on a similar issue; hope it helps others.

function WslRestart { Get-Service LxssManager | Restart-Service }
function WslStop { Get-Service LxssManager | Stop-Service }

function WslStart { Get-Service LxssManager | Start-Service }

function WslServiceStatus {
	tasklist /svc /fi "imagename eq svchost.exe" | findstr LxssManager
	Get-Service | Where-Object { $_.name -like "*LxssManager*" }
	Get-CimInstance -ClassName Win32_Service -Filter "Name='LxssManager'"
}

function WslKill {
	Write-Host "Killing wsl.exe..."
	taskkill /F /FI "IMAGENAME eq wsl.exe"
	Write-Host "Killing wslhost.exe..."
	taskkill /F /FI "IMAGENAME eq wslhost.exe"
	Write-Host "Killing wslservice.exe..."
	taskkill /F /FI "IMAGENAME eq wslservice.exe"
}

WslForceRestart is the only thing that works for me. I have it in a powershell profile. Must be run as admin. WslStop and WslRestart are both useless functions. I'm including them here just to point out that they don't work for me. And wsl --shutdown has been useless for ... maybe the last year.

function WslForceRestart {
	WslKill
	WslStart
	WslServiceStatus
}

@renatodru
Copy link

I have the same problem, I tried everything, there is no command to kill or stop this process.
Fortunately I managed to suspend it and thus freed up the CPU, but it continues to consume 21GB of memory.
image

@sgombai
Copy link

sgombai commented Oct 4, 2024

So if I understand right, if you use this feature on MS's multiuser operating system, then the only solution that avoids restarting the whole OS is to be an administrator on that multiuser operating system.
In 2024.
And they don't handle it as prio 1.
And they don't say they're just kidding while selling this product.

@gianluca-sabena
Copy link

I have the same problem, WSL2 freeze! And wsl --shutdown doesn't work! I use only vscode, no WSLg apps...

@alexiglesias31
Copy link

Same issue here 😞

@bennycode
Copy link

I have the same problem, WSL2 freeze! And wsl --shutdown doesn't work! I use only vscode, no WSLg apps...

Does the command taskkill /f /im wslservice.exe work for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests