8

Docker Desktop - Windows 11 - Unexpected WSL error An unexpected error occurred while executing a WSL command.

I'm having trouble with Docker Desktop on my Windows 11 system. I get an Unexpected WSL error when I try to run Docker.

I have attached a screenshot showing the error message after launching the Docker application for more context.

enter image description here

Also, the error message is as follows:

deploying WSL2 distributions
ensuring main distro is deployed: deploying "docker-desktop": importing WSL distro "WSL2 is not supported with your current machine configuration.\r\nPlease enable the \"Virtual Machine Platform\" optional component and ensure virtualization is enabled in the BIOS.
Enable "Virtual Machine Platform" by running: wsl.exe --install --no-distribution
For information please visit https://aka.ms/enablevirtualization
Error code: Wsl/Service/RegisterDistro/CreateVm/HCS/HCS_E_HYPERV_NOT_INSTALLED
: exit status 0xffffffff
checking if isocache exists: CreateFile \\wsl$\docker-desktop-data\isocache\: The network name cannot be found.
4
  • 1
    Did you follow the instructions in the error? WSL2 (unlike WSL1) runs in a virtual machine, and as such you have to have installed the Windows Virtual Machine support. Commented Jun 14, 2024 at 5:16
  • Did it use to work before? Commented Sep 16, 2024 at 19:50
  • I blogged about how I got Docker to run here, do ensure that Virtualization is enabled in the BIOS nestenius.se/2024/09/24/… Commented Sep 26, 2024 at 8:15
  • Note: if you're trying to run Docker inside virtual machine, you need to enable nested virtualization. Commented Nov 28, 2024 at 11:50

4 Answers 4

10

I had same problem on Windows 10 even using latest versions Win10, WSL 2 and Docker Desktop with instruction

I found solution here. This worked for me:

  1. Validate this by running (elevated powershell): bcdedit /enum | findstr -i hypervisorlaunchtype

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

  3. Reboot

Sign up to request clarification or add additional context in comments.

1 Comment

Same problem, but this didn't help me. This parameter was already set as Auto for me.
6

In my case running the command on windows 11:

wsl --update

helped

1 Comment

I have the same trouble, i have run wsl --update many time but i did not solve my problem, I Think the problem is caused by hypervisorlaunchtype Off. So, beside run wsl --update you need to run many other command to make hypervisorlaunchtype On
2

pretty sure , it has to do with the windows feature virtual machine platform how to enable virtualisation

which also requires VT extension to be enabled. you can check it out

Error code: Wsl/Service/RegisterDistro/CreateVm/HCS/HCS_E_HYPERV_NOT_INSTALLED

this is what might be hinting at the same thing

and windows WSL FAQ's talk about it too

Yes. WSL 2 is available on all Desktop SKUs where WSL is available, including Windows 10 Home and Windows 11 Home. Specifically, WSL2 requires two features to be enabled: "Virtual Machine Platform" (a subset of Hyper-V)

Comments

0
wsl --set-default-version 2

this worked for me

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.