11

enter image description here

I'm getting the below error after installing a new version of Docker Desktop.

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 (https://docs.docker.com/desktop/troubleshoot/overview/#diagnose-from-the-terminal).

I am installing Docker Desktop in Azure Virtual Machine.

Any lead would be helpful. Thanks in advance.

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Ronak Dumaniya
  • 835
  • 6
  • 13
  • 20

6 Answers6

7

I got the same error and solved it by installing a Ubuntu Distribution. You need to install Ubuntu Distribution and set it as default Distribution of Windows Subsystem.

ScreenShot of how it looks after Ubuntu Distribution installed

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Jose Neto
  • 97
  • 1
  • 5
1

I got the same error installing this on a VMware VM guest. What I needed to do to make it work is activate the option 'Enable hardware assisted virtualization to the guest OS'. This makes sense since Docker is running a nested VM for the container engine. I'm not sure if a similar option is available in Azure, but that is where you'll want to look.

arkismist
  • 11
  • 1
0

Here are some steps that worked for me.(Execute commands on Powershell)

I don't know if following steps solve your problem but at least it would give insight to you about problem.

Check installed distros and try to install it again.

wsl --status 

wsl -l #list wsl 

wsl –install or wsl.exe --install -d ubuntu

If you encounter with error when you are installing

Downgrade wsl version to 1 install distro and then upgrade to version 2.

wsl --set-default-version 1
wsl –install or wsl.exe --install -d ubuntu
wsl --set-default-version 2
wsl.exe --set-version ubuntu 2

Make sure that hypervisorlaunchtype auto by launching following command.

bcdedit /set hypervisorlaunchtype auto

Also make sure that all necessary(I know hyper v is not must for wsl2,nevertheless I enabled it.)

dism.exe /online /enable-feature /featurename:Microsoft-Hyper-V-All /featurename:VirtualMachinePlatform /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
erhan355
  • 806
  • 11
  • 23
0

take vm off and then enable nested vitualization and then it worked for me. https://learn.microsoft.com/en-us/virtualization/hyper-v-on-windows/user-guide/nested-virtualization

0

things that work for me. Also solving my docker desktop issue related with WSL at the same time. Seems that current WSL from window store having issue with distribution.

  1. in Add or remove programs: uninstall first "Windows Subsystem for Linux Update" and then "Windows Subsystem for Linux"
  2. try to start your distribution again and it will point you to: https://aka.ms/wsl2kernel
  3. from there download the wsl_update_x64.msi file and run it, install the WSL kernel
  4. start your distribution again

https://github.com/microsoft/WSL/issues/9331#issuecomment-1665325130

0

Facing the same issue, I managed to resolved it by doing a netsh winsock reset

Follow the steps outlined here, which consist in running command prompt/powershell with admin permissions and typing netsh winsock reset

KingOtto
  • 840
  • 5
  • 18