Skip to content

WSL2 enters unrecoverable zombie state after sleep/wake - vsock communication failure #14005

Open

Description

Windows Version

Microsoft Windows [Version 10.0.26100.2605]

WSL Version

WSL-Version: 2.3.26.0
Kernelversion: 5.15.167.4-1
WSLg-Version: 1.0.65
MSRDC-Version: 1.2.5620
Direct3D-Version: 1.611.1-81528511
DXCore-Version: 10.0.26100.1-240331-1435.ge-release
Windows-Version: 10.0.26100.2605

Kernel Version

5.15.167.4-1

Distro Version

Ubuntu 24.04

WSL 1 or WSL 2?

  • WSL 2

Repro Steps

  1. Start WSL2 normally (working state, shell sessions open)
  2. Put Windows into standby/sleep overnight
  3. Resume Windows from standby
  4. Existing WSL2 shell sessions still work (inside the VM)
  5. Attempt to open new WSL session via wsl command → hangs indefinitely
  6. Get-Service LxssManager shows "Running"
  7. Start-Service LxssManager fails with Wsl/Service/E_UNEXPECTED

Expected Behavior

WSL2 should recover gracefully after Windows resumes from sleep/standby, or at minimum provide a way to restart the services without requiring a full system reboot.

Actual Behavior

After sleep/wake, WSL2 enters a "zombie running" state:

  • All services (LxssManager, vmcompute, vmms) appear "Running" in Get-Service
  • But vsock communication between Windows and the WSL2 VM is broken
  • The VM itself is still running (existing shell sessions inside WSL work!)
  • New connections from Windows side fail with Error 110 (ETIMEDOUT)

Event Log evidence:

  • NDIS virtual network adapter fails to restore after standby
  • Hyper-V vmms logs show no errors (services think they're healthy)

Recovery attempts that fail:

  • Restart-Service LxssManager → hangs
  • Stop-Service vmcompute -Force → causes system instability (details sent to [email protected])

Only working recovery: Full system reboot via Restart-Computer

Detailed Analysis

I have documented the complete incident with Event Log analysis, diagnostic steps, and system configuration in this gist:

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

Related Issues

Other Software

  • GPU: NVIDIA with WSLg enabled
  • Hyper-V features enabled
  • Docker Desktop installed (not running during incident)

Request

  1. Could the WSL team investigate why vsock communication breaks during sleep/wake while the VM stays alive?
  2. Is there a safe way to restart WSL services without a full reboot when this state occurs?

Note: Additional diagnostic data (minidump) has been submitted separately to [email protected] per contribution guidelines.

Activity

  1. github-actions commented on Dec 31, 2025

    @github-actions
    Contributor

    Logs are required for review from WSL team

    If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'.
    Otherwise, please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

    How 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 script will output the path of the log file once done.

    If this is a networking issue, please use collect-networking-logs.ps1, following the instructions in Collect WSL logs for networking issues

    Once completed please upload the output files to this GitHub issue.

    See Collect WSL logs (recommended method).

    If you choose to email these logs instead of attaching them to the bug, please send them to [email protected] with the GitHub issue number in the subject, and include a link to your GitHub issue comment in the message body, and reply with '/emailed-logs'.

  2. dodjango commented on Dec 31, 2025

    @dodjango
    Author

    Log Collection Note

    The incident described in this issue has been resolved via system reboot (the only working recovery method). Therefore, current logs would not show the failure state.

    However, I have documented extensive diagnostics from the incident:

    Evidence in the Gist

    The detailed analysis gist contains:

    • Event Log entries from the exact time of failure:
      • NDIS virtual adapter power transition failure
      • Hyper-V Compute logs showing service state
      • Kernel-Power events around sleep/wake
    • Service states captured during the zombie state
    • Error messages from LxssManager recovery attempts
    • System configuration (.wslconfig, WSL version, Windows build)

    Key Diagnostic Finding

    The critical observation: existing WSL2 shell sessions continued to work inside the VM during the failure. This proves:

    1. The WSL2 VM was still running
    2. Only the vsock communication (Windows ↔ VM) was broken
    3. Services appeared "Running" but could not establish new connections

    Additional Data

    A minidump from the subsequent system crash (when attempting Stop-Service vmcompute -Force) has been submitted to [email protected] per contribution guidelines.

    If current-state logs would still be helpful for baseline comparison, I'm happy to run collect-wsl-logs.ps1 and attach them.

  3. dodjango commented on Dec 31, 2025

    @dodjango
    Author

    /emailed-logs

  4. github-actions commented on Dec 31, 2025

    @github-actions
    Contributor
    Diagnostic information
    Found '/emailed-logs', adding tag 'emailed-logs'
    
  5. added
    emailed-logs
    on Dec 31, 2025
  6. nschoonm commented on Feb 17, 2026

    @nschoonm

    +1

  7. developer992 commented on May 20, 2026

    @developer992

    Any update on this? This is a big problem.

  8. gtower86 commented on May 28, 2026

    @gtower86

    Same failure mode here, with wire-level evidence that I believe confirms the OP's vsock hypothesis as the actual mechanism - and pins the failure instant to Modern Standby entry, not wake.

    TL;DR

    • The vsock/AF_HYPERV socket plane between host and WSL2 guest is ungracefully torn down at MS-entry with WSAENOTCONN
    • It is never restored at wake; subsequent host attempts return WSAETIMEDOUT (0x8007274c)
    • The guest VM itself stays alive in a paused state (matches OP's observation that existing in-VM shells continued working)
    • Reproduces on different hardware than the OP (AMD Ryzen, not Intel/NVIDIA), so this is not a single-vendor issue

    Repro environment

    • Lenovo Legion 5 15AHP10, AMD Ryzen 7 260 + Radeon 780M (note: AMD-based Hyper-V host, different vendor from OP)
    • Windows 11 Pro 10.0.26200.8457, WSL 2.6.3.0, kernel 6.6.87.2-1, Ubuntu-24.04
    • Modern Standby ONLY (S1/S2/S3 firmware-disabled per powercfg /a); no S3 fallback available
    • DisplayLink USB-C dock active across sleep
    • Bug present since clean Windows install on this hardware (Feb 2026)

    After 3+ hours in Modern Standby, wsl returns Wsl/Service/0x8007274c ("A connection attempt failed because the connected party did not properly respond after a period of time..."). hcsdiag list reports the VM as Running. wsl --shutdown does not recover. Only Restart-Computer works (and must be Restart, not Shut Down - fast startup preserves the broken state).

    Wire-level: the disconnect happens AT MS-entry

    I run an autonomous diagnostic harness that snapshots ETW + procdumps when the wedge forms. An autonomous capture on 2026-05-27 21:35:46 caught the failure 13 seconds post-formation. The ETL covers the full sleep cycle. PerfView decodes the Microsoft.Windows.Subsystem.Lxss TraceLogging provider cleanly.

    At the exact instant of MS-entry (Kernel-Power Event 506), wslrelay.exe fires 9 simultaneous events from 9 different threads:

    Microsoft.Windows.Subsystem.Lxss/LxssVerboseLog
    File:    C:\__w\1\s\src\windows\common\relay.cpp
    Line:    328
    HRESULT: 0x80072749 (WSAENOTCONN -- "Socket is not connected")
    ThreadIDs: 31928, 31892, 31908, 12868, 24084, 24060, 31940, 23636, 31104
    Window:  1.3 seconds
    

    Nine live host↔guest hvsocket connections, ungracefully disconnected within 1.3 seconds. Not closed, not aborted, not retried - the canonical "socket plane was yanked" error.

    Then 3.5 hours of deep MS with zero Lxss provider activity.

    At wake, the same wslrelay.exe retries and gets:

    Microsoft.Windows.Subsystem.Lxss/LxssException
    File:    C:\__w\1\s\src\windows\common\socket.cpp
    Line:    80
    HRESULT: 0x8007274c (WSAETIMEDOUT)
    3× events from 3 threads
    

    The shift from WSAENOTCONN at disconnect → WSAETIMEDOUT on reuse is the textbook signature of "socket plane gone, retries time out because there's no listener."

    Host-side thread state (procdump of wslservice, 13s post-formation)

    Matches OP's observation that services appear "Running" but can't talk to the VM:

    • 7 named threads (Dmesg, GuestTelemetryLogger, CrashDumpCollection, Telemetry, DistroExitCallback, +2 unnamed) blocked indefinitely in KERNELBASE!WaitForMultipleObjects at wslservice+0x1af9b4 / +0x1b2bcd - host-side waiters for guest events that will never come
    • vmcompute (PID 5492) has 2 worker threads spawned at the exact MS-entry second, both stuck in EventPairLow COM-RPC waits - still blocked 12+ hours later
    • 3 threads in a transient SRW lock pile-up at wslservice+0x20b8f8 (internal heartbeat/refresh operation also blocked on the dead channel; times out and clears within hours)

    The named threads stay blocked across the entire sleep cycle and through any number of subsequent MS cycles. Each subsequent MS-exit adds another waiter to the cohort (confirmed by comparing two captures 11h apart - same TIDs persist, plus one new TID created at the exact second of the morning's MS-exit).

    Hyper-V network correlate

    In the same ETL, Microsoft-Windows-Hyper-V-VfpExt (Virtual Filtering Platform) fires 1081 events in a 20-second window at MS-entry, primarily EventID(965) (865 events). Consistent with the virtual NIC's packet processing pipeline being purged at the same instant the AF_HYPERV sockets disconnect.

    Hypothesis

    AF_HYPERV/hvsocket lifetime is not preserved across Modern Standby entry on this hardware class. The disconnect is initiated by the Hyper-V/vmbus layer (not by wslservice or wslrelay) - no host-side state machine activity precedes the WSAENOTCONN burst. Worth checking whether the MS-entry coordination between vmcompute / Hyper-V Virtual Filtering Platform / hvsocket has a race against deeper DRIPS power states.

    Note: the default wsl.wprp profile does NOT subscribe to Microsoft.Windows.HyperV.Socket (the hvsocket TraceLogging provider) - that's only in the WSL-HvSocket named profile. Anyone trying to debug this should switch to that profile (or to WSL-Networking) - the default profile collects the symptoms but not the causing transition.

    Available evidence

    Happy to share via OneDrive or [email protected]:

    • Full wslservice procdump (~110 MB, 22 threads at +13s post-formation)
    • WPR ETL covering the full pre-failure → MS-entry → deep MS → wake sequence (~1.5 GB, decodes cleanly in PerfView v3.2.3)
    • Second dump + ETL from the same wedge 11 hours later, showing the persistent thread state
    • Counter time-series CSV (5-min cadence over weeks of similar wedges)
    • Power-timeline (Kernel-Power 506/507 events with reasons) correlated to wedge formations

    See also

  9. 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.

  10. luxferre commented on Sep 9, 2026

    @luxferre

    Independent reproduction on 2026-09-01, after upgrading to WSL 2.9.9 on 2026-08-26.

    Environment:

    • GIGABYTE AERO 16 OLED BSF
    • Windows 11 Pro 10.0.26200.9278; Modern Standby (S0 Low Power Idle) and hibernate available
    • WSL 2.9.9.0, kernel 6.18.40.1-1; Ubuntu on WSL 2
    • Docker Desktop 4.89.0 during the incident
    • .wslconfig: mirrored networking, memory=48GB, swap=0, autoMemoryReclaim=gradual

    The incident followed resume from Windows hibernate after a Docker-heavy workload. Existing Ubuntu/Codex processes remained alive, although keyboard input in established sessions lagged. A new Windows Terminal Ubuntu tab never reached a prompt.

    Host-side observations:

    • wsl --list --verbose still completed and reported both Ubuntu and docker-desktop as Running.
    • WslService, vmcompute, and HNS were Running.
    • wsl -d Ubuntu --exec /bin/true did not start and remained hung for more than 30 seconds.
    • The Docker engine inside docker-desktop became ready and its internal API could query containers, but user-distro integration stalled after start wsl integration for distro Ubuntu. Its wsl.exe -d Ubuntu ... probes failed with context canceled, while Docker Desktop remained at Applying settings.

    Disabling Ubuntu integration and restarting Docker Desktop did not help. I then fully stopped Docker Desktop and successfully terminated only the docker-desktop distro. After waiting 30 seconds, new Ubuntu session creation was still hung. Finally, wsl --shutdown itself remained hung for more than one minute. A full Windows Restart recovered both WSL session creation and Docker.

    This matches the user-visible failure in this issue and the new-session-only signature documented in #41286. I did not capture guest-kernel or hvsocket ETW evidence before reboot, so this is symptom-level evidence only.

  11. developer992 commented on Sep 14, 2026

    @developer992

    They will never fix this because a) they don't know how ( unlikely, they have 200.000 engineers ) or don't care because they'd rather you we use powershell than WSL. Microsoft has and will always despise linux and do everything they can do make your life harder not easier.

  12. derekl-beep commented on Nov 4, 2026

    @derekl-beep

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

    Same failure mode (new wsl sessions hang, existing ones fine, only Restart-Computer recovers). WSL 2.6.3.0, Windows 11, laptop on battery overnight, Modern Standby. Before this, WSL hung almost every night for about a week, and VS Code Remote-WSL froze most nights for months.

    Kernel-Power Event 42 showed Modern Standby from around midnight, then Hibernate from Sleep - Fixed Timeout ~5 hours later, matching my DC hibernate timeout (18000 s).

    Workaround (elevated prompt):

    powercfg /setdcvalueindex SCHEME_CURRENT SUB_SLEEP HIBERNATEIDLE 0
    powercfg /setactive SCHEME_CURRENT
    

    Result: 2 nights (update before posting) with no WSL hang and no VS Code freeze. The machine still hibernates nightly via Standby Battery Budget Exceeded, and WSL survives that.

    Caveats: only a couple of nights, so not a confirmed fix, and I can't explain why it helps, since another comment here traces the vsock teardown to Modern Standby entry. I have no logs from a failing night.

    If you see Fixed Timeout in Event 42, it may be worth trying.

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

    emailed-logs

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions