Skip to content

WSL is non-responsive after waking from hibernate #8696

Open

Description

@roja45

Version

Windows 11 Pro 21h2 build 22000.832

WSL Version

  • WSL 2
  • WSL 1

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

Activity

  1. roja45 commented on Aug 6, 2022

    @roja45
    Author

    image

  2. roja45 commented on Aug 6, 2022

    @roja45
    Author

    image

  3. roja45 commented on Aug 8, 2022

    @roja45
    Author

    WslLogs-2022-08-08_08-43-05.zip

    logs captured while trying to restart wsl

  4. De-Been-Tech-Solutions commented on Aug 9, 2022

    @De-Been-Tech-Solutions

    WSL has found it hard to reconnect to the PC's storage by the sounds of things.

    The next time this happens, I believe restarting WSL will fix it, as it does appear to have a memory leak as well.

    Close then re-open is what I meant by this.

  5. roja45 commented on Aug 9, 2022

    @roja45
    Author

    But how do I restart wsl? wsl --shutdown just hangs.

  6. De-Been-Tech-Solutions commented on Aug 9, 2022

    @De-Been-Tech-Solutions

    You close it.

    Then you re-open it.

  7. De-Been-Tech-Solutions commented on Aug 9, 2022

    @De-Been-Tech-Solutions

    If it won't close, open task manager then kill the process from there.

  8. david-dlc-cerezo commented on Aug 16, 2022

    @david-dlc-cerezo

    Same happens to me, no posible to wsl --shutdown, it hangs as well. The only solution is to restart windows, what is is quite annoying.

  9. QuentinLemCode commented on Aug 16, 2022

    @QuentinLemCode

    Hello
    Same issue for me, the wsl command hangs at each command
    image

    Edit : I managed to relaunch it without restarting windows by killing all wsl processes in task manager

  10. roja45 commented on Aug 16, 2022

    @roja45
    Author

    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.

  11. pnmcosta commented on Sep 7, 2022

    @pnmcosta

    I'm on 22000.918 I do get an error after hibernate wake:
    image

    Only a full restart fixes it! 👎

  12. rowleya commented on Sep 8, 2022

    @rowleya

    On Windows OS Build 22000.918, I am also getting a freeze of WSL2 on return from hibernate. CPU use is high:
    image

    I also can't stop the service:
    image

    WSL doesn't respond at all (listing doesn't work, status doesn't work, version doesn't work):
    image

    I am using the latest WSL release 0.66.2.

    Restart works to bring things back but that is all that works.

  13. egorgam commented on Sep 11, 2022

    @egorgam

    rowleya you may to try update Docker Desktop for last version (v4.12) #8703

    In my case I have same problems with WSL2 and hibernate behavior. I tried to turn off hibernation but looks like my laptop dont support S1-S3 sleep mode. So updating the Docker fixed vmmem leak, but not wsl2 stucks after waking up.

  14. rowleya commented on Sep 12, 2022

    @rowleya

    I don't have Docker Desktop installed here as I use docker on WSL2 when needed. Note that there isn't a vmmem memory leak here; that is just how much memory I am using!

    Of interest, I usually use eclipse within WSL2 and leave that running when hibernating. That had been working until recently, but with the issue, it also meant that the CPU usage of VMMem went very high when restoring from hibernate. On Friday I closed eclipse before hibernating, and on coming back this morning, the high CPU is gone, but WSL still won't start up again without a restart of the computer.

  15. rowleya commented on Sep 12, 2022

    @rowleya

    OK, even more interesting, I saw a thread about collecting wsl logs, so I tried to do that this morning, running the process just before hibernating. It seems that the issue didn't then show up. I don't know if this means that it is something to do with the amount of time of hibernation or something... I will try to remember to run the logging process tonight again and see what happens tomorrow...

  16. 491 remaining items

  17. developer992 commented on Aug 5, 2025

    @developer992

    Still an issue.

    I use pycharm from WSL and once laptop wakes from hibernation, the opened app is gone and opening it again does not work. Have to wsl --shutdown to make it work WHICH IS EXTREMELY ANNOYING but trust microsoft TO NEVER FIX ANYTHING

  18. wvolkov commented on Aug 5, 2025

    @wvolkov

    The only fix that helped me is moving my work process from a laptop (I used Surface Pro 6 / 7+) to my Desktop PC which I build myself with pretty old MSI motherboard (MPG Z390I) - I have never seen that issue anymore (for the past 1 year), despite the fact that I've just copy-pasted all the configuration which remained at the virtual disk AS IS (simply copied .vhdx file from a path specified at registry path Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss\{randon uuid}\BasePath from a laptop to desktop and then tweaked the reference of it to a new path at the PC)

    Surface Pro 7+ Config:

    Edition Windows 10 Pro
    Version 221-12
    OS Build 19045.6093
    
    WSL version: 2.0.14.0
    Kernel version: 5.15.133.1-1
    WSLg version: 1.0.59
    MSRDC version: 1.2.4677
    Direct3D version: 1.611.1-81528511
    DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
    Windows version: 10.0.19045.6093
    

    DesktopPC Config

    Edition Windows 10 Pro
    Version 221-12
    OS Build 19045.6093
    
    WSL version: 2.4.12.0
    Kernel version: 5.15.167.4-1
    WSLg version: 1.0.65
    MSRDC version: 1.2.5716
    Direct3D version: 1.611.1-81528511
    DXCore version: 10.0.26100.1-240331-1435.ge-release
    Windows version: 10.0.19045.6093
    
  19. paddyfink commented on Sep 13, 2025

    @paddyfink

    Having to force-restart WSL every time my laptop goes to sleep is really a toll on productivity. I've been trying to resist for years, but maybe , as a developper, I should just make my life easier and switch to a mac.

  20. DanielMOliveira commented on Sep 14, 2025

    @DanielMOliveira

    Having to force-restart WSL every time my laptop goes to sleep is really a toll on productivity. I've been trying to resist for years, but maybe , as a developper, I should just make my life easier and switch to a mac.

    Try it on task scheduler. Was the only solution for me.
    wsl -d $InstanceName -e bash -c "echo alive $(date)"

  21. Crypto-Spartan commented on Sep 15, 2025

    @Crypto-Spartan

    paddyfink can you check your kernel version? as of March 2025, this was supposed to be fixed with the 6.6.X branch of the WSL kernel from Microsoft: #6982 (comment)

  22. enBonnet commented on Sep 22, 2025

    @enBonnet

    Hello Same issue for me, the wsl command hangs at each command image

    Edit : I managed to relaunch it without restarting windows by killing all wsl processes in task manager

    It's actually working, but I'll take, like, 10 minutes. It does to me.

    I have made a script to reset wsl:

    # Stop and Restart WSL Script
    # Run as Administrator
    
    Write-Host "Stopping WSL..." -ForegroundColor Yellow
    
    # Stop all WSL distributions
    wsl --shutdown
    
    # Wait a moment for processes to terminate
    Start-Sleep -Seconds 3
    
    # Kill any remaining wsl.exe processes (forceful method)
    $wsLProcesses = Get-Process | Where-Object { $_.ProcessName -like "wsl*" }
    if ($wsLProcesses) {
        Write-Host "Found $($wsLProcesses.Count) wsl.exe processes. Terminating..." -ForegroundColor Yellow
        $wsLProcesses | Stop-Process -Force -ErrorAction SilentlyContinue
        Start-Sleep -Seconds 2
    }
    
    Write-Host "Restarting WSL..." -ForegroundColor Green
    wsl --list --verbose | Select-String "Stopped" | ForEach-Object {
        $distro = $_.Line.Split()[0]
        Write-Host "Starting distribution: $distro" -ForegroundColor Cyan
        wsl -d $distro -e true
    }
    
    Write-Host "WSL restart complete!" -ForegroundColor Green
    Write-Host "To verify, run: wsl --list --verbose" -ForegroundColor Gray
    
  23. Crypto-Spartan commented on Sep 24, 2025

    @Crypto-Spartan

    Ender Bonnet (@enBonnet) can you check your current kernel version from within WSL?

    $ uname -r
    6.6.87.2-microsoft-standard-WSL2
  24. enBonnet commented on Sep 24, 2025

    @enBonnet

    Output-> 6.6.87.2-microsoft-standard-WSL2

    I posted in another thread (#8763 (comment)) after removing docker desktop it when back to work normally after sleep/hibernate.

    Edit: I have put it to sleep a couple of times during the day, and it is still working great.

  25. dodjango commented on Dec 31, 2025

    @dodjango

    Comprehensive Analysis: Sleep/Wake WSL Failure with BSOD During Recovery

    I encountered this issue today (2025-12-31) and performed an in-depth analysis. Adding my findings here as they may help others and provide additional data for Microsoft.

    Summary

    After Windows woke from overnight standby/hibernate:

    1. WSL commands failed with Wsl/Service/E_UNEXPECTED
    2. LxssManager service was stopped, but distribution showed as "Running" (inconsistent state)
    3. Existing shell sessions inside WSL were still functional - proving the VM was alive, only the Windows↔VM communication (vsock) was broken
    4. Manually restarting LxssManager didn't help - services entered "zombie running" state
    5. Attempting Stop-Service vmcompute -Force caused a BSOD (dxgkrnl.sys crash)

    Evidence from Logs

    WSL Journal Errors:

    WSL ERROR: UtilAcceptVsock:271: accept4 failed 110
    WSL ERROR: operator():1240: UtilAcceptVsock() failed for session leader 110
    

    Error 110 = ETIMEDOUT - The vsock connection between Windows and WSL VM timed out.

    Windows Event Log:

    Microsoft-Windows-NDIS:
    "Microsoft Wi-Fi Direct Virtual Adapter #2" - 
    "Fatal error: The miniport has failed a power transition to operational power"
    

    The virtual network adapter (part of Hyper-V/WSL infrastructure) failed during the sleep→wake transition.

    Hyper-V Logs:
    No entries for the incident date - the Hyper-V services were never properly restarted after sleep.

    BSOD Details (when attempting recovery)

    Field Value
    Bug Check SYSTEM_SERVICE_EXCEPTION (0x3b)
    Caused By dxgkrnl.sys (DirectX Graphics Kernel)
    Exception STATUS_ACCESS_VIOLATION

    This links to #8459 - the GPU paravirtualization layer crashes when vmcompute is force-stopped in a corrupt state.

    Full Documentation

    Complete analysis with timeline, system config, and all log excerpts:

    📄 https://gist.github.com/dodjango/545a8322b43697fb81f214fad245a263

    Safe Workaround

    When wsl --shutdown fails and services appear "zombie running":

    • DO NOT use Stop-Service -Force on Hyper-V services
    • DO use Restart-Computer for a clean recovery

    Hope this helps track down the root cause. This bug has been open since 2019 (#4311) and affects many users.

  26. enBonnet commented on Jan 2, 2026

    @enBonnet

    Torsten Mattetat (@dodjango) Can I try to run Restart-Computer after each wake up?

  27. danielniccoli commented on Feb 19, 2026

    @danielniccoli

    Same issue here. vmmemWSL blown up to over 13 GB. Also using Docker.
    WslLogs-2026-02-19_14-09-18.zip

    I'm really confused at this issue. It has over 500 comments, is 3.5 years old and it wasn't even assigned to someone. Why is this ignored?

  28. chemwolf6922 commented on Apr 28, 2026

    @chemwolf6922
    Contributor

    Hi everyone, we introduced a partial fix for this issue in the 2.7.3 pre-release version. Since the issue is hard to reproduce, it would be very helpful if you could try this out and help validate if the issue is resolved. Thanks.
    https://github.com/microsoft/WSL/releases/tag/2.7.3

  29. InfantLab commented on Aug 31, 2026

    @InfantLab

    Also hitting this on Windows 11 Insider Dev — devcontainer/Docker Desktop (WSL2 backend) becomes unusable after the host hibernates: containers report "Up" but docker exec fails at the nsexec/setns layer (failed to open /proc/<pid>/ns/ipc: No such file or directory). Confirmed wsl --shutdown, restarting vmcompute/LxssManager, and removing/recreating the container do not fix it — only a full Windows restart recovers.

    Worth flagging for anyone seeing a sudden uptick: Windows is rolling out a new adaptive hibernate policy (Insider Preview Build 28120.2630, July 2026) that hibernates more readily at lower battery to reduce Modern Standby drain. That means machines that previously stayed in Modern Standby (and survived fine) are now escalating to full Hibernate far more often — so this long-open bug is getting tripped more frequently, not because anything about our setup changed. For anyone doing dev container work on a laptop, this is a genuine showstopper: the workflow depends on WSL2 state surviving sleep, and right now it doesn't.

  30. asiby commented on Sep 24, 2026

    @asiby

    I noticed that the issue doesn't happen when I close all VS Code & terminal windows. The next morning, I can see that services are still running in WSL (e.g. MongoDB, ...).

    Today at EOD, I will close VS Code and keep the terminal up to see what happens.

  31. derekl-beep commented on Nov 4, 2026

    @derekl-beep

    Turning off the hibernation timeout fixes this for me on my Windows PC.

    On battery, Kernel-Power Event 42 showed Hibernate from Sleep - Fixed Timeout every night, followed by a WSL hang. Disabling the on-battery timeout (elevated prompt):

    powercfg /setdcvalueindex SCHEME_CURRENT SUB_SLEEP HIBERNATEIDLE 0
    powercfg /setactive SCHEME_CURRENT
    

    2 nights (update) with no hang and no VS Code Remote-WSL freeze (WSL 2.6.3.0). It still hibernates via Standby Battery Budget Exceeded without issue. Only a few nights, so not a confirmed fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions