WSL: All WSL commands hang (including wsl --shutdown) but WSL is constantly using 30-40% CPU
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

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
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 298
- Comments: 352 (6 by maintainers)
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.exeThis 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!
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 --shutdownworked after a ~30s wait, but today even this method failed as allwslcommands hang indefinitely. I need to go into task manager and shut downvmwp.exe, as otherwise thevmmemprocess persists even if I kill allwslprocesses manually, and thewslcommands 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.
@benhillis
This is some kind of joke, right?
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.
Update here - we have identified a couple of causes of the vmmem process geting into this state (which also causes the wslservice executable to stop responding). Unfortunately, these issues are in the Windows OS, so we’re working through the process of backporting the fixes.
You just need to do
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!
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.
Guys I found a fix - delete windows and install Linux 😃
I’m not the original poster, but I’m having a similar issue: every
wslcommand hangs (includingwsl --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 dmesgalso 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
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!
ERROR: The process “wslservice.exe” not found
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
Same problem here. Killing WSL from Task Manager solves the issue but is obviously not ideal.
Does the command
taskkill /f /im wslservice.exework for you?Hi folks! We are actively investigating this issue, and I’ll post any updates to this thread as soon as they’re ready.
I also wanted to add a thank you for all the users sharing their logs, work arounds, and pain points surrounding this problem. I can very much see that this is a frustrating bug to deal with, and we haven’t been as communicative on this issue as I’d like (which I’ll own up to!). Going forwards I’ll keep a specific eye on this GitHub thread, even when not posting direct updates.
We solved this issue by moving all dev machines and servers to real linux. Good bye M$
I can’t believe this still isn’t fixed and nobody cares lol
Agreed
I moved to Windows from Apple back when WSL1 was a thing - WSL2 was so good, and the integration with VS Code meant most of the dev team moved to it. We enjoyed using dev containers in WSL in VS code, but this issue has been as you say half a year with nothing from MS
WSL now crashes every few days, force stopping everything all the time, I’ve personally moved to a remote dev environment on Alpine and most of my dev team have been forced to move to linux laptops
MS were really doing some very exciting things in the software development space but this issue being ignored is quite shocking 😦
This started happening to me after upgrading WSL to the Microsoft Store version. Interestingly, when the problem occurs, both of my distributions (Ubuntu and Debian) hang and CPU usage goes to 80-90%.
The only way to (temporarily) solve the problem is to open a PowerShell shell as administrator and use
taskkill /f /im wslservice.exe.Nice that this worked for you but the problem most people here are facing is that
wslprocess (e.g. wmmem) totally hangs. Sowsl -l -vdoes not answer at all norwsl --shutdownor any otherwslcommand. I just rebooted my windows and still have the same problem after reboot. I already updatedwslto the latest release (not pre-release) but still no luck. I need docker for my daily work but professional work with docker on windows does not seem to be possible. My need to switch to Mac…I found a combo of killing all the wsl services and then restarting LxssManager service managed to get it working.
In an admin powershell session:
Don’t know if it’ll work for everyone but it worked for me
I was having this issue as well and the following worked for me.
I had to reinstall the Ubuntu distro but since then I have not had the hanging wsl issue.
Same here. Need to terminate the process from task manager. This issue started after updated WSL to the Store version.
Facing the same issue: It’s Windows, what were we expecting?
I can confirm that this issue also haunts me. This occurs whenever my laptop goes to sleep.
Suspending the WSL does not help. Only killing it with
taskkill /f /im wslservice.exehelps until the next system wake-up. I’m using Docker, so I must restart a docker service.Same issue here. Using WSL2…
wsl --shutdownhangs as does any otherwslcommand.taskkill /f /im wslservice.exeresults inERROR: The process "wslservice.exe" not found.How to properly force kill/restart WSL in this situation without rebooting?it’s so sad that such a small indie company like microsoft can not fix a bug with cpu overconsumption for 2 years
I find it also helps to pat the top of your head while rubbing your stomach and turning three times in place.
I just posted this on a similar issue; hope it helps others.
WslForceRestartis the only thing that works for me. I have it in a powershell profile. Must be run as admin.WslStopandWslRestartare both useless functions. I’m including them here just to point out that they don’t work for me. Andwsl --shutdownhas been useless for … maybe the last year.Thanks, this quote was helpful for my case. The problem was that LxssManager service was hanging in stopping process. The attempt to kill LxssManager service in services.msc during stopping process didn’t work for me. So, I found the LxssManager service under Service Host: Local System in taskmanger and killed it. And then, I restarted LxssManager service in services.msc and wsl command came back to normal.
I gave up on this - the issue has caused problems with every developer within my company.
I’ve taken the decision to move everyone to cloud-based dev environments. Such a shame as WSL was so stable till earlier this year, we migrated from linux dev environments to windows + WSL + vscode - but it can’t be relied upon recently for critical work. Even personally I was having to force quit WSL every couple of days.
Also got this issue. CPU Usage of the Vmmem.exe process shoots up to 90% usage, seemingly at random.
taskkill /f /im wslservice.exeworks, but it’s rather annoying to do this every time this issue occurs.Hopefully there will be a fix one day soon, but I understand that identifying the source of this problem can be quite difficult and maybe this is an environment issue (Drivers, hardware, etc.).
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.
Are you also using docker desktop?
It seemed to me that my problems started with docker desktop 4.42, searching on Docker issues someone talked about problems with the resource saver, disabling it yesterday WSL did not crash all day.
Today an even more specific issue was created (https://github.com/docker/for-win/issues/14827), try disabling the docker resource saver to see if WSL stops crashing.
Ciao
try this command with Powershell:
taskkill /f /im wslservice.exedid you start powershell as admin?
Same here; this just started happening in the last few days; Please re-open this MSFT!
Once you kill the task with
taskkill /f /im wslservice.exe(run as admin), make sure to update WSL withwsl --update. After that you can open your WSL distro like normal. i would recommend restarting your host machine as well.Never had this issue before because i’ve always updated WSL from Microsoft Store. Since the change to MS, i had only Winget to update my software (Docker included) but that repository does not manage WSL.
The updates will kick your ass if you don’t keep track of all of them. Make sure you are up to date.
@scscgit Hi, random user who set up the untrusted kernel binary builds here. 🙋♂️ FYI: I put a lot of effort into automating the build and release process in order to make it trustworthy for other users. All of the released binaries are created by the GitHub actions of that repository. You can verify that the binaries on the releases page are uploaded by
github-actionsand not by me:If you’re still uncertain, though, you are able to build the kernel yourself using the steps from the GitHub action. You can even [build the necessary Docker image yourself]. Everything you need is in that repo.
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 😃
Have you try to update wsl with
wsl --updateWSL stuck because of lxssmanager lxssmanager stuck at stopping
So how to shut stuck lxssmanager? Answer here https://stackoverflow.com/a/70567544
First get the PID of svchost.exe running LxssManager, open the cmd as administrator and run:
tasklist /svc /fi "imagename eq svchost.exe" | findstr LxssManagerGrab the returned PID, then run task manager as administrator, in the details tab, search for the svchost.exe containing the PID, right click it and select ‘end process tree’.
Now you should be able to restart wsl normally with 'wsl shutdown and wsl.
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.
Thank you very much for your efforts!
However, I believe the sentiment is: Why hasn’t @microsoft et al pushed a fix vs. a non-Microsoft open-source contributor @carlfriedrich ? MS could easily verify your solution generally works to solve the issue (and hopefully give you credit…) but as of now, 2 and a half years after this issue opened, there’s been very little activity on pushing a solution to this problem.
I said that too early, issue still present.
I’ve been experiencing the same issue for a whle now. I keep checking different threads to see if there’s an actual fix and not just killing wslservice.exe.
What do we need to do to even get some acknowledgement?
I don’t think it’s as simple as a low memory thing as one user suggested - 16GB isn’t pushing limits but I wouldn’t say it’s low.
I’ve got 32GB of RAM, DDR4 and DDR5 laptops and I’m facing this issue, especially when waking from sleep.
This is a relatively recent issue (in the last year) as I was not experiencing this in 2021 and 2022 on Windows 10 and early releases of Windows 11.
Happening quite often recently after starting to use IntelliJ Remote Development with WSL
helped
This might be helpful - https://medium.com/@nik.xyz.in/wsl-hanged-aeddd267fe3b
Even if the process-killing workaround always worked, they require elevated rights, and this is a multiuser operating system which are promoted and sold to companies that buy is believing that normal daily work is possible without those elevated rights.
No, it’s possible, and MS doesn’t seem to care much, and those companies that are buyers also don’t seem to be interested. Let’s face the fact: decision maker don’t have clue these days.
Too bad this isn’t a solution for users who aren’t willing to install an untrusted kernel binary build, provided by a random user, on their system 😦 Btw. @mhofman, you didn’t report whether it also works with Docker.
People who still see this problem: is it the same as discussed in this comment: https://github.com/microsoft/WSL/issues/6982#issuecomment-2294892954? I applied the workaround mentioned there and earlier in this thread (https://github.com/microsoft/WSL/issues/8529#issuecomment-2229045217) and have not since seen the problem after 4 months. I am using Windows 10 (that problem is supposed to be fixed in Windows 11 22H2) and WSL2 without Docker (I don’t know if the workaround works with Docker).
The workaround involves installing a patched WSL2 kernel as described here. As you know, the WSL2 kernel is normally the same for all your distros, so it should work for all types (I use Alma9, and occasionally ancient versions CentOS7 and Ubuntu 20.04).
When was the last response by anyone at Microsoft in this thread?
I use WSL all day at work, it was the deciding factor in me requesting a Windows laptop over Mac. I am still running into this issue multiple times a week. I have a quick batch file
(the 2nd line because the first seems to always reset the default user to root) that I run when it happens, which usually works. But this at the least forces me to quit everything I was working on and reopen all my terminals, and sometimes the
wslcommand still just hangs and does nothing afterwards.In short, this is a constant timewaster for me (and it seems like many others) and it seems like we should at least be getting occasional updates from the developers or at least just an acknowledgement that they are aware it is still an issue and they are working on it.
Just posting to confirm, this is still an issue as of January 2024. Every time hibernate is used with WSL running, which is often due to having a Docker instance open.
Usually using
will resolve the issue, after waiting a few minutes, but not always. Sometimes the command gets fully stuck and nothing happens even after half an hour.
These commands:
are not a panacea either. For many users, the issue is going to be with a WSL instance used by their Docker instance, which means, they will have
Vmmembe stuck non-responsive and causing full CPU load. Thetaskkillcommands will be ineffective then, at least we observe this on our machines. Thewsl --shutdown, like mentioned, will sometimes not finish and become stuck andGet-Service LxssManager | Restart-Servicewill just keep repeatingWARNING: Waiting for service 'LxssManager (LxssManager)' to stop....The second most reliable way I observe is
wsl --shutdown, the only absolutely reliable is restarting the machine. This is simply awful.benhillis commented “officially” (?) earlier this year but it’s hard to notice that response in the huge number of replies (some of which are auto-collapsed): https://github.com/microsoft/WSL/issues/8529#issuecomment-1460463871
Annoyingly this happens for me pretty much anytime I hibernate without forgetting to shut down wsl first.
WSL version: 1.2.5.0 Kernel version: 5.15.90.1 WSLg version: 1.0.51 MSRDC version: 1.2.3770 Direct3D version: 1.608.2-61064218 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.19045.3570
Unfortunately workarounds like this doesn’t help with those of us who do not have local admin with company issued workstations, let alone suggesting to “upgrade” to Windows 11.
try running
wsl --update3 times in a row in a cmd.exe session after a clean reboot.disabling wayland seems to help. Create a file named
.wslconfigin your user’s directory with this content:THIS DOES NOT WORK, SORRY
I got myself a Surface Pro X with SQ2 and I set up a brand new WSL installation. This happens every time after hibernate and is 100% reproducible. Windows 11 Pro 22H2.
FWIW,
wslservice.exenever seems to have been running for me but trying to start wsl several times resulted in variouswsl.exeandwslhost.exeprocesses running. Killing those processes and then runningwsl --shutdownis–tentatively–what seems to have worked for me:in case it matters:
I hope the following helps Microsoft to permanently solve the issue.
I executed
wsl.exe --system -e topand I left the window open until the issue occurs again.This is now frozen but reveals some high cpu for these two:
@tricodon workaround is the one I am still using. Big thanks to you @tricodon !!!
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.
This worked for me. Thanks a lot! Previously I would do a hard reset.
This workaround worked for me.
got same issue at the end of 2024
This issue is stills happens to me, updating to the latest version generally fixes it but it does keep coming back.
You don’t need to kill vmmem but just
wslservice.exe. Killingwslservice.exeterminate all wsl.exe and vmmemSeems to happen to me some time after hibernation as well (not immediately, but after a few hours).
I create logs and found this:
It happens not only after hibernation, but after hibernation you get it 100%
I run into this often enough that I added a function to my PowerShell profile. So far, every time I’ve run this it has resolved the issue. I try to stop/exit Docker Desktop before running this.
WSL2 Hanging Solution . Windows 10 Pro 22H2
Settings (Home).
Apps.
Search for ‘SubSystem’.
Click the Penguin head. Click 'Advanced Options’ hyperlink. A new page appears, Windows Subsystem For Linux.
Scroll down that page Click Terminate and the two Reset buttons, Repair and Reset. Note: Terminate goes dark grey during termination, then goes light grey when done. Repair and Reset have blue dots rotating around circle.
Restart WSL2, directly, or from an app within the Ubuntu folder on the windows start menu.
Big guess but, I think it may be something to do with the windows sandbox feature? Make sure you install the latest Windows 10 optional updates . A fix might appear one day.
Same issue. Fixed by
taskkill /f /im wslservice.exeWSL 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
This workaround doesn’t work for me either but
wsl --shutdowndoes (taking a minute or so to complete)yes
Thank you for sharing this. This was 100% my issue and turning off the Resource Saver fixed it for me. I wasn’t even running any containers yet the resource saver was making WSL crash/hang for me.
Docker works perfectly. I looked at how that binary was created, and it’s the CI system that generated it from the original commit of the kernel that my version of Windows was using, with a single commit reverted, so I didn’t bother recreating it.
This should be quoted as solution / workaround in the original report! It absolutely works. I had been suffering from hangs when sleeping / hibernating and using the patched kernel solved it. Anyone still reporting experiencing this issue, find your matching kernel with the patch and configure wsl2 to use it. If you’re still having issues after that, it may be a separate problem.
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.
I am having a freeze in Powershell after running wsl --shutdown command. WslLogs-2024-08-13_21-21-25.zip
Oh interesting I have a junction point for my wsl home folder under my windows profile directory, which would effectively do the same damage as mounting it to a letter (maybe worse)
Please help! I can’t stand it anymore!!!
Otherwise I prefer buy a MacBook!!
Still happening
WSL version: 2.1.5.0 same issue, happens when computer wakes up from sleep and VSCode immediately tries to connect to remote WSL distro.
Manually killing all instances of wsl.exe works as a workaround.
I had the latest release version (2.0.14) installed [*], which was giving the same trouble, so I tried upgrading with:
That gave me 2.1.1. I haven’t run with this long enough to see if the problem reoccurs, so will report back later.
[*] PS. I assumed 2.0.14 is the latest release version because
wsl --updatedoesn’t upgrade further, and it is listed as such on the GitHub releases page. Would using 2.0.15 be better than going all the way to 2.1.1?I am also facing the same issue since many months.
I have also tried “wsl --update”. It updated to latest version but the problem is still there.
I could get it working again by…
Unfortunately, for the last step I had to manually open an admin cmd, the others worked from my normal one.
This is not a solution!
It also killed my perfectly working WSL1 session, which I had to restart by hand, losing all state.
No wonder this issue is more than a year old, was attempted to be closed without solving, and no one is still listening, it is Microsoft. I have been a mac user but had to shift to windows (that too without administrator user). Created Linux containers to work and now hitting this issue. Without Administrator access, rebooting the windows is the only option. Have tried everything but nothing works. Is there a way I can restart “Windows Subsystem for Linux Service” by a non-admin user? At least would save myself from rebooting my laptop.
wsl --version WSL version: 1.2.5.0 Kernel version: 5.15.90.1 WSLg version: 1.0.51 MSRDC version: 1.2.3770 Direct3D version: 1.608.2-61064218 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.19044.3324
Just adding, that this issue still needs addressing
This looks a common issue which is not yet fixed. Even if I open the wsl from windows terminal and it remains idle for some time , it just freezes. Same case if I open wsl directly. ( I am using wsl2 )
Works when the service is start to hanging, but not after computer sleeps. But it’s better than nothing ¯\(ツ)/¯ Thanks!!
wsl hanging is the worst thing that could happen to me.
Every process that I use is tied with wsl. Everytime the wsl dies, I have to either restart it by
wsl --shutdownor worse, restart my machine. After the restart, I’m required to restart kubernetes service, docker daemon, port-forwards, setup terminal processes (listeners to the port-forwards), setup proxies, etc. Not to mention, vscode refuses to re-connect after wsl is rebooted. Gotta close and open all the vscode projects too.Speaking conservatively, I’ve been facing this issue 4-5 times a day. I won’t be lying if I say that I’ve faced this issue more than 12 times in a day too. Which is bizarre.
Thank you very much! I didn’t even have to reinstall the distro, it works fine! (but you do have to reboot twice).
The above worked for me
Having exactly this issue (WSL freezing, only Taskkill/Taskmanager + Lxss service restart helps) since getting new PC with Win 11 couple of months ago.
I found a workaround which works at least for me: if I keep both WSL1 and WSL2 shells open in terminal, this $#!@ does NOT happen. If I forget to do it, WSL hangs next time I leave my PC idle for couple of hours. (I use both WSL1 and 2).
Maybe this will help someone.
https://github.com/microsoft/WSL/issues/9758
Similar issue, in my case this happens 100% of time when waking up the computer from sleep. This is happening since a Windows and/or WSL update 1-2 months back. The only solution which works (apart from restarting Windows) is:
taskkill /f /im wslservice.exe. Docker Desktop then prompts me to restart it. It’s really annoying as I have to reopen all my console windows and VS Code.WSL version: 1.0.3.0 Kernel version: 5.15.79.1 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.22623.1037
Distributor ID: Ubuntu Description: Ubuntu 22.04.1 LTS Release: 22.04 Codename: jammy
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.
Stop closing this.
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…
+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 ❤️
note that on that thread above there is now a new docker version that fixes the issue apparently:
Grazie @bessone! This seems to have fixed my issue with WSL which was hanging after a few minutes. Seeing your comment, it seems to have been whenever the resource saver started (5 mins).
U can try to optimize the performance of wsl -
These thing have make my wsl bit faster and those issues start coming less frequent
Hey, new to this thread (which looks like it’s been going on for a long time!). I was facing the same issue where
wsl --shutdownwill hang in powershell. I triedtaskkill /f /im wslservice.exeas well which did stop the task, but didn’t resolve the issue. Finally, tried opening up a recent project I was working on WSL in VS Code, and it just connected to WSL!wsl --shutdownalso worked instantly in powershell afterwards. Might be useful as a temporary fix if it works for you!Somewhat ironically… the only machine I am having this issue on… is a microsoft surface 🤦♀ M$FT can’t even make this work with sleep on their own devices lol.
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.
I can’t believe this issue is still opening after 3 years. MS awesome
This process is eating up 16GB of memory without anyway of killing it, just awesome!
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.
I think
firewall=trueis the problem.baterja dixit:
Nah, happens to me on a device that’s always running (though a laptop, it’s placed in a switch room at the office, I only use it remotely).
Aaron Holmes dixit:
Huh.
I did have an old share in the NET USE list, which was unavailable though. I deleted it, let’s see whether it will still show up.
No mounting or junction-pointing WSL; in fact, I use almost nothing of the Windows side of this machine (other than the occasional vsdevcmd and nmake in cmd) as it’s just to port and test software, my main access is ssh’ing into the WSL 1 (which is stable and hasn’t triggered the issue), from there cmd when needed, from there switch to WSL 2 with ‘wsl -d Debian’ (I’ve the stock Ubuntu as WSL 1 and a new Debian instancde as WSL 2). Or RDP when necessary, but I prefer to avoid that.
Can you clarify what is meant by “map network drive in explorer”?
Mathieu Hofman dixit:
This is totally unrelated to the hang of the wsl command, which happens by merely having used one WSL 2 session since booting.
I have this EXACT issue
I resolved this issue by running terminal as Admin (Windows + X). However, when the memory usage became too high, it would abruptly terminate my latest command (e.g. building Angular) with message “Killed”.
Since then, I followed these instructions to increase wsl2 memory allocation. Since implementing those changes, I haven’t encountered this problem again.
So, what I do:
I’m experiencing this issue too. The only solution works for me is restarting my laptop. It’s so frustating since I need to reopen every workspace in VS Code and other apps.
It’s silly and annoying, but I can usually recover from this state with this, which I run from a batch script file. Obviously not a real fix though. 😦
Yes, I mostly use command line tools as admin, still got access denied when killing vmmem. I ended up killing all wsl processes in task manager; this action then killed vmmem.
Did you run as administrator? If not search for powershell, press right click and run as adminstrator
Then run this command:
taskkill /f /im wsl.exeI managed to use wsl --shutdown a few times. However this time, it (vmmem) hangs completely. The command of @AbdElRahmanMostafa1 also does nothing.
edit: when trying to kill the “vmmem” process, I get “Access Denied”.
Please run this instead:
taskkill /f /im wsl.exeOh, this is wonderful.
I went quite a while without this issue… having used only my WSL1 system.
Now I wanted to upgrade my WSL2 system to the latest Debian point release, did so, exited the session, figured I forgot a config change I wanted to do, tried
wsl -d Debian, and evenwsl -land… it hangs. This quickly.What I do not have is the high CPU load, however, just the hanging command.
Is it applicable to 2.1, but I’ve got this issue yesterday with it:
Same here - this would be a killer feature of Windows for me if it were more reliable. I am anxious to get it working without having to reboot a couple of times each day.
Hi @craigloewen-msft,
Thanks for the investigations and news. If you are still trying to debug the issue and aren’t able to reproduce it yourself, and have some more ideas of logfiles or additional process monitoring that we could check when the system hangs up, do let us know. I’ll do my best to try to help.
Filip Persson dixit:
Yeah.
At least it’s possible to only use WSL 1, which is better than WSL 2 anyway, to avoid this issue.
bye, //mirabilos
Infrastrukturexperte • Qvest Digital AG Am Dickobskreuz 10, D-53121 Bonn • https://www.qvest-digital.com/ Telephon +49 228 54881-393 • Fax: +49 228 54881-235 HRB AG Bonn 18196 • USt-ID (VAT): DE274355441 Vorstand: Dr. Stefan Barth, Kai Ebenrett, Boris Esser, Alexander Steeg Vorsitzender Aufsichtsrat: Peter Nöthen
I have been following this thread for almost a year now. It has been frustrating to say the least. I updated WSL with the new beta patch which seems to have lowered the frequency of crashes somewhat, but then WSL never released any hard drive space back to the windows partition. I hopelessly tried solution to clean the virtual disk space. Eventually, I had no hard drive space left on my windows partition.
I suspect that the team that developed WSL is no longer at Microsoft and the project is bit-rotting away slowly. We have not heard anything here from Microsoft as far as I know…
Anyway, at my work we have now finally switched to apple computers. This ends WSL for my part, and I hope to never see it again.
Side note: Since the beginning, Microsoft has been developing rushed software, new frameworks to replace old ones, but never drops them. They pass the cost onto you instead (Fun fact: Bill Gates bought DOS for $70k, which was called qDOS - quick and Dirty OS. Very little has changed it seems.)
Also facing this issue. What is the process called that I need to kill in Windows Task Manager for WSL to shut down?
Says
[Edit]
Ah, I had to do:
Unfortunately, WSL would not come up afterwards again. So still a full reboot.
Unfortunately not yet, due to company policies i am still bound to win10
good lord, i know microsoft just trying their best, i am at this point i can choose between two things (as long as i have to use windows):
Things you expect to do on a sophisticated OS, right?
It is one of the tips I found during my search, e.g. here: https://www.minitool.com/news/vmmem-high-memory.html And until now I had no more hangs or vmmemwsl high cpu issues.
Since I’m using VcxSrv gui applications do still work.
THIS DOES NOT WORK, SORRY
Jakob dixit:
That sounds more like magic placebos and cargo-culting than a real solution… what should that bring, and where would that be documented…
Same issue is happening to me for last 12 months or more. I always shutdown
DockerandWSLas a workaround. Then I tried to limit the allocated memory towsland it made some improvements but this hanging thing still occurs from time to time. Sometimeswsldoesn’t even respond to shutdown command and Docker fails to start when it happens.Please provide a fix for this!
Isn’t anyone from Microsoft around? Who is responsible for this mess?
So I just ran into this problem again after about7 hours since I started working. None of the aforementioned security applications was doing anything. I was using Visual Studio Code via WSL. I saw that the background node.js was utilising the CPU heavily once I noticed my Windows Terminal shells becoming slow to respond to keys. I quit out of all Code windows. Node.js was gone from top and no heavy CPU load was showing within WSL2. However, this did cause Vmmem to behave again. At the moment of this writing it is stuck at 98% CPU.
First off, @andcha’s workaround did not work for me, none of the svchost entries was because of LxssManager.
At first my shells were sluggish in responding, now they do not respond at all anymore.
Trying to
wsl --terminate Debianjust hangs on the command prompt.I did run the PowerShell collection script, hopefully it has some useful information. WslLogs-2023-07-27_15-38-22.zip
Also seeing this behavior. I find that it’s much more likely to hang with high disk usage. During the hang, if you open a terminal and try to use the filesystem, e.g.
ls, the command will also hang indefinitely. WSL commands will not work in this state.The issue is still apt, and still slows us down. When can this be fixed?
Had hopes this would work, but after a day or two I’m back at WSL hang issues.
Adding to the “me too”, coming from hibernate, two docker containers where producing more CPU than usual.
docker-compose downremoved all the containers, but the CPU load on vmmem remained, andwsl --shutdownhangs forever. In parallel. an Ubuntu Distro complete hung duringapt install nodejs, cannot Ctrl-C it. Trying to open another Ubuntu Shell hangs the terminal window forever.wsl dmesghangs forever (though I am already in the hangingwsl --shutdown). Was able to runcollect-wsl-logs.ps1but company policy forbids to upload here.Thank you very much zakimirza88, this solved the issue for me, at least temporarily. What I noticed is that the LxssManagerUser_xxxxxx service was not running, and stopping it after fixing it seems to reproduce it. If you’re using Docker Desktop, do what the answer says and kill every docker process (including the service). Also run
wsl --updateto ensure you’re on the latest WSL version. I’ll reproduce the answer below by Renato Prado:A permanent solution if you only care about Docker Desktop is switching to Windows Containers (Hyper-V); to switch from command line:
& 'C:\Program Files\Docker\Docker\DockerCli.exe' -SwitchDaemonIn my environment, both
taskkill /f /im wslservice.exeand restarting didn’t work for it. However, it’s been resolved after I updated Windows10 to latest release.Same problem. It’s running under a different user . Some kind of
036A94A8-1418-9295-A028AEFF305FSo I can’t kill it even from Admin prompt / Admin Task Managertaskkill /f /im wslservice.exehelpedFor wsl2 try:
on CMD with admin access:
` taskkill /F /FI “IMAGENAME -eq wsl.exe”
taskkill /F /FI “IMAGENAME -eq wslhost.exe”
taskkill /F /FI “IMAGENAME -eq wslservice.exe” `
It worked thank you!
Same issue here (after restoring from hibernate), all wsl commands including
wsl --shutdownhangs (that helped previously, ~1-2 months ago), howevertaskkill /f /im wslservice.exewas working without reboot.@robindegen Details please? We use vscode dev containers and having to reboot or even
wsl --shutdownis killing us all slowly.davidsr2r dixit:
Not here, not using Docker.
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
I still have the problem but I’ve realized Microsoft has no interest in actually making wsl usable. They just keep closing it.
Related: https://stackoverflow.com/q/70567543/100836
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.
@craigloewen-msft
What information can the community provide to assist in identifying the root cause?
@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!