WSL: WSL sometimes crashes when computer wakes from sleep

Version

Microsoft Windows [Version 10.0.19044.2364]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.15.79.1-microsoft-standard-WSL2

Distro Version

Arch Linux

Other Software

No response

Repro Steps

  1. Open a terminal to the Linux instance
  2. Close laptop lid to put the computer to sleep
  3. Wait till the next day (or more precisely, as far as I can tell, until the computer has gone from sleep to hibernation)
  4. Start the computer again
  5. Find that the Linux instance has died.

Expected Behavior

I expect the Linux instance to also resume from sleep/hibernation without errors.

Actual Behavior

The Linux shell is unresponsive, and in the Windows Terminal, I see the following message:

[process exited with code 1 (0x00000001)]

I do not think this is a duplicate of #9301, because the Linux instance can easily be started again without rebooting the computer.

I have run the collect-wsl-logs.ps1 script and attached its output files as instructed (WslLogs-2023-01-30_16-39-46.zip), but its console output indicates that it wasn’t entirely successful:

PS C:\Users\[username]> .\collect-wsl-logs.ps1


    Directory: C:\Users\[username]


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----        30/01/2023     16:39                WslLogs-2023-01-30_16-39-46
The operation completed successfully.
The operation completed successfully.
The operation completed successfully.
The operation completed successfully.
Log collection is running. Please reproduce the problem and press any key to save the logs.
Saving logs...

        There are no trace profiles running.

        Error code: 0xc5583000
Logs saved in: C:\Users\[username]\WslLogs-2023-01-30_16-39-46.zip. Please attach that file to the GitHub issue.

The part starting with “Saving logs…” is of course from after the computer has woken again. And I have run that script successfully before, so I guess that the error is related to WSL crashing.

I have also checked Event Viewer and found some log entries there which seem like they could be relevant. In chronological order:

  • When I first put the computer in sleep mode:
    • Info: The driver \Driver\vpcivsp for device ROOT\VPCIVSP\0000 stopped the power transition.
    • Info: The system is entering sleep. Sleep Reason: Button or Lid
  • When it later resumes to switch to hibernation:
    • Info: The driver \Driver\vpcivsp for device ROOT\VPCIVSP\0000 stopped the power transition.
    • Error: The ms-resource:AppName service terminated unexpectedly. It has done this 2 time(s).
    • Info: The system is entering sleep. Sleep Reason: Hibernate from Sleep - Fixed Timeout

The Error message there caught my eye. In Services, I can see that ms-resource:AppName is actually C:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForLinux_1.0.3.0_x64__8wekyb3d8bbwe\wslservice.exe. So I guess this means that the WSL service crashes.

Diagnostic Logs

No response

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 20
  • Comments: 43 (1 by maintainers)

Most upvoted comments

@OneBlue has identified a bug in 2.3.11 and will be releasing a fix shortly.

Having the same Problem with WSL2 and Ubuntu under Win10. After hibernation, the environment bekomes sluggish to the point of a crash with: grafik

I cant even open a terminal and run htop to check whats using all those resources. Only restart of the host helps.

I updated to WSL version 2.3.12.0 last night and I did not get the error this morning. WSL is up and running after my PC woke from sleeping. Thank you to everyone involved!

I have the same issue, and it is NOT related to hibernation, but to sleep mode. Happens consistently after I get out of sleep (sleep duration makes no difference), and I distinctly remember this has started after I “upgraded” haha to WSL2 from the store.

I’m using Windows terminal and VSCode and both apps are affected.

Terminal: [process exited with code 1 (0x00000001)]

I don’t have to stop/start/restart WSL2 at this point. Its enough to open a new Ubuntu window in Terminal and continue working, so its not a workstopper but a major annoyance and time waster. This has been going on and on so many times for weeks now, that I was forced to search for a solution and found this thread.

> wsl -l -v
  NAME      STATE           VERSION
* Ubuntu    Running         2

> uname -r
5.15.90.1-microsoft-standard-WSL2

Ubuntu version: 20.04.5 LTS
WSL version: 1.1.3.0
Kernel version: 5.15.90.1
WSLg version: 1.0.49
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.2604

Sometimes I encounter this problem too.

Error Can’t access to WSL via Terminal after waking up PC from sleep mode. It throws an error like this:

Catastrophic failure
Error code: Wsl/Service/E_UNEXPECTED
Press any key to continue...

[process exited with code 4294967295 (0xffffffff)]
You can now close this terminal with Ctrl+D, or press Enter to restart.

Additional info

$ wsl --version
WSL version: 2.5.7.0
Kernel version: 6.6.87.1-1
WSLg version: 1.0.66
MSRDC version: 1.2.6074
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.26100.4202

Observations

  • Shutdown WSL and restart. It will works again.

Similar things happening here as well.

Steps

  1. Open WSL in Windows Terminal
  2. Create a tmux session in WSL (tmux)
  3. Close the Terminal, put computer to sleep
  4. Wake and open WSL in Terminal
  5. Attach: tmux attach

Expected: tmux session is alive Actual: no tmux sessions exist in WSL, as confirmed with tmux ls

Additional info

WSL version: 2.3.24.0
Kernel version: 5.15.153.1-2
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.22631.4391

Observations

  • Distro was terminated/shutdown?
  • If Windows Terminal window is kept open when sleeping, the tmux session is alive and well. Same goes for other processes as far as I can see (as long as the Terminal window is open).

I distinctly remember this has started after I “upgraded” haha to WSL2 from the store.

Same here. I deleted the app and now WSL seems running OK. The problem was only present on my work laptop where modern standby is enabled.