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
- Open a terminal to the Linux instance
- Close laptop lid to put the computer to sleep
- Wait till the next day (or more precisely, as far as I can tell, until the computer has gone from sleep to hibernation)
- Start the computer again
- 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
- Info:
- 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
- Info:
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)
@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:
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.
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:
Additional info
Observations
Similar things happening here as well.
Steps
tmux)tmux attachExpected: tmux session is alive Actual: no tmux sessions exist in WSL, as confirmed with
tmux lsAdditional info
Observations
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.