An unexpected error was encountered while executing a WSL command


Common causes include access rights issues, which occur after waking the computer or not being connected to your domain/active directory.
Please try shutting WSL down (wsl --shutdown) and/or rebooting your computer. If not sufficient, WSL may need to be reinstalled fully. As a last resort, try to uninstall/reinstall Docker Desktop. If the issue persists please collect diagnostics and submit an issue (Troubleshoot Docker Desktop | Docker Docs).

why when I install docker on windows 11 it keeps getting an error like this, what to do?

3 Likes

I also need solution to this problem. Kindly help.

1 Like

I am also having same problem in my windows 11. Kindly Help. Thanks

Same issue here, can some one give us a hint please ?

I’ve followed everything that is indicated on how to fix Unexpected WSL error based on the prompt still getting error.

I’ve found the solution

I’ve got stuck in that problem. How can you solve it?

help us pls, i’ve been stucking in this error for 3weeks

ban tim duoc gai phap chua ?

I solved this by enableing BIOS SVM mode

1 Like

I got the same problem while try to install docker desktop.
So in my case, I install docker and login while WSL is out of date then I follow the above comment

  1. enableing BIOS SVM mode ( gg your self :)) )
  2. restart and open docker, if it got that error “starting wsl engine 2 errors occurred . . .”
  3. open cmd admin and check wsl status:
    wsl --status
    you will see:
    Default Distribution: docker-desktop (in my case this is :docker-desktop-data)
    Default Version: 2
wsl --unregister docker-desktop 
  1. open docker again.

hope that help .

2 Likes

solved this by enableing BIOS SVM mode

you guys solutions are so bad that I find a solution from chinese platform

1 Like

i already enable svm mode, but still got the problem. My virtual machine platform is unable to turn on.

Hi, I am getting this issue today. Not finding any concrete solution for the same.
Any help on the same would be highly appreciated.

image

if you are first time using docker in your machine, check your cpu vitual enviornment in your bios, you need to enable it

I’m solved with this :

I found the solution on a Chinese developer platform and it solved my problem:

  1. open CMD with “run as administrator”
  2. run the command netsh winsock reset
  3. restart the computer
3 Likes

Make sure that the hypervisor launch is enabled in your boot configuration. You can validate this by running (elevated powershell):
bcdedit /enum | findstr -i hypervisorlaunchtype+

If you see hypervisorlaunchtype Off , then the hypervisor is disabled. To enable it run in an elevated powershell:
bcdedit /set hypervisorlaunchtype Auto

Then restart the machine

I just did the wsl --unregister docker-desktop and this seems to solve the issue (at least at my end) , thx for this !

1 Like

This worked for me. thumbs up