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

Viewed 40650

i am trying to run docker Desktop in my windows 10 Local. have installed it sucessfully 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 service need to be enabled, but i dont 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

enter image description here

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

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

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

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.

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

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.

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

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.

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

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.

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.

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
    

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 .

Related