-
Notifications
You must be signed in to change notification settings - Fork 832
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
WSL2 distro dies when the PC is sleeping #8763
Comments
Unfortunately I don't have any more specific information to contribute either, but I've also noticed this issue in the last two weeks (have been using WSL2 for two years to date). Sometimes on waking up Windows from sleep, all WSL tabs in Windows Terminal are still open, but WSL has stopped and all tabs are frozen. To get things going again, I have to run This is a separate issue from the linux clock going out of sync when Windows goes to sleep. |
I am also seeing this daily on a Dell XPS15, running Windows 11 Business 21H2 (22000.1165) (Windows Feature Experience Pack 1000.22000.1165.0). For me, Windows Terminals with WSL stuff running in them hang (unresponsive to typing), VSCode using WSL "remote" environments all hang and try to reconnect to no avail. New WSL terminals fail to start (they just open a new terminal and hang). I also see this process spinning in the Task Manager: Also, I have also used WSL2 for years and never seen this... Is it a Win11 thing? |
While this usually happens when I wake up my laptop in the morning, I have also seen the hang happen mid-way through the day, too. |
As a non-guaranteed workaround, I've disabled automatic Microsoft Store updates. I suppose they were a reason at least for some of the dies. Since that, I've updated Windows to the latest cumulative update and for a couple of weeks, I don't face this issue. @argo-wayneb dies during the daytime work can be related to microsoft/wslg#678 |
I updated Windows (11 Pro) to Version 10.0.22621 (i.e. version 22H2) (Build 22621) a few days ago and it seems to have fixed the problem for me. Interested to hear if it works for others. |
I have been having this problem since I updated to "2022-11 Cumulative Update for Windows 11 Version 22H2 for x64-based Systems (KB5020044)" 3 days ago. WSL (and all applications using WSL) crash after my computer wakes from sleep and requires a full reboot. |
I face this issue almost every morning with my laptop running the latest stable Windows 11. On my desktop (latest insiders builds) I do not have this issue however... This command (elevated PS prompt) fixes it for me: |
I've been facing this issue, too, more frequently after upgrading to W11, This also happens overnight or whenever the PC sleeps for more than 30 minutes or so. I've just downgraded to WSL 1 in hopes it removes the issue, I will let you know if it does. |
This started happening to me too last few days and now seems to happen after every night (or longer time away from the laptop). Running on a Dell XPS 17 with Win 11 21H2 22000.1696, WSL2 Ubuntu 22.04.2. I am using Windows Terminal, have a few tabs open and everything is fine. I leave my laptop so that it sleeps or hibernate it and when logging back in the Terminal window has closed. If I open it it just hangs and no prompt comes up. Any Same as @thecharlesjenkins, I have two EDIT: I wonder if it has some connection to Docker... If I don't have Docker running it seems as if it is not happening, and I also got a "crash" when starting a few new containers and I got |
You can add me to the list of people with this same problem. It started a few weeks ago. While building a Linux application via WSL/Visual Studio, it will randomly hang and I have to reboot, as any powershell wsl commands just hang forever. This will happen to me multiple times per day. |
This has gotten completely out of hand! It now terminates WSL2 several times a day, also killing Docker desktop and VSCode. Previously this happened after sleep or hibernate, but now it happens in the middle of working with the laptop. |
After downgrading to WSL 1, at least it shows the prompt when logging back. I might need to restart the service, but it does not hang. |
I have been facing a similar issue for a couple of weeks now.
I usually have two instances of ubuntu 22.04 running, one using wsl1, the other wsl2. |
seems to be a duplicate of #6982 |
In my case, all the GUI applications running under WSLg die. However, the initial terminal from which they have been launch still runs. It might not be related with this issue and I should probably open a new issue. Still, only a few weeks ago, GUI applications survived Sleep mode.
|
Can confirm same problem here. When the laptop goes to sleep wsl wont start again, this is especially annoying when docker and kubernetes build because you lose your work with building images that is stored in the WSLmem. |
I have the same issue on Windows 10 pro with running wsl2. After waking the computer from sleep, wsl tends to not function properly (frozen inside terminal). |
I am experiencing this problem several times a day, when and only when PC sleeps.
X11 server gets restarted automatically once it's crashed; after that X11 programs seem to start normally. I don't know if it's relevant, but chromium makes complaints about egl during startup like:
(although seems otherwise to work for my purposes) WSL version 2.1.5.0 |
Same issue here with WSL 2.3.12.0 |
Still is happening, and a major issue. If I start WSL and Docker is installed, then put the computer to sleep and bring it back up, the CPU usage will climb to 100% and stay stuck there. And I cannot terminate |
More than 2 years after the first report, this problem is still there. If the computer is suspended or hibernates with WSL and Docker Desktop running, WSL hangs. I can't even execute a |
@wcruz-br : if it helps, you can try rudely killing |
I solved it uninstalling Docker for Windows. 🤷 |
I didn't suffer from the crashes after a few WSL2 updates, but my Docker Desktop was often causing issues instead. Unfortunately Portainer is not a free product so I do everything in CLI for Docker... 😅 |
You can use the community edition for free, installing it in a local container. That's what I do here. 😉 |
My earlier comment stands corrected - today I could not kill Killing related Needless to say, Googling around, I found #8529 referenced from https://superuser.com/questions/1645056/how-can-i-stop-vmmem-process with this gem for a force-kill:
...which worked for me and instantly killed the stragglers like Note that other posts in that SU discussion offer more processes to try killing, or services to recycle, depending on how the Docker Desktop VM is backed (e.g. Hyper-V) which may be in scope for those who come to research this problem but may be out of scope for WSL issue/ticket. |
Version
Microsoft Windows [Version 10.0.22621.382]
WSL Version
Kernel Version
5.15.57.1
Distro Version
Ubuntu-20.04
Other Software
No response
Repro Steps
The bug is floating. Regularly, but not always, I found all WSL2 apps in the Ubuntu distro have been killed while the PC was asleep. Docker Desktop usually survives. Opened shell windows in the Ubuntu distro exit with an error status.
Expected Behavior
All apps are working when waking from sleep.
Actual Behavior
Sometimes apps are killed.
Diagnostic Logs
How to see logs right when the issue happened, without turning logs on permanently for days?
The text was updated successfully, but these errors were encountered: