247

I have installed a Docker stable version, and it took forever to start. Until now I have not seen the notification showing Docker is running. I can only see the Docker icon at the taskbar, showing Docker is starting.

I am running on Windows 10 Pro, Intel Core 2 Duo E8500, supporting virtualization.

Two
  • 512
  • 4
  • 17
davidlee
  • 5,611
  • 17
  • 56
  • 82
  • 11
    I have to restart my system every time to get Docker started. – Mehraj Malik Oct 10 '19 at 10:00
  • 6
    hate to say this, but it is running fine after restarted Windows system – http8086 Sep 07 '21 at 09:42
  • Consider checking out this answer in another very similar question. This will solve the problem: https://stackoverflow.com/questions/71238673/docker-desktop-starting-forever-on-windows/71258405#71258405 – Metafaniel Mar 12 '22 at 05:37
  • On Windows 10: Docker worked fine yesterday, today eternal "Docker is starting..." - only solution was a fresh install *cursing – bathyscapher Sep 01 '22 at 09:33
  • that's will works on Windows 11 https://stackoverflow.com/a/67688891/15517013 – Linar Jan 29 '23 at 07:47
  • Make sure wsl (Windows Subsystem for Linux) is running in the services in windows OS – Ram Jul 15 '23 at 05:49

39 Answers39

212

Important Note: As @Nachtalb said, "I think it should be noted that this removes all docker containers and data. (WLS: Unregisters the distribution and deletes the root filesystem)."

Thanks to https://github.com/docker/for-win/issues/7050, you should just run these two lines of commands inside PowerShell:

First, exit the docker hub desktop, then run these commands in PowerShell:

wsl --unregister docker-desktop
wsl --unregister docker-desktop-data
Rohan Bari
  • 7,482
  • 3
  • 14
  • 34
  • 1
    While I still had to reinstall, these commands were also necessary to fully clean all the old stuff out. – Erica Kane Jul 27 '20 at 23:10
  • 4
    After these commands my docker failed to start. Then i followed these steps and it worked. https://github.com/docker/for-win/issues/3764#issuecomment-484428134 – Karthik P Dec 22 '20 at 08:54
  • 3
    thanks. this one did it for me. i stopped docker which was stuck on starting, ran the two above commands, and started it agian, and it started successfully. – Ali Khawaja Dec 30 '20 at 11:40
  • and after restart windows, worked for me. – Kugan Kumar Dec 20 '21 at 10:14
  • Used the above mentioned commands and then shut down and started the windows and that worked. – Muhammad Tariq May 20 '22 at 03:53
  • I didn't need to restart windows afterwards but did need to restart Docker Desktop (which it prompted me to do anyway). – Steve Chambers May 23 '22 at 10:52
  • I used the docker troubleshoot context menu and that gave an option to restore to factory defaults. it worked and has the same effect as this i guess – mishal153 Sep 15 '22 at 19:11
  • What to do if the two commands are always "unregistering" and do not stop? – Chris Tang Dec 28 '22 at 06:40
  • 1
    Running these commands I found that it returned error 'There is no distribution with the supplied name'. In this case the solution from Stokely worked. So if anyone does get that error then the other solution may be worth a try. – Andrew Stalker Jan 28 '23 at 11:47
  • I ran these 2 commands. Then I had to reboot my system, and it got fixed – Rahul Dey Mar 03 '23 at 07:13
  • Did not work for me, even after PC reboot. – fabpico Jun 07 '23 at 12:57
135

I stumbled upon the solution which turned out to be super simple! When Docker installs on a Windows device it doesn't bother to check if your Operating System is Windows, not Linux. So, it tries to start up looking for Linux containers that do not exist. Just set it to run under Windows containers:

  1. In the lower right-hand corner of Windows, in your Notifications/System Tray section, right-click the docker "whale" icon.

  2. In the context menu that pops up, choose "Switch to Windows containers..."

  3. This should unfreeze "Dockers for Windows" instantly! If it does not, close "Dockers for Windows" and open it again.

An image of the context menu for Docker, with the option titled "Switch to Windows containers..." circled.

Slate
  • 221
  • 5
  • 14
Stokely
  • 12,444
  • 2
  • 35
  • 23
  • 2
    Worked for me! Switch to windows containers - unfreezes the starting... - switch back to linux containers - everything fixed! I used to completely uninstall and reinstall docker for this, losing all my containers in the process... – mmey Mar 24 '23 at 09:47
  • Did not work for me at all. I selected "Switch to Windows containers...", confirmed the popup and nothing happens. I can close Docker-Desktop window and restart but still the same problem. It hangs so badly that it does not even switch at all. – Jörg Jul 11 '23 at 14:58
  • 1
    Kind of worked... I switched, nothing happened. But when I switched back to Linux Containers everything worked again, after a short delay. – robs Aug 01 '23 at 05:38
  • Does not work for me too. – Čamo Aug 03 '23 at 07:48
  • Task nanager -> services ->WslService restart worked for me. – Čamo Aug 03 '23 at 08:01
109

Personally, the most non-destructive method for myself has been to use:

  1. wsl --terminate docker-desktop
  2. wsl --terminate docker-desktop-data
  3. Close Docker Desktop GUI (cancel/close any error messages)
  4. Start Docker Desktop again.

Docker then indicates its starting the wsl services during its start process and my issues are resolved.

Other methods (like register/unregister) tend to be much more destructive and I lose configuration/data/volumes.

Mark Mayo
  • 12,230
  • 12
  • 54
  • 85
Thechickenmoo
  • 1,199
  • 1
  • 6
  • 5
28

I guess you are using wsl2 features. In that case, open PowerShell or command prompt and type: optionalfeatures.exe

scroll down and uncheck

Windows Subsystem for Linux

apply the changes and restart your computer.

After restart follow the previous steps again and check

Windows Subsystem for Linux

and restart again. Hopefully now your docker will run

Alvi
  • 351
  • 5
  • 7
21

This is followed by docker/for-win issue 487 and mostly: issue 482.

The Diagnose and Feedback menu should allow you to access the logs which are in:

 %LOCALAPPDATA%\Docker\log.txt

It will generate a zip file with said logs and other information.

The default recommendation is:

But sometimes, all the options in the "Reset" pane are grayed out.

For testing, desactivating the AV (AntiVirus) is an option (again, just to be tested).

Check also the state of your Network adapater in the device manager.

If you have a third-party network product like a VPN (for instance https://www.zerotier.com/), try and uninstall it before restarting docker.

Resetting Hyper-V could help:

Go to "Turn Windows features on or off", disable all Hyper-V related features, reboot, then Docker should ask if it can enable and reboot for you.
Let it do that and see if it's fixed. If not I'd probably try manually re-enabling Hyper-V.

Similarly:

I had a problem with most recent version. I uninstalled it, removed all docker folders and server and virtual switch from hyper-v and then reinstalled and it worked.

Check if you don't have some IP address already in use.
Finally, you can perform some Hyper-V tests.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
13

I also ran into this "Docker is starting..." problem on Win10 Enterprise version 22H2 with Docker Engine v20.10.22

I tried all of the top-rated comments, including uninstalling and reinstalling Docker, running wsl --unregister docker-desktop and wsl --unregister docker-desktop-data, deleting the Docker and Docker Desktop folders from AppData\Roaming\ etc. However, none of the solutions worked.

Instead, what eventually worked was running wsl --update in PowerShell. Note: Docker Desktop was not running when I tried this.

andicolortoo
  • 325
  • 4
  • 10
  • 1
    Turns out I was running `wsl1`. `wsl --update` updated me to `wsl2` and then Docker would start. Thanks! – harvzor Jan 18 '23 at 17:09
  • 1
    Same for me. No other above solutions worked for me. Only after running `wsl --update` in PowerShell Docker started running. – Gnanam Jan 26 '23 at 15:02
11

This is what worked for me. In my case, docker uses WSL 2 instead of Hyper-V.

  • Type optionalfeatures in Windows search and hit Enter
  • Scroll down to Hyper-V. This checkbox was selected for me.
  • Deselect the checkbox and hit OK
  • Let Windows finish disabling the feature. When completed, hit Restart now
  • After restart, docker will start automatically very quickly

Windows Features

Restart now

Docker Settings

ontherocks
  • 1,747
  • 5
  • 26
  • 43
  • 1
    Worked flawlessly for me. However, you have to type "windows feature" in Windows search to see the correct control panel option in the search result. – Udo E. Nov 30 '21 at 06:37
  • I would only recommend this option if your windows build version is >= 19041. Otherwise WSL 2 is not available and the suggested solution won't work. – Peter Mar 21 '22 at 08:25
  • Thanks! it worked for me. Also, this issue again comes when Windows goes on the update, the Hyper-V automatically gets enabled. Every time I deselect it to start my Docker. – Zaki Mohammed Jul 07 '22 at 11:05
  • Worked for me! Thanks – pavan Jul 08 '23 at 06:35
8

None of the existing answers work for me.

  1. Task Manager > Processes tab find any Docker related process and close it with 'End task' button

  2. Task Manager > Detail tab and kill every processes that starts with wsl... and docker (specially wslservice.exe)

Now open WSL (Ubuntu icon), then Docker Desktop. You'll be prompted to start the docker engine. Click on the Start, Wait around ten seconds and everything will go back to working.

Mwthreex
  • 913
  • 1
  • 11
  • 24
7

Work for me in powersheell in 17/10/2018

It looks like Hyper-V didn't get installed correctly either Try to remove them, then install manually to see if that helps. Make sure you run powershell as an admin

  • Disable-WindowsOptionalFeature -FeatureName microsoft-hyper-v -online
    • (wait, sometimes until now you have decided, if not, continue)
    • restart-computer
  • Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
    • restart-computer
  • Enable-WindowsOptionalFeature -Online -FeatureName Containers -All

or

  • run MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof in powershell
  • restarting the Hyper-V Management service
6

TLDR; I have made a video that demonstrates fixing this: https://youtu.be/NHfqxx12kRs

TL;

I have the following Build Info:

Edition Windows 10 Pro
Version 22H2
Installed on    ‎1/‎9/‎2021
OS build    19045.2075
Experience  Windows Feature Experience Pack 120.2212.3920.0

These steps worked for me.

Step 1: Quit Docker Desktop

If your Docker desktop is open, then Quit and exit out of docker desktop

enter image description here

Step 2: Turn Windows Features on / Off

Ensure the following as shown below

enter image description here

enter image description here

Step 3: Install Ubuntu terminal environment with WSL

Launch Microsoft Store and search for wsl or Ubuntu. Install latest version of ubuntu as shown in screenshot.

enter image description here

Step 4: Enabling Docker support in WSL 2 distros

Now, Enabling Docker support in WSL 2 distros as mentioned here. Simply run the following commands in windows terminal:

wsl.exe -l -v
wsl.exe --set-default-version 2
wsl --set-default Ubuntu-22.04

For me the console looks like this.

C:\Users\tutlinks>wsl.exe -l -v
  NAME                      STATE           VERSION
* Ubuntu-22.04              Running         2
  docker-desktop            Stopped         2
  docker-desktop-data       Stopped         2

C:\Users\tutlinks>wsl.exe --set-default-version 2
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
The operation completed successfully.

C:\Users\tutlinks>wsl --set-default Ubuntu-22.04

C:\Users\tutlinks>wsl.exe -l -v
  NAME                      STATE           VERSION
* Ubuntu-22.04              Running         2
  docker-desktop            Running         2
  docker-desktop-data       Running         2

Step 5: Launch Docker desktop

Launch the Docker Desktop and wait for the engine to start.

enter image description here

enter image description here

navule
  • 3,212
  • 2
  • 36
  • 54
  • 1
    By far the most useful comment, I would complement this also especially when registering a linux distro with wsl: [link](https://github.com/microsoft/WSL/issues/5393) – Cliff Njoroge Feb 21 '23 at 10:39
5

UPDATE

Looks like in Docker for Windows version: 17.09.0-ce-win33 (13620) they fixed the problem


This is an annoying problem that docker for Windows has. The latests versions have minimized it a lot but it still happens.

  1. Check if docker for Windows will start when windows starts (this is the default behavior) if not check it.
  2. Shutdown the machine. No restart. Shutdown.

Everytime you find this problem just shutdown the machine. The next time Windows boot docker will start very fast.

I know it looks esoteric but it works.

Nimantha
  • 6,405
  • 6
  • 28
  • 69
Carlos Rafael Ramirez
  • 5,984
  • 1
  • 29
  • 36
  • I did what you said, now instead of taking forever to do "Docker is starting..." I'm getting I keep getting `The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.` Any ideas? – orrymr Apr 10 '17 at 16:11
  • Well this error is strange. I recommend you uninstall and reinstall docker for Windows. – Carlos Rafael Ramirez Apr 11 '17 at 16:58
  • @orrymr, you can try running Docker for Windows as Administrator – Mihir Khandekar Oct 05 '17 at 06:02
  • I have this problem in version 18 also – Stepan Yakovenko Jun 18 '18 at 14:24
  • 1
    Hello @StepanYakovenko I haven't seen this issue in a while. I have Version 18.03.1-ce-win65 (17513) and Windows 10 April 2018 Update. I don't know exactly when it ceased to happen.One advice: always send the report to the docker team when this happens, I think it helped a lot to them figure out the problem. – Carlos Rafael Ramirez Jun 18 '18 at 20:45
4

Caution: This will delete your all existing containers

I deleted settings.json and it worked for me. (Windows 10 Home) Delete %appdata%\Docker\settings.json and let Docker to create a new one and don't forget to restart your pc

Reference to https://forums.docker.com/t/solved-docker-failed-to-start-docker-desktop-for-windows/106976/7

erhan355
  • 806
  • 11
  • 23
4

For anyone on Windows 10 Home, what worked for me was running

wsl --update

Running wsl --status revealed the WSL 2 kernel file was missing from my machine and instructed me to enable the Receive updates for other Microsoft products when you update Windows option under

Settings > Update & Security > Advanced options

Isaac Vidrine
  • 1,568
  • 1
  • 8
  • 20
3

Just solved this issue. Not sure if it would help in your case but for me it was the PATH env variable that was not set up properly. Checking the diagnostics logs I was getting "powershell not found" and "docker not found" etc

The solution for me was to add everything to the PATH environment variable:

%SystemRoot%\system32; // Stuff like bash, wsl
C:\Windows\System32\WindowsPowerShell\v1.0; // powershell itself
C:\Program Files\Docker\Docker\resources\bin; // docker-compose etc
// edit 
C:\Program Files\Docker\Docker\resources // docker itself

It might vary for your setup though

Grigory Bogush
  • 403
  • 1
  • 3
  • 14
3

I had the same problem and nothing above helps. I typed

bcdedit /set hypervisorlaunchtype auto 

and after that I restart my PC. After that docker starts normally :) Finally.

piatkosia
  • 114
  • 2
  • 4
3

Restarted Docker Desktop in Admin mode and it worked for me.

devendra
  • 79
  • 2
3

Windows 11 Pro x64

I've tried it with Container and Hyper-V's not installed but it still didn't work.

I have Container and all the Hyper-Vs enabled then ran these 3 codes as Administrator in CMD in order one-by-one and it works:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

wsl --set-default-version 2
helvete
  • 2,455
  • 13
  • 33
  • 37
A A
  • 31
  • 2
3

I solved the issue by installing linux-sub-system for win 11. Open up PowerShell then run this command to see if you have installed already:

wsl -l -v

If you have this message: enter image description here

Run this command:

 wsl --install

then you will get list of valid distributions can be installed: enter image description here

Choose your distro, in my case I used Ubuntu-20.04:

wsl --install -d Ubuntu-20.04

Also needed to switch to WSL 2 links that can help:

Windows Subsystem For Linux has no Installed Distributions Error Fix

Upgrade version from WSL 1 to WSL 2

Sergei
  • 195
  • 6
2

Tried all solutions presented here with no success. This is the only solution that worked for me (from issue 1825).

In PowerShell, run:

cd "C:\Program Files\Docker\Docker"
./DockerCli.exe -SwitchDaemon
fordcars
  • 457
  • 3
  • 14
2

The same problem on Win 10 Pro 22H2 (Docker Desktop 4.16.1). For me the solution was to temporary switch to Windows container and then switch back to Linux containers.

enter image description here

Mariusz
  • 61
  • 5
  • This is unfortunately a [known bug](https://github.com/docker/for-win/issues/13165) introduced in Docker 4.16.1. Switching container types does not consistently work to solve the issue, unfortunately. – JohnSpeeks Jan 23 '23 at 23:33
2

I installed docker 4.16.2 and faced same issue. After following through many solutions, finally updating it to 4.16.3 works for me. Here's link to issue raised on official repo and solution suggested.

Comment providing 4.16.3 release candidate: https://github.com/docker/for-win/issues/13165#issuecomment-1405161605

Release Candidate (4.16.3 exe): https://desktop-stage.docker.com/win/main/amd64/96527/Docker%20Desktop%20Installer.exe

UPDATE

You can checkout official release here: https://docs.docker.com/desktop/release-notes/#4163

Naman Jain
  • 195
  • 2
  • 15
1

If your internet is running behind proxy - you should enter proxy settings in "Proxies" tab of docker's configuration window - that worked for me.

Orkhan M.
  • 143
  • 1
  • 11
1

Go to Exploit Protection >Program Settings

Disable CFG of both

1.C:\Windows\System32\vmwp.exe

2.C:\Windows\System32\vmcompute.exe

1

For mine it works when I got Task Manager-> Startup->Disable Docker

Open Docker and it will run.

1
  1. Uninstall Docker Desktop
  2. Remove "C:\Users\Your Name\.docker"
  3. Win + R run regedit and search "...\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Docker Desktop" and delete the dir if exites
  4. clean and update wsl, run wsl --unregister ..., wsl --update and then wsl --install ...
  5. use admin open powershell and run Enable-WindowsOptionalFeature -Online -FeatureName Containers -All
  6. Install Docker Desktop and set admin
  7. Wait a few minutes, is work for me
cbl980226
  • 21
  • 2
1

Case 1: If one was able to run docker successfully at the start and this "Docker Desktop Starting" is occurring suddenly after unexpected shutdowns or other interruptions, this could be fixed by switching between Linux and Windows containers. ''' "C:\Program Files\Docker\Docker\DockerCli.exe" -SwitchLinuxEngine or "C:\Program Files\Docker\Docker\DockerCli.exe" -SwitchWindowsEngine.

For the first case, you can also try to stop and restart docker services or uninstall and reinstall the docker application.

Case 2: If Docker is not starting from the first time installation, this could be because you're system does not support or enabled hyper-v. Understand one thing that is hard to discover, just enabling wsl 2 as backend for docker isn't enough as wsl itself relies on hyper-v for execution. So check if you're system has hyper-v feature, if yes then enable it. If not, follow these steps to install hyper-v manually:

  1. Download the hyper-v.bat file for windows 10 Link: https://drive.google.com/file/d/1QT536aZMYSSj7rp766pv4YLpQaLcnB1F/view?usp=sharing

2: Open the hyper-v.bat file and the terminal screen will be displayed installing all hyper-v features.

3: Restart you're PC and go to Windows Features, Enable the hyper-v feature.

After this run the docker application making sure that wsl2 is already installed and updated. you're docker will be in a running state if you don't have hyper-v but you've installed and enabled hyper-v through these steps.

As hyper-v features are pre-installed in windows enterprise and above version, finding out that the root cause of docker not starting was the absence of hyper-v, took me nearly two days to research.

1

I tried most of the top answers with no solution. Ended up with uninstalling and reinstalling docker and it worked.

Jostein
  • 11
  • 1
1

I was struggling with this one and did all the steps mentioned above without success.

For me, it was that my BIOS required me to enable it through the motherboard's SVM option. Just make sure to restart your PC hit F2 or DEL and navigate and enable the SVM.

1

OS: Windows 10 Pro Version:22H2 Docker Desktop Version: 4.16.2

Issue: Docker stucking on starting .....

Fix: the only fix worked for me is

Go to Windows Features:

  1. Make sure you have as the following checked, especially Hyper-V Windows Feature

  2. Docker Desktop installation, uncheck Use WSL 2 instead of Hyper-V

Docker Installation

Obaida Alhassan
  • 516
  • 1
  • 5
  • 12
1

Related to this post:

My solution: Reinstalling with the “Use WSL 2 instead of Hyper-V (recommended)” box unchecked fixed the issue.

Tenarius
  • 540
  • 1
  • 5
  • 23
0

For me it was vmms service, that was disabled manually.
Check your ability to create virtual machines through powershell

EAValov
  • 1
  • 1
0

I got it working by:

  1. stopping/killing everything in task manager that had the word "docker" in it.
  2. unregistering all wsl2 distributions
  3. install the WSL2 distribution I needed.
  4. start docker desktop and wait about 5 minutes - success!

Powershell as admin:

wsl -l

Repeat for each distribution

wsl --unregister <name of distribution>

Install the one you require

wsl --install -d <name of distribution>
Jacob Brewer
  • 2,574
  • 1
  • 22
  • 25
0

Enable VM platform and update wsl solve my issue:

  • Search turn Windows features on or off > tick Virtual Machine Platform checkbox
  • Run command prompt with adminstrator mode, and execute wsl --update

After restarting system, I am able to run docker.

Orio Ryo
  • 132
  • 1
  • 2
  • 8
0

For me I got Avast antivirus installed somehow, once I uninstalled Avast it worked. Here https://github.com/docker/for-win/issues/3764 I see someone had the same issue with Norton.

0

If you have .wslconfig file then remove it and shutdown the device. this should work for you.

0

If you checked the checkbox "Start Docker Desktop when you log in" in the docker desktop settings->General, than uncheck it and create a task in the "Task Scheduler" of windows (Click on the windows icon and write "Task Scheduler"). Configure the task to trigger on startup of windows, and with a delay of 1 minute. It solved my problem.

0

Having this issues daily since upgrading to Windows 11. Seems like WSL is very unstable, but running this command in command prompt with Admin privileges fixes it temporary.

wsl --shutdown
Freedi
  • 21
  • 5
0

As stucking reason varies, I will give the specific situation I have and the solution I found just FYI.

Problems: I restored wsl2 distro Ubuntu-20.04 from a backup(I reset my Win10 OS). And the distro have integrated with docker engine before. wsl2 settings are clean. When I tick Enable integration with additional distros and restart docker desktop, I was unable to change any settings as the GUI stuck in an infinite loop. I have a windows notification said I had problem with that distro but I can find nothing else. I clicked restart and it would bring me back to the next loop...

Solutions: After tried all answers on stackoverflow, I still cannot resolve. So I use everthing to try searching for a log file modified recently. And I found this %LocalAppData%\Docker\log\host\com.docker.wsl-distro-proxy.exe.log It said that I failed in

[com.docker.wsl-distro-proxy.exe][I] wsl.exe -d Ubuntu-20.04 -u root -e /mnt/wsl/docker-desktop/docker-desktop-user-distro proxy --distro-name Ubuntu-20.04 --docker-desktop-root /mnt/wsl/docker-desktop C:\Program Files\Docker\Docker\resources

The rest is simple. Login the distro and execute the command:

 /mnt/wsl/docker-desktop/docker-desktop-user-distro proxy --distro-name Ubuntu-20.04 --docker-desktop-root /mnt/wsl/docker-desktop 'C:\Program Files\Docker\Docker\resources'

It seems it will try to create something under C:\Users\user but doesn't have permission as creating folder there would require admin privilege. Create the folder manually and remove permission restriction and that's it!

Nemo
  • 31
  • 1
  • 4
-1

Ctrl + Alt + Del => Task Manager => start up=> click on programs and click on disable => close task manager => Restart PC

If your docker takes forever to load the engine, just go to task manager and disable some running apps. It worked for me. Follow the steps

AEM
  • 1,354
  • 8
  • 20
  • 30