18

I am not able to start the Docker container in Microsoft Windows 10 profession. As I found the cause of this error is due to the docker engine is failing to start.

After installing docker I am able to run only the docker version command.

-> docker --version

As I found the error which is showing docker daemon is not running in windows while running any other docker commands on CMD.

I also enabled (checked) the Hyper-V option in "Turn Windows features on or off" in the Control panel -> Programs -> Turn Windows features on or off.

enter image description here

user3552342
  • 657
  • 1
  • 5
  • 14

11 Answers11

39

The error is related to the daemon part:

In the default daemon configuration on Windows, the docker client must be run elevated to connect.

We can switch the Docker daemon as an elevated user in order to run the docker daemon in the Windows professional:

Run below command with Windows Powershell as administrator:

Run the PowerShell command: -

& 'C:\Program Files\Docker\Docker\DockerCli.exe' -SwitchDaemon

OR

You can run the below command on CMD as administrator:

Run the CMD command: -

"C:\Program Files\Docker\Docker\DockerCli.exe" -SwitchDaemon

SkyWalker
  • 28,384
  • 14
  • 74
  • 132
user3552342
  • 657
  • 1
  • 5
  • 14
13

My Docker Desktop failed to start after I forced it to exit while updating (it stuck during the update that's why I had to do it). No solution on the Internet helped me until I ran into this Powershell command:

wsl -l -v

It listed the following:

* Ubuntu-18.04           Stopped         2
  docker-desktop         Uninstalling    2
  docker-desktop-data    Stopped         2

It kept saying "Uninstalling" even after rebooting the whole system.

What I did was:

wsl -t docker-desktop

It terminated docker-desktop and made the problem gone.

vladik
  • 131
  • 1
  • 2
  • 10
    if it says "Error code: Wsl/Service/WSL_E_DISTRO_NOT_FOUND" Try `wsl --unregister docker-desktop` – SimBioT Dec 07 '22 at 13:17
7

delete %appdata%\Docker\settings.json and let Docker to create a new one

Ankit Kumar
  • 333
  • 5
  • 10
  • This worked for me in 2023, my docker was stuck trying to start the engine. Killing the process and deleting the setting file made docker able to run an update and it is now working, thanks. – mDeram Aug 24 '23 at 15:46
2

You should check WSL:

Execute "wsl -l -v" at the command prompt.

If the result is like this:

wsl -l -v

Then execute "wsl --shutdown" on the command line.

Then execute "wsl -l -v", you will see:

wsl -l -v

Then start Docker Desktop.

This solved my problem.

tripleee
  • 175,061
  • 34
  • 275
  • 318
Igor V
  • 37
  • 2
  • 1
    Please [don’t post images of code, error messages, or other textual data.](https://meta.stackoverflow.com/questions/285551/why-not-upload-images-of-code-on-so-when-asking-a-question/285557#285557) – tripleee Sep 22 '22 at 07:07
  • it doesnt do what you assume it does – showtime Oct 11 '22 at 11:40
  • Hi, even after executing ```wsl --shutdown``` wsl continues to run, and i'm also getting the same error of unable to start docker – Makarand Nov 22 '22 at 11:40
1

Make sure to download the Linux Kernel Update Package and then try restarting Docker Desktop.

Download from here

1

Just share my experience how I solved the problem with "docker failed to start" or similar problem. I found some mess with my Win10 Home edition, despite the fact that all checkes regarding Hyper-v, wsl and others passed I got failed to start docker engine. So, I tried to install one of the old version (4.4.4), not the newest one. An voila it installed wsl2 and started without any problems! Hope this could help someone who's tried all solutions (for example, deletion of the %appdata%\docker folders) :)

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Oct 21 '22 at 04:51
0

I was getting the same exact issue and a solution was provided from thread The attempted operation is not supported for the type of object referenced." error after Windows Update fixed my problem. I had tried everything before this solution. To keep it simple just follow the below steps -

  1. Copy below snippet

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

  1. Save it as a file wsl.reg
  2. Execute the file to update the wsl registry
  3. restart docker desktop

these steps are basically done to do some changes in the registry of wsl distribution that is installed standalone or by docker.

Rajan Chauhan
  • 461
  • 2
  • 7
  • 18
0

Using PowerShell gave me a right direction. All restarts and re-install with deletion didn't work.

wsl -l -v showed list of three processes but wsl -t docker-desktop responded with "There is no distribution with the supplied name." only. wsl --shutdown either didn't work. Solution is next door wsl --unregister docker-desktop . After this all went fine.

Mike Menko
  • 819
  • 8
  • 9
0

I ran the following command which resolved the issue for me.

wsl --unregister docker-desktop
Amuk Saxena
  • 1,521
  • 4
  • 18
  • 44
0

Please make sure your OS type requires WSL or Hyper-V to run docker as per this official link https://docs.docker.com/desktop/install/windows-install/

For my case, I am using Windows 11 Home OS, and it requires WSL (Windows Subsystem for Linux) to run docker. So that I installed WSL on my system.

  1. Follow this link to install WSL https://learn.microsoft.com/en-us/windows/wsl/install-manual#step-4---download-the-linux-kernel-update-package
  2. After that restart your system, then open docker (It may take up to 10 secs to start)

Hope it may solve your issue✌️

Tobias S.
  • 21,159
  • 4
  • 27
  • 45
BIBIN S
  • 1
  • 1
0

I had also faced the same error. but for me, I fixed this by following steps.

 -> Quit your docker desktop completely.

 -> Restart your system if possible ( optional ).

 -> Run docker desktop app with admin rights.
kishan maharana
  • 623
  • 8
  • 10