sanketh s
sanketh s

Reputation: 377

System.InvalidOperationException: Failed to deploy distro docker-desktop to <localpath>: exit code: -1

I am trying to run docker Desktop in my windows 10 Local. have installed it successfully but while running it I am getting the below error.

System.InvalidOperationException:
Failed to deploy distro docker-desktop to <localpath>: exit code: -1
 stdout: The service cannot be started, either because it is disabled or because it has no enabled devices associated with it.

I think it is saying some windows services need to be enabled, but I don't know which service has to be enabled could someone please help me with this concern?

docker version 
C:\Users\lenova>docker --version
Docker version 20.10.2, build 2291f61

Screenshot

Upvotes: 11

Views: 63911

Answers (19)

If you couldn't run docker desktop with WSL even after trying all the above steps, then you can simply do that with the help of choosing Hyper-V instead of WSL. You can choose that from the popup that you get while installing docker desktop. docker-installation step

Uncheck the "Use WSL 2 instead of Hyper-V" option.

Upvotes: 0

Joosep Parts
Joosep Parts

Reputation: 6235

I did have issues with wsl not responding in Windows 10.

  1. Kill docker-desktop processes.
  2. Run powershell as administrator to restart wsl service.

Get-Service LxssManager | Restart-Service

PS C:\Windows\system32> Get-Service LxssManager | Restart-Service
WARNING: Waiting for service 'LxssManager (LxssManager)' to stop...
WARNING: Waiting for service 'LxssManager (LxssManager)' to stop...
WARNING: Waiting for service 'LxssManager (LxssManager)' to stop...
PS C:\Windows\system32>
  1. Restart docker desktop.

Upvotes: 0

Nazarii Boichyshyn
Nazarii Boichyshyn

Reputation: 131

  1. Go to C:\Users%Your_USER-NAME%\AppData\Roaming\Docker
  2. Delete settings.json
  3. Start the docker

This helped me with a lot of other docker errors after update of windows/changes in windows etc...

Upvotes: 1

Abd Abughazaleh
Abd Abughazaleh

Reputation: 5545

The problem is in WSL as it becomes unresponsive and returns a service error if you try the following command in PowerShell:

wsl -l -v

I believe the process can be simplified a bit more with:

  • Uncheck Windows Subsystem for Linux in Windows Features
  • Reboot
  • Turn the feature back on
  • Re-apply the WSL2 update
  • Reboot
  • No need to uninstall/reinstall Docker Desktop.

This got me back up and running with Windows 10 Home (which requires WSL2) and Docker Desktop 2.4.0

Upvotes: 1

Abd Abughazaleh
Abd Abughazaleh

Reputation: 5545

I solved by the following steps:

  • Uninstall Docker and WSL 2 kernel.
  • Uncheck Containers, Hyper-V, Windows Subsystem for Linux in Windows features
  • Restart the system
  • Install Docker Desktop
  • Restart System
  • Start Docker Desktop

Upvotes: 0

Vy Do
Vy Do

Reputation: 52646

The quality of Docker for Windows is very bad. I catch these dangerous very often.

enter image description here

Check list:

(1) Use this tool https://www.nirsoft.net/utils/regscanner.html . Search docker, delete all. enter image description here

(2) Remove WSL sub system, Hyper-V, then restart

enter image description here

(3). Create file foo.reg has content

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinSock2\Parameters\AppId_Catalog\0408F7A3]
"AppFullPath"="C:\\Windows\\System32\\wsl.exe"
"PermittedLspCategories"=dword:80000000

run.

(4) Uninstall Docker

(5) Run cmd type ... . Delete folder .docker

enter image description here

enter image description here Delete Docker folder in Program Files

enter image description here

(6) delete

enter image description here

(7) Install latest version of Docker.

(8) Re-install feature WSL for Windows.

enter image description here

Install Ubuntu from Windows store

enter image description here

(9) Re-install Docker (as Administrator)

(10) Run Docker as Administrator .

Upvotes: 1

Jacob
Jacob

Reputation: 475

On Windows 10:

  1. Open Services

enter image description here

  1. Right click on LXSSMANAGER -> Restart

enter image description here

  1. Close wsl using cmd with following command:

     wsl --shutdown
    
  2. Execute following start wsl again:

     wsl
    

Upvotes: 0

Tharun K
Tharun K

Reputation: 1180

Restarting wsl worked for me.

Run the following

  • wsl --shutdown, wait for it to shutdown
  • wsl, wait for it to start

Start Docker Desktop after this.

Upvotes: 1

volvpavl
volvpavl

Reputation: 644

In my case, the issue was caused by Acrylic DNS server. Anything that holds port 53, would be a problem.

Interesting that it all worked fine for a few days after installation, maybe because I did not reboot the laptop all that time, only used the deep hibernation. So it was hard to guess what could break the docker setup, I was sure that it was because of the recently installed windows or docker updates.

Upvotes: 0

Qiansen Zhou
Qiansen Zhou

Reputation: 41

This worked for me: https://github.com/MicrosoftDocs/WSL/issues/547#issuecomment-873540236

  • Copy below snippet:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinSock2\Parameters\AppId_Catalog\0408F7A3]
"AppFullPath"="C:\\Windows\\System32\\wsl.exe"
"PermittedLspCategories"=dword:80000000
  • Save it as a file wsl.reg
  • Execute the file to update the registry
  • Launch Ubuntu again
  • Issue resolved

Upvotes: 1

adm4
adm4

Reputation: 65

I had the PgAdmin 4 app running, and when I closed it and tried starting Docker Desktop again it booted normally.

Not sure if there is a link, but an easy solution to try.

Upvotes: 1

dvasdekis
dvasdekis

Reputation: 167

I had to exit Private Internet Access (PIA) VPN to get docker to work on my system. Not sure why.

Upvotes: 1

Ramin Toussi
Ramin Toussi

Reputation: 132

If you don't need to run Linux and Windows containers side-by-side, an option is to turn off the WSL and use Hyper-v instead. This should work fine.

Upvotes: 0

newcomers
newcomers

Reputation: 189

run as administrator , and you switch the container to windows by clicking the icon bar in the right corner taskbar and choose switch to windows container

https://learn.microsoft.com/en-us/virtualization/windowscontainers/quick-start/quick-start-windows-10-linux

Upvotes: 1

Adithya Upadhya
Adithya Upadhya

Reputation: 2385

In my case, I was getting a similar error. This was happening because Docker desktop didn't have permissions to access the path C:\Users\Adithya\AppData\Local\Docker\wsl\distro. This started happening after I switched to WSL2 backend.

The solution was to kill all docker process. Next, Run Docker Desktop as Administrator.

System.InvalidOperationException:
Failed to deploy distro docker-desktop to C:\Users\Adithya\AppData\Local\Docker\wsl\distro: 
exit code: -1 stdout: The operation timed out because a response was not received from the virtual machine or container.

enter image description here

Upvotes: 0

Greenfly77
Greenfly77

Reputation: 195

Almost sure, that the accepted answer will work. However, it won't be an option, if you utilize WSL for other purposes as well. In that case, you may have several configurations/apps in WSL and just reinstalling or deleting your configuration will probably be a bad solution.

Furthermore: WSL is not the issue for this error! It is created by Docker engine configuration which will kill the WSL service (LxxsManager). This may happen because of

  • changed configuration (by you) or
  • because of a Docker update, maybe also
  • because of Windows updates

You can find a detailed discussion about this issue on Docker's GitHub Issues.

I personally experienced this problem after installing updates on Windows while running Docker v3.5.2. And again, reinstalling/killing WSL is not an option for me! So I tried to kill all services (Docker and WSL) and update Docker. Unfortunately that did not work in first place, since LxxsManager was in some weird state and I could not even kill it any more (even a kill command as admin with force switch did not do it's job!)... So here is my solution to fix that problem:

  1. Remove Docker from autostart
  2. Restart Windows (Yippiee: WSL works again! 🥰)
  3. Install a new version of Docker (in my case v.4.2.0)
  4. Restart Windows again (probably not necessary, but for me it was because Docker engine did not start before a Windows restart)
  5. Start Docker (Yippiee: Docker works again! ☺️)

Note: Since I did not change Docker configuration, I installed an update. If you changed configuration options resulting in that crash, your solution may be different. Literally, instead of updating Docker (step 3) you would probably roll back your Docker configuration changes instead.

Upvotes: 6

Potato
Potato

Reputation: 485

Try delete %USERPROFILE%/.wslconfig. If it helps then you can try to modify it so that it work. As for me I deleted the file, because on my workstation docker didn't want to work with it

Upvotes: 9

Monsterf_Fm
Monsterf_Fm

Reputation: 141

Right click on docker icon, run as administrator (if you have administrator rights on your computer). It solved the problem for me.

Upvotes: 14

user2899477
user2899477

Reputation: 304

  • Uninstall Docker.
  • Uncheck Containers, Hyper-V, Windows Subsystem for Linux in Windows features
  • Restart the system
  • Install Docker Desktop
  • Restart System
  • Start Docker Desktop

Upvotes: 16

Related Questions