microsoft / WSL

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

WSL is non-responsive after waking from hibernate #8696

Open roja45 opened 2 years ago

roja45 commented 2 years ago

Version

Windows 11 Pro 21h2 build 22000.832

WSL Version

Kernel Version

5.10.60.1

Distro Version

Ubuntu 2-.04

Other Software

Docker desktop windows

Repro Steps

Hibernate machine Start up windows open a new terminal

Expected Behavior

Shouldn't hang

Actual Behavior

No response, terminal hangs. wsl --shutdown from command prompt also hangs, only solution is to restart the machine.

Diagnostic Logs

No response

deeep commented 1 year ago

I still experience this sometimes, but now not on every wake-up as before. Most of the time it fixes when i hibernate it again and wake up. (much faster than reboot and start everything, docker ... )

suwidadi commented 1 year ago

I finally have this way out, I shut down all VM with wsl -t then hibernate the windows. after awake then using bash command again and it's up and working as usual.

civanescu commented 1 year ago

Update "KB5017383" seems to solve the situation.

Unfortunate is not working, yesterday after hibernate worked ok, but over the night, today, started to be unresponsive again. Workaround for me was wsl --shutdown and docker sensed that the he had a problem and proposed to restart.

rowleya commented 1 year ago

I still haven't seen issues (crossed fingers) since doing all updates, but I also note that I don't have docker installed in Windows, so I am not using that part of it; this may in fact be two issues that look similar therefore, one with docker and one that was something else. It was suggested previously (https://github.com/microsoft/WSL/issues/8696#issuecomment-1242929395) that a docker update might fix one issue, but not having docker I don't know...

markymarrow commented 1 year ago

It didn't make a difference for me whether I had started docker or not, I was still getting the hang. (the docker update fixed the high cpu usage of vmmem but didn't help with the WSL hang) However, Windows 11 22H2 installed yesterday which puts me on build 22621.521 (1000.22634.1000.0) WSL is still alive this morning after the overnight hibernate.

rowleya commented 1 year ago

I am also on that version on Windows now, and haven't seen the issue since.

martinlingstuyl commented 1 year ago

Same here, Windows 11, version 21H2, Build 22000.978 (1000.22000.978.0)

Problem looks like it's solved.

bitroniq commented 1 year ago

Same here - I have to do these steps every time I resume from hibernation every day:

PS C:\WINDOWS\system32> wsl --list --verbose
  NAME                   STATE           VERSION
* Ubuntu-20.04           Running         2
  docker-desktop-data    Stopped         2
  docker-desktop         Stopped         2
PS C:\WINDOWS\system32> wsl --terminate Ubuntu-20.04
PS C:\WINDOWS\system32> wsl

BTW. wsl --shutdown doesn't work - it hangs

martinlingstuyl commented 1 year ago

Same here - I have to do these steps every time I resume from hibernation every day:


PS C:\WINDOWS\system32> wsl --list --verbose

  NAME                   STATE           VERSION

* Ubuntu-20.04           Running         2

  docker-desktop-data    Stopped         2

  docker-desktop         Stopped         2

PS C:\WINDOWS\system32> wsl --terminate Ubuntu-20.04

PS C:\WINDOWS\system32> wsl

BTW. wsl --shutdown doesn't work - it hangs

Ah, nice to know! I'd not yet discovered the list and terminate options. Shutdown hung with me as well.

cdonner commented 1 year ago

This has been plaguing me for several weeks. 10.0.22000.1042. I have to reboot every morning because the Docker containers are unresponsive and can't be shut down or restarted, and VS Code can't connect. I have had KB5017328 since 9/20 and it certainly did not resolve it but rather may have caused it.

JoshMart commented 1 year ago

This just happened to me after waking my computer after a hibernate. Any updates on this?

lakinmohapatra commented 1 year ago

I also faced the same issue.

martinlingstuyl commented 1 year ago

This just happened to me after waking my computer after a hibernate. Any updates on this?

My issues where resolved after updating windows and docker...

cdonner commented 1 year ago

Same here - I have to do these steps every time I resume from hibernation every day:

PS C:\Windows\System32> wsl --list --verbose
  NAME                   STATE           VERSION
* Ubuntu                 Stopped         2
  docker-desktop         Running         2
  docker-desktop-data    Running         2

PS C:\Windows\System32> wsl
The operation timed out because a response was not received from the virtual machine or container.

The steps don't work for me. Terminating WSL takes a long time and will eventually complete, but restarting times out.

dparraho commented 1 year ago

Any news from Microsoft to solve this issue? Or how can we tag them to make them acknowledge?

speller commented 1 year ago

I have a similar issue. After waking up, all wslg apps die, all terminal windows dies with error code, new terminal sessions can not be established, the wsl command hangs (even without parameters), wsl --shutdown command hangs. But no CPU or memory issues and I can access my Linux file system by the network share.

Dogy007 commented 1 year ago

Same Problem here, it will almost always hang if left open. Sometimes it still works if I close it before the hibernate

WSL-Version: 0.68.2.0 Kernelversion: 5.15.62.1 WSLg-Version: 1.0.44 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

genmeblog commented 1 year ago

After some recent Windows upgrades I haven't observed hanging after hibernation. My current version is: 10.0.22621.674

namtab00 commented 1 year ago

For me issue persists waking from hibernate

image

image

gyaaniguy commented 1 year ago

Issue resolved for me on 22H2

gsarig commented 1 year ago

The issue was caused after a Windows update (don't remember exactly which one), and the new Windows 11 22H2 solves it. Unfortunately, my Surface Pro 8 had a "safeguard hold", which prevented the update. This issue was so annoying, though, that I temporarily deactivated safeguard holds following this guide and updated anyway. After the update I enabled back the safeguard holds. Luckily, everything went smoothly, and I didn't have the slightest issue since then.

chm10 commented 1 year ago

With the same issue, yet. WSL is non-responsive after waking from hibernate

Edition Windows 11 Home Single Language
Version 22H2
Installed   ‎05/‎10/‎2022
 SO 22621.674
Windows Feature Experience Pack 1000.22634.1000.0
Docker Desktop 4.12.0 (85629)

After running wsl --version

WSL Version: 0.70.0.0                                                                                                 
kernel version: 5.15.68.1                                                                                             
Windows version: 10.0.22621.674 

I need to restart or kill the process wslservice.exe on Windows details to run the Linux.

wsl --shutdown

Not working.

suwidadi commented 1 year ago

after updating to 22H2, it's been 2 weeks since I put the PC hibernate on and off and WSL is still working. I'm on 22H2 22621.674

gaia commented 1 year ago

WSL version: 0.70.0.0 Kernel version: 5.15.68.1 WSLg version: 1.0.45 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.22000.1098

When the issue starts, vmmemWSL hogs up the CPU and can't be killed (access is denied)

I noticed today that it didn't freeze immediately after waking up from hibernation. It took maybe 5 or 10 minutes. When I went to restart the machine, it threw a reference by pointer BSOD. Could this be related, or is it more likely I have an independent reference by pointer issue?

BSOD bugcheck 0x18(0x0, 0xFFFF8003BFB63E40, 0x2, 0xFFFFFFFFFFFFFFFF) in both memory.dmp and minidump.

PS: The reason I have to hibernate is bc sleep makes the fan louder and wakes up from time to time (besides having 0 wake_armed tasks set and using S0 Low Power Idle with Network Disconnected), making it completely useless and even harmful.

cdonner commented 1 year ago

Indeed, 22H2 resolved this.

manoj-bandara commented 1 year ago

22H2 resolved this for me also

djl197 commented 1 year ago

I am still suffering the issue: image

WSL details: WSL version: 0.70.4.0 Kernel version: 5.15.68.1 WSLg version: 1.0.45 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.22000.1098

Only a reboot saves me.

genmeblog commented 1 year ago

@djl197 I think Windows version: 10.0.22000.1098 can be a reason in your case. My current version is 10.0.22621.755 and WSL stopped hanging.

calcium commented 1 year ago

Am on 10.0.19044 and this is happening. I hibernate and on wake up, CPU goes to 100%.

Tried re-starting the vmcompute service. Tried shutting down wsl.

I only know that a reboot fixes this.

johnfzc commented 1 year ago

On my system wsl --shutdown does eventually work, but it takes a very long time to shut down. I'm installing 22H2 and hope it will resolve my problems like it has for others. I didn't have these issues with windows 10.

Update: Upgrading to 22H2 and / or upgrading my WSL kernel resolved this issue for me.

Here's my current windows version as per systeminfo:

OS Name:                   Microsoft Windows 11 Pro
OS Version:                10.0.22621 N/A Build 22621

I also upgraded my kernel using wsl --update, I'm now running Kernel version: 5.10.102.1, you can see your kernel version at the bottom of the output of wsl --status

jdxlabs commented 1 year ago

It's more a workaround than a solution, but I just disabled hibernate, following this steps : https://learn.microsoft.com/en-us/troubleshoot/windows-client/deployment/disable-and-re-enable-hibernation

And the problem is fixed (I just use Sleep mode or Shutdown).

Windows 10 Home (x64) Build 19044.2130 (21H2)

jdxlabs commented 1 year ago

It seems to be better with the 22h2 update for me too (so I can reactivate hibernate)

Windows 10 Home (x64) Build 19045.2193

isaacsu commented 1 year ago

Experiencing this too - when my laptop comes back from an overnight hibernate, WSL2's Vmmem pegs the CPU at ~90% and the WSL2 terminals are completely unresponsive.

Running wsl --shutdown in PowerShell works, but it can take ~1 minute before it kills off WSL2 and unloads the CPU.

I'm going to upgrade to 22H2 to see if it helps.

Edition Windows 10 Pro
Version 21H1
OS build    19043.2193
lingsamuel commented 1 year ago

Same here. wsl --shutdown helps, but it takes more than 1 minute. After running wsl --shutdown and wsl, docker desktop also needs to be restarted.

jdxlabs commented 1 year ago

It seems to be better with the 22h2 update for me too (so I can reactivate hibernate)

Windows 10 Home (x64) Build 19045.2193

I had the same problem with 22h2 installed, so I prefer to unactivate hibernate for now.

piotrkardasz commented 1 year ago

I don't think this is related to hibernation, I was also using PHPStorm (latest version which was supposed to have fixed a bug with WSL). I have finally abandoned PHPStorm and have been using VSCode for the last week or so, and no more problems with WSL crashing, it has been rock solid ever since.

In 22H2 I can approve that if I will hibernate PC with PHPStorm/GoLand opened with project based on WSL. When I un-hibernate the PC, WSL will crash.

Only wsl --shutdown helps but sometimes full restart is needed 😕

isaacsu commented 1 year ago

I'm going to upgrade to 22H2 to see if it helps.

Since upgrading to 22H2, WSL2 hasn't crashed upon returning from hibernate.

But I have had one instance so far where it started running the CPU at ~90% and requiring the same ~1 min wsl --shutdown procedure to terminate Vmmem and bring my laptop back to normal. For what it's worth, this would have been maybe10-20 mins after coming back from hibernate, so perhaps a delayed effect?

Edition Windows 10 Pro
Version 22H2
OS build    19045.2251
tank104 commented 1 year ago

Stopping and Starting "LxssManager' service sorts it for me.

But installing 22H2 now... fingers crossed!

dbrand666 commented 1 year ago

I'm on 10.0.22621.819 and it's still happening.

burk3 commented 1 year ago

I am seeing this issue as well: when WSL2 is booted and the system hibernates, waking up reveals unresponsive WSL2 sessions and a spinning vmmem process.

I started experiencing this issue when I upgraded the logic board in my laptop from an 11th gen Intel-based one to a 12th gen Intel-based one, keeping the same Windows installation from the same SSD. The biggest difference that I see between them is that the 11th gen only has one kind of CPU core, while the 12th gen has distinct P- and E-cores (performance and efficiency, respectively).

To rule out the whole P-/E-cores thing as a cause, is anyone experiencing the issue on an AMD CPU or on an 11th gen-or-older intel CPU? I wasn't able to reproduce on any of my systems with homogeneous cores, but I don't have access to any other hybrid core systems to confirm.

If this is only reproducible on hybrid core systems, I'd wager the issue is somewhere in the hardware VM reinitialization.

To be clear, given the same Windows installation:

After installing the driver pack for the new board, the problem persists. After at least a few windows updates (not 22H2 yet, though), the problem persists.

I tend to leave terminals open, so this issue has been motivation to a) get better at powershell and b) get better at developing software on the Windows side of this machine rather than easy-mode in WSL.

dbrand666 commented 1 year ago

I'm on 11th Gen i7. I do not see a spinning vmmem process. wsl --shutdown hangs, for hours at least.

isaacsu commented 1 year ago

Since upgrading to 22H2, WSL2 hasn't crashed upon returning from hibernate.

Spoke too soon. Upon returning from hibernate, a previously running WSL2 session would hang and spin the CPU up to ~90% until I run wsl --shutdown to terminate it.

In other words, the problem still persists after upgrading to 22H2. Upgrading to 22H2 did not fix it.

I'm on a 11th Gen Intel Core i5-1130G7 processor.

Edition Windows 10 Pro
Version 22H2
OS build    19045.2251
jeffska commented 1 year ago

Same, still hanging. On 22H2 (19045.2251) with 11th gen i7 11800H.

jonashilmersson commented 1 year ago

Hi, I also got this problem with Docker Desktop that the containers are "gone" after waking up from a hibernation. My workaround is to quit Docker before hibernating.

Brgds

Jonas

valaxkong commented 1 year ago

Same, still hanging. On Win10 21H2 with AMD 2600

chm10 commented 1 year ago

I have two computers one is Samsung Laptop i7 11 Gen, and another is a desktop Dell i7 9th gen. The 11Gen had continued to have issues, and Dell never fell into this problem. Samsung with Win 11 Home and Dell with Win 11 Pro, with 22H2.

djl197 commented 1 year ago

I have the same issue following all the updates: image

wsl --version
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.22000.1219
christoph-pflueger commented 1 year ago

Same issue here.

WSL-Version: 1.0.0.0
Kernelversion: 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.22000.1281
mstealth22 commented 1 year ago

Same issue here, no docker desktop at all.

Doesn't seem like it is every time back from sleep, but getting worse or more frequent to me.

No workaround that I've seen works other than reboot.

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.22000.1281
tamoanxx commented 1 year ago

I am having the same issue on Surface Pro 9 5G. I have found that killing the vmwp --Virtual Machine Worker Process will then allow for me to resolve the problem without restarting.

wsl --version WSL version: 1.0.1.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.22623.1020