"Docker Desktop Starting..." forever on Windows

Viewed 9297

I have installed Docker Desktop version 4.4.4 and it is not running. It only displays "Docker Desktop Starting ..." but never starts running.

I have tried so many ways but didn't solve:

  1. Allowing the following files in windows firewall C:\program files\docker\docker\resources\vpnkit.exe, C:\program files\docker\docker\com.docker.service C:\program files\docker\docker\resources\com.docker.proxy.exe
  2. Removing 'Docker' and 'Docker Desktop' folders from AppData/Roaming and AppData/Local
  3. Uninstalling and reinstalling Docker with different versions including 4.5.1
4 Answers

I've found out another symptom leading to the solution is also related to WSL.

On one side, Docker service won't start throwing this error:

error during connect: This error may indicate that the docker daemon is not running.: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/version": open //./pipe/docker_engine: The system cannot find the file specified.

And on the other, WSL is unresponsive. Attempting to run a WSL Distro or WSL command directly on CMD, won't return any output at all. It will just hang in there.

So the solution is common to WSL and Docker. I've found in a question regarding the WSL issue, that the LxssManager Windows service is staled (it may show under services.msc as Stopping and all the buttons are greyed out, or I've even seen it Running apparently, but with the Docker and WSL issues above, so something is wrong with it still.)

First, we have to get LxssManager PID in order to kill it. Using an elevated shell, we can get it this way:

sc queryex LxssManager

Having the PID, we can kill the process but beware I wasn't able to kill it using kill or taskkill commands. I was getting the following error:

ERROR: The process with PID XXXXX could not be terminated.
Reason: Access is denied.

To effectively kill the process, do as following:

wmic process where ProcessID=XXXXX delete

Replace XXXXX with PID, of course. Having done so, start the LxssManager service:

net start LxssManager

A word of warning: I've noted in some cases this is not enough for unknown (to me) technical reasons even if LxssManager service is shown as Running. Just repeat the above steps! Sometimes it works doing this once, sometimes doing it twice for some reason.

TL;DR

  1. Kill LxssManager Windows service using wmic+PID.
  2. Start LxssManager service.
  3. Repeat twice or more if issues persist.
  4. Docker and WSL issues are solved.

For me, it was a problem with WSL. When I tried:

wsl --install -d Ubuntu

in a command window, after a few minutes I got error 0x80370114

The fix was to do:

  1. Exploit Protection > System Settings > Control Flow Guard
  2. turn on
  3. restart computer

Then reinstall/restart Docker Desktop, and it works!

Hope this helps someone else

What worked for me was to log in into the Docker (upper right corner), but when I first clicked on login, it said "exec: "rundll32": executable file not found in %PATH%" - I search and found that I need to check environmental variable in PATH that I have "C:\WINDOWS\system32" there - (and in my case I really had it broken somehow - don't know why, but I missed backslash between Windows and system32). So I fixed to correct path, restarted PC. Then I was able to login. And immediately "Docker Desktop Starting..." was gone.

I was facing same code for for Docker version 4.*. For me it was Visual Studio code,

  1. Stopped WSL form Task manager

  2. stopped Docker which was showing "Docker desktop is starting" form Task manage

  3. stopped Visual Studio code form Task manager

  4. Started Docker again

These steps placed my Docker in Running state in 30 seconds

Hope this helps someone!

Related