WSL: Can't run WSL2 and it returns Error code: Wsl/Service/CreateInstance/CreateVm/HCS_E_CONNECTION_TIMEOUT
Windows Version
Microsoft Windows [Version 10.0.22631.4249]
WSL Version
2.2.4.0
Are you using WSL 1 or WSL 2?
- WSL 2
- WSL 1
Kernel Version
5.15.153.1-2
Distro Version
Can’t run any commands within WSL due to connection timeout error. But I have only one distro and it’s ubuntu. I’m pretty sure it’s 20.04 or 22.04 version
Other Software
No response
Repro Steps
I just got some update for Windows 11 and after that my WSL2 stopped working. I turned on Windows features like Hyper-V, Containers and Windows Subsystem for Linux to try to fix that issue, but it didn’t help anyway. Still getting Error code: Wsl/Service/CreateInstance/CreateVm/HCS_E_CONNECTION_TIMEOUT each time
Expected Behavior
I want to be able to run WSL2 without getting timeout error.
Actual Behavior
I run wsl.exe command or run Ubuntu terminal from Windows apps, I’m getting the same result
wsl.exe
The operation timed out because a response was not received from the virtual machine or container.
Error code: Wsl/Service/CreateInstance/CreateVm/HCS_E_CONNECTION_TIMEOUT
Diagnostic Logs
I executed collect-wsl-logs.ps1 script to collect logs. I hope it will be helpful.
WslLogs-2024-09-28_10-18-26.zip
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 4
- Comments: 40 (2 by maintainers)
I found that the main thing I had to do was:
In terms of debugging, use the wsl config (either file or ui), to enable the Debug console (under developer in the UI), which shows the startup messages and failures in it. Although if the filesystem has been corrupted, expect the output to be quite choppy before it dies.
In my case, WSL was starting normally, but it disconnected after some time, while I was working on it. As @dannystaple mentioned, the issue was with the resource saver from docker desktop. Disabling it and restarting the computer did it for me, at least for now. Thank you!
@dannystaple +1 to your fix. The problem was the resource saver in docker desktop.
I did not need to create a new distribution, everything was ok where I left it. But my WSL was apparently working fine from the start, it just lost connection seemingly out of nowhere and wouldn’t recover. It showed a pretty nasty error if I tried booting it back up after I disabled the resource saver from docker (something like “catastrophic error occurred”), so restarting the computer was necessary. That was luckily all that was needed for me.
This was fixed for me by enabling Windows Hypervisor Platform and Windows Machine Platform. It was unchecked after this update was installed. Once I checked it and rebooted I was able to launch my WSL instance.
Go to settings > (search) turn windows feature on / off. Scroll down to "Windows Hypervisor Platform and Windows Machine Platform.
Same here, uninstalling the update KB5043145 fixed the issue for me. See also here.
I’m currently trying to recover my WSL instance after it suddenly stopped working, and it so far seems like the .vhxd has been corrupted on top of it all. Fortunately I have a backup, but this was really not the way I had expected to spend my day off.
I finally found the problem, WSL started, after many attempts to start with diagnostics tools/ Dmesg revealed that the journal was damaged and trying to recover. Almost like this botched update shut down WSL in a forced way. Not cool.
This work ! Thanks
How did you manage to uninstall the KB5043145, I am so frustrated right now.
I already ran some checks for corrupted file but there was none
sfc /scannow
DISM /Online /Cleanup-Image /RestoreHealth
Same issue the WSL2 is broken after some updates, uninstalling the KB5043145 update helps, thanks @pjacekm
I am hiving the same issue, also in my case it started after the latest windows 11 update.