Can't start docker on windows - docker

I continue to get the following error when trying to start docker on Windows 10 pro. my HyperV is turned on and running:
Version 18.04.0-ce-win62 (17151)
Channel: edge
e0a85f6
Any help would be appreciated!
Unable to create: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Hyper-V encountered an error trying to access an object on computer 'C001715587' because the object was not found. The object might have been deleted. Verify that the Virtual Machine Management service on the computer is running.
at New-Switch, : line 117
at , : line 394
at Docker.Core.Pipe.NamedPipeClient.Send(String action, Object[] parameters) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Core\pipe\NamedPipeClient.cs:line 36
at Docker.Actions.DoStart(SynchronizationContext syncCtx, Boolean showWelcomeWindow, Boolean executeAfterStartCleanup) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Windows\Actions.cs:line 75
at Docker.Actions.<>c__DisplayClass15_0.b__0() in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Windows\Actions.cs:line 59
at Docker.WPF.TaskQueue.<>c__DisplayClass19_0.<.ctor>b__1() in C:\gopath\src\github.com\docker\pinata\win\src\Docker.WPF\TaskQueue.cs:line 59

You may need to fix your "Control Flow Guard" settings for vmcompute.
(Be aware that CFG is an exploit-protection mechanism, so pay attention when changing it and understand why it exists.)
Open Windows Security
Open App & Browser control
Click Exploit protection settings
Switch to Program settings tab
Locate C:\WINDOWS\System32\vmcompute.exe in the list and expand it
Click Edit
Scroll down to Control flow guard (CFG) and uncheck Override system settings
Start vmcompute from powershell net start vmcompute (or alternately start the Hyper-V Host Compute Service from the system Services app)
Restart PC
Open Hyper-V as Administrator
Connect to Server, Local computer, OK
The above worked for me when I couldn't run docker, then I realized I couldn't connect to my local machine on hyper-v. This is what finally worked.

Try this. It's sorting the problem of many people.
cd "C:\Program Files\Docker\Docker"
./DockerCli.exe -SwitchDaemon

I tried to run it from C:\Program Files\Docker\Docker\Docker Desktop.exe
And it worked.
Also, one more thing I added is I kept the Cisco AnyConnect VPN service running (although none of the VPNs were connected). I know this point sounds weird but I thought to share it.

If You, like me, already have an installed wsl2 distro on Your system (at the time You install Docker Desktop) and all the answers above did not help, than look if Your distro is actually running by hitting the command wsl -l -v
wsl -l -v
NAME STATE VERSION
* Ubuntu-20.04 Running 2
docker-desktop Running 2
docker-desktop-data Running 2
If so, then shutdown Your wsl instance by running wsl -t Ubuntu-20.04 this fixed the issue on my system. Docker Desktop window came immediately up after the wsl instance was down.
I think the problem is that I already have a docker installed in this wsl instance.

If you facing
Unable to stop Hyper-V VM: Service 'Hyper-V Host Compute Service
(vmcompute)' cannot be started due to the following error: Cannot
start service vmcompute on computer '.'.
this error then follow the steps:
Open "Window Security"
Open "App & Browser control"
Click "Exploit protection settings" at the bottom
Switch to "Program settings" tab
Locate "C:\WINDOWS\System32\vmcompute.exe" in the list and expand it
Click "Edit"
Scroll down to "Code flow guard (CFG)" and uncheck "Override system settings"
Start vmcompute from powershell "net start vmcompute"

The fix for me was to enable virtualisation in my bios. It'll be in Advanced > CPU Configuration > SVM - make sure it's enabled

Related

"Docker Desktop Starting..." forever on Windows

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:
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
Removing 'Docker' and 'Docker Desktop' folders from AppData/Roaming and AppData/Local
Uninstalling and reinstalling Docker with different versions including 4.5.1
The main problem is WSL2 does not auto install the kernel when WSL2 installs, yet Docker Desktop expects it already installed. So, fully close & stop Docker as other answers have said, then run this cmd as admin:
wsl --update
Now open Docker Desktop & it should start up ok.
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
Kill LxssManager Windows service using wmic+PID.
Start LxssManager service.
Repeat twice or more if issues persist.
Docker and WSL issues are solved.
Here i am using Windows platform, I faced this issue.
And to resolve this issue follow the below steps.
Just delete the temporary files from the following.
C:\Windows\Temp
C:\Users{yourAccountName}\AppData\Local\Temp
C:\Windows\Prefetch
then
Uninstall Docker Desktop
Restart computer
before installing docker, make sure you have Ubuntu WSL(download from Microsoft store)
[optional] If you need Terminal Preview(multi-terminal) download from Microsoft Store. Great Terminal
Install Docker Desktop Again
Thanks
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:
Exploit Protection > System Settings > Control Flow Guard
turn on
restart computer
Then reinstall/restart Docker Desktop, and it works!
Hope this helps someone else
I was facing same code for for Docker version 4.*. For me it was Visual Studio code,
Stopped WSL form Task manager
stopped Docker which was showing "Docker desktop is starting" form Task manage
stopped Visual Studio code form Task manager
Started Docker again
These steps placed my Docker in Running state in 30 seconds
Hope this helps someone!
Solved this issue with #Alvi answer
Docker forever in "Docker is starting.." at Windows task
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
My fresh install was experiencing the same symptoms. Also wsl --list showed "no installed distributions". I tried many reinstallations and restarts of Docker and WSL, but eventually found the steps:
In Task Manager, kill all processes related to Docker & Docker Desktop
Run Docker Desktop as administrator
Got it working on on Windows 11 Enterprise.
for me it worked in windows (docker desktop):
to uninstall the docker
reinstall as administrator
don't select the part with wsl
As wrote here, you need to do:
wsl --update
But after that it doesn't fix my issue until I did restart to my pc.
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 use Docker with PyCharm. I ran into this problem when I launched PyCharm and Docker Desktop at about the same time.
On my machine Docker Desktop starts automatically when I boot. I can avoid the problem by waiting for Docker Desktop to finish starting. And then start PyCharm.
I was also having the same problem, just a few minutes ago.
Platform:
Windows 10 Pro - 22H2 - Build 19045.2486
Windows Updates newly installed: KB5022282, KB5020876, KB5012170
What i did was: Activating the Windows Hypervisor Platform
And it did solve the problem, atleast for now
In my case it helped me to enable the CPU SVM (Support Vector Machine) function in my BIOS settings.
Also, if you have this feature disabled, you will not be able to use Virtual Box either.
SVM in BIOS
got to services and stop Docker desktop service and start again
reopen Docker desktop it will work
wsl -v
if it show version then linx is install
search windows programer feature in your laptop
enable virtulization
wsl --set-default-version 2
restart laptop and then start docker and wait for 2 minutes your docker will start working
I am running windows 11, visual studio 2023 and had this issue.
First, open a command prompt and type
wsl.exe --list --online
Then enter following
wsl.exe --install Ubuntu-20.04
Then type in the prompt sudo apt update to update the distribution. Lastly, start up Docker desktop and log in (you can register at their site). That fixed Docker on my pc.

Docker desktop crash on start up in Windows 10

I installed docker desktop on Windows 10 through 'Docker Desktop Installer'.
After installation I logged off and logged in. It crashes on start up after some time stating the message as below
Docker.Core.Backend.BackendDestroyException:
One or more errors occurred.
at Docker.Core.Pipe.NamedPipeClient.<TrySendAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Docker.Core.Pipe.NamedPipeClient.Send(String action, Object[] parameters)
at Docker.Actions.DoStart(SynchronizationContext syncCtx, Boolean showWelcomeWindow, Boolean withNotifications)
at Docker.Actions.<>c__DisplayClass26_0.<StartAsync>b__0()
at Docker.ApiServices.TaskQueuing.TaskQueue.<>c__DisplayClass18_0.<.ctor>b__1()
System.AggregateException:
One or more errors occurred.
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Docker.Backend.LifecycleClient.DockerStart()
at Docker.Backend.ContainerEngine.Linux.DoStart(Settings settings, String daemonOptions, Credential credential)
at Docker.Backend.ContainerEngine.Linux.Start(Settings settings, String daemonOptions, Credential credential)
Docker.Core.HttpBadResponseException:
unable to fetch daemon.json: Get http://unix/engine/daemon.json: net/http: request canceled (Client.Timeout exceeded while awaiting headers)
at Docker.Backend.HttpClientExtensions.<ParseResponseBodyAsJsonAsync>d__2`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Docker.Backend.HttpClientExtensions.<GetJsonAsync>d__0`1.MoveNext()
I uninstalled, re-started my PC and installed by selecting 'Windows Container'. Then after the restart checked on running docker. It started successfully. But when I switch to Linux containers it again fails with the same error message above.
The main goal to fix this is:
Press windows "start" button
Enter by keyboard services + enter
Find two of them : "Hyper-V Virtual Machine Management" and "Hyper-V Host Computer Service"
(on each service)click mouse right-button, select "properties" and change in opened window "startup type" to "manual", then "ok" button.
Click again on each mouse right-button and select start
Press windows "start" button, enter "hyper-v", it will show you hyper manager, open it
In hyper-v manager select "connect to server", from pop-up select "local computer"
Run your desktop docker it is probably working now with no crashes and exceptions.
What helps is already given in the other answers, i just try to be more specific and try to avoid some traps by using Environment-Variables in the paths and append some details and reasoning for the core problem:
First of all, make sure the "Docker Desktop Service" is running, which should be the case once you logged out and in again directly after install or rebooted the system. To check the status of services do either click/press/touch the Start-Button/Windows-Key to initiate the integrated Desktop-Search and type:
services
or type
services.msc
in either the desktop-search as stated before, or open the Run-dialog by pressing and holding down the "Windows-Key" and the "R"-key right after it as well, then release the keys. In the "Run-Dialog" type
services.msc
Use the command-line-interface (CLI)-tool "DockerCli.exe" with the attribute/option "SwitchDaemon". For this you need to open a command-line, either PowerShell or CommandShell, you do this by either click/press/touch the Start-Button/Windows-Key to initiate the integrated Desktop-Search and type:
cmd
for the CommandShell, or for the PowerShell:
powershell
or you type "cmd.exe" or "powershell.exe" in either the Desktop-Search as stated before, or you
open the Run-dialog by pressing and holding down the "Windows-Key" and the "R-Key" right after it as well, then release the keys. In the "Run-Dialog" type "cmd.exe" or "powershell.exe".
To actually switch the Docker-Service operation-mode use the following:
If you are in the Command-Shell/cmd.exe type:
cmd -C "%ProgramFiles%\Docker\Docker\DockerCli.exe -SwitchDaemon"
Or if you are in PowerShell type:
& "Env:ProgramFiles\Docker\Docker\DockerCli.exe -SwitchDaemon"
If all that is too complex for you and you want to try a "fire&forget"-approach - relying on the assumption that the Docker-Desktop-Service is indeed running, because you either logged out and back in after install or you already rebooted your system, you may use the Run-Dialog (to open via Win+R) and paste the following line:
powershell.exe & "$Env:ProgramFiles/Docker/Docker/DockerCli.exe -SwitchDaemon"
This will work because it explicitly executes the PowerShell (which is part of Windows 10 and Docker Desktop only runs on Windows 10) and passes to it the command DockerCli.exe -SwitchDaemon.The path is determined via the System-Environment-Variable ProgramFiles which will resolve to your System-Root and Program-Files directory (in most cases "C:\Program Files", but can also be on a manually set drive-letter, e.g. "B:" (which is often used on embedded systems to prevent automatic creation of swap-files), so on "B:\Program Files" in that case.
It relies on the standard install-path of Docker Desktop on Windows 10 systems, if you changed it you have to adjust the path accordingly. You will have no feedback. Just start "Docker Desktop" from your Start-Menu after you pasted and executed the command from the Run-Dialog.
The path in all examples is set in quotes ("") to guarantee that it can be executed. This would be a necessity as well if you for example want to prepare a Shortcut on the Desktop for first use after deployment, e.g. titled "Run this once (if Docker Desktop fails to start)". This way you can make it part of an image with Docker preinstalled.
Be aware that the main problem is that Docker uses WSL2 to provide its Linux-based containers (on Windows 10 Home exclusively) and that to run Windows-Containers Hyper-V needs to be enabled, sadly the latter contradicts with WSL2 on Windows 10 Desktop operating systems. You can enable Hyper-V afterwards, together with Virtual-Machine-Services and Windows-Containers via Windows 10 Features, but it is not guaranteed it will work toegther with WSL2.
Click on the Start button
Then type services
Search for Docker Desktop Services.
Click on that
On the top left click on stop service
Then click on start service.
now open windows powershell as administrator
type docker
this will show you the list of commands
after that type docker images
this will show you the following error
error during connect: This error may indicate that the docker daemon is not running.
After that run this command
& 'C:\Program Files\Docker\Docker\DockerCli.exe' -SwitchDaemon
and then run the following command
docker images
This will solve your problems
The solution for me was to enable virtualization for my CPU in my computer's BIOS. Docker relies on virtualization to make containers work. For me, when it was disabled, Docker Desktop kept crashing and restarting and unhelpfully giving me very little information.
Here's a helpful page with some details on how to enable virtualization:
https://bce.berkeley.edu/enabling-virtualization-in-your-pc-bios.html
The short instructions are:
Reboot your computer.
Press DEL or F2 or whatever it is for your computer to get into the BIOS.
Look for CPU settings, then find something called VT-x, AMD-V, SVM, or Vanderpool. Enable it.
Save settings and restart your computer.
You should be open Hyper-V section.Docker doesn't work without Hyper-V.
How to open Hyper-V section:
Right click on the Windows button and select 'Apps and Features'.
Select Programs and Features on the right under related settings.
Select Turn Windows Features on or off. Select Hyper-V and click OK.
The FIX IS SIMPLE...
If you are using Docker Desktop for Windows, go to the System Tray in the lower right corner of your Windows screen, right-click the docker whale icon, and in the Docker settings popup choose Switch to Windows containers...
You cannot use the Linux Containers unless you install and are running a Linux Container host VM like Moby VM running under HyperVisor and also install and run the Docker Daemons and all its dependencies.
I would just use Windows Containers. Otherwise, you are looking at a larger setup on your Windows computer.
Updating my Windows version seems to fix this problem. I had the same error, but after updating Windows, Docker is working like a charm.

The docker client must be run elevated to connect

When I am trying to built docker app, I am getting below error. Command I am running is docker build -t node_curd_exe .
error during connect: Post http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.40/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&session=h3q9gxeprezyco28agiqe9jp2&shmsize=0&t=node_curd_exe&target=&ulimits=null&version=1: open //./pipe/docker_engine: 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.
Anything else I can do ?
I have encountered this problem myself. My problem was that I had configured Docker Desktop to not run at startup. As long as Docker Desktop is not running, you will not have the Docker daemon running, hence the error.
Quickly check whether you have a white whale in your taskbar before trying any more exotic solutions.
Try this:
"Hardware assisted virtualization and data execution protection must be enabled in the BIOS"
Typically, this problem is due to a disabled Hyper-V or because the hypervisor agent is not running.
Open a Windows shell as administrator and enable Hyper-V with:
dism /Online /Enable-Feature:Microsoft-Hyper-V /All
Reboot your machine and see if Docker for Windows starts.
If the above doesn't work, open a Windows shell as administrator and enable the hypervisor with:
bcdedit /set hypervisorlaunchtype auto
If Docker for Windows is still not working properly, try the following additional solutions, which are based on instructions extracted from this Docker for Windows issue thread.
Reboot your machine and see if Docker for Windows starts.
Copy this path: Control Panel\Programs\Programs and Features into a File Explorer address bar.
Click Turn Windows feature on or off on the left side of the Control Panel.
Clear the Hyper-V check box in the list of Windows features.
Reboot your machine and start Docker for Windows (or reinstall if necessary). If the above doesn't work, then Virtualization Based Security (VBS) might be interfering and needs to be disabled. Try the following to disable VBS:
Open the Local Group Policy Editor (gpedit.msc)
Go to Computer Configuration\Administrative Templates\System\Device Guard
Disable VBS.
I had a similar issue : Docker Desktop was configured to run Linux containers but my Visual Studio project targeted Windows containers.
So after launching Docker, I right-clicked the whale (was red) in the taskbar's tray and selected the 'Switch to Windows containers' menu item.
An error message showed up talking about 'Deny write access for fixed drives not protected by Bitlocker' which was fixed by launching a regedit and putting a 0 for the following key : Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Policies\Microsoft\FVE\FDVDenyWriteAccess
Then repeating the tray action finally worked and the whale turned to white.
Open PowerShell as Administrator and run:
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
try this on your CMD:
docker-machine create box
docker-machine env box
this issue still open
What solved in my case, on Windows 11, was to turn off Hypervisor and Windows Subsystem for Linux, reboot and turn on again.

Docker forever in "Docker is starting.." at Windows task

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.
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
How to Fix Docker for Windows "Docker Is Starting..." Error
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!!
SOLUTION
In the lower right-hand corner of Windows, in your Notifications/System Tray section, right-click the docker "whale" icon.
In the context menu that pops up, choose "Switch to Windows containers..."
This should unfreeze "Dockers for Windows" instantly! If it does not, close "Dockers for Windows" and open it again.
:) peace
Personally, the most non-destructive method for myself has been to use:
wsl --terminate docker-desktop
wsl --terminate docker-desktop-data
Close Docker Desktop GUI (cancel/close any error messages)
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.
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
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:
Reset to factory defaults (from the whale menu, Settings, reset)
If that doesn't work, manually uninstall docker and download the latest installer from https://docs.docker.com/docker-for-windows/
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.
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
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.
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
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.
Check if docker for Windows will start when windows starts (this is the default behavior) if not check it.
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.
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
Step 2: Turn Windows Features on / Off
Ensure the following as shown below
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.
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.
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
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.
Restarted Docker Desktop in Admin mode and it worked for me.
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:
Run this command:
wsl --install
then you will get list of valid distributions can be installed:
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
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
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.
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
If your internet is running behind proxy - you should enter proxy settings in "Proxies" tab of docker's configuration window - that worked for me.
Go to Exploit Protection >Program Settings
Disable CFG of both
1.C:\Windows\System32\vmwp.exe
2.C:\Windows\System32\vmcompute.exe
For mine it works when I got Task Manager-> Startup->Disable Docker
Open Docker and it will run.
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:
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.
I tried most of the top answers with no solution. Ended up with uninstalling and reinstalling docker and it worked.
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
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.
None of the existing answers work for me.
Go to Task Manager > Detail tab and kill every process that starts with wsl... (specially wslservice.exe)
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
For me it was vmms service, that was disabled manually.
Check your ability to create virtual machines through powershell
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
I got it working by:
stopping/killing everything in task manager that had the word "docker" in it.
unregistering all wsl2 distributions
install the WSL2 distribution I needed.
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>
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.

Unable to start Docker in Windows 10 - Hyper-V error is thrown

I get the below error while starting of docker in Windows 10. Anyone can guide me to install docker correctly?
Unable to create: The running command stopped because the preference variable
"ErrorActionPreference" or common parameter is set to Stop: Hyper-V encountered
an error trying to access an object on computer 'XXXX' because the object was not
found. The object might have been deleted, or you might not have permission to
perform the task. Verify that the Virtual Machine Management service on the
computer is running. If the service is running, try to perform the task again by
using Run as Administrator.
at New-MobyLinuxVM, <No file>: line 242
at <ScriptBlock>, <No file>: line 362
at Docker.Backend.HyperV.RunScript(String action, Dictionary`2 parameters)
at Docker.Backend.ContainerEngine.Linux.Start(Settings settings)
at Docker.Core.Pipe.NamedPipeServer.<>c__DisplayClass8_0.<Register>b__0(Object[] parameters)
at Docker.Core.Pipe.NamedPipeServer.RunAction(String action, Object[] parameters)
Versions
OS : Windows 10 Enterprise
Version : 1607
OS Build : 14393.576
Docker Version : 1.12.3 (Stable)
Run “MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof” from command prompt in admin mode.
No need to restart machine as well after this execution, it worked for me.
I have also faced this same issue. I have solved it by removing all MobyLinuxVM virtual machines. Following are its steps.
Open Hyper-V Manager
Select all MobyLinuxVM from Virtual Machines.
Right click and delete all of these virtual machines.
Restart docker.
These steps has solved this issue on my system.
Assuming you are trying to run a Windows container:
Right click on the Docker system tray icon, then select “Switch to Windows Containers”.
It will eventually have you reboot the system, but will no longer attempt to run the MobyLinuxVm as mentioned in your error message.
If it helps anyone, I am on Apple hardware (MacOS) running a Windows 10 VM via Parallels. I also made sure that under my parallel settings > Processors and Memory > Advanced, I had Hypervision applications enabled.
This issue is very similar to this the another question Docker - The computer 'WINDOWS10-ON-SE' could not be resolved
See my answer at https://stackoverflow.com/a/45099242/279272
I was also facing the same issue but it was random in nature, I found it is due to some inaccessibility of network card by the docker start script. This inaccessibility further blocks the start up process of docker.
I found one hack and it is working fine on my windows machine
Hack
Open C:\Program Files\Docker\Docker\resources\mobylinux.ps1 with any editor in admin mode.
Find following code (around line 164)
$networkAdapter | Remove-NetIPAddress -Confirm:$false -ea SilentlyContinue
$networkAdapter | Set-NetIPInterface -Dhcp Disabled -ea SilentlyContinue
$networkAdapter | New-NetIPAddress -AddressFamily IPv4 -IPAddress $switchAddress -PrefixLength ($SwitchSubnetMaskSize) -ea Stop | Out-Null
Add a return after line 165 in a new line like below and save the file.
$networkAdapter | Remove-NetIPAddress -Confirm:$false -ea SilentlyContinue
$networkAdapter | Set-NetIPInterface -Dhcp Disabled -ea SilentlyContinue
return
$networkAdapter | New-NetIPAddress -AddressFamily IPv4 -IPAddress $switchAddress -PrefixLength ($SwitchSubnetMaskSize) -ea Stop | Out-Null
Now restart docker and after restart completion execute following commands in dos admin mode to setup the network card manually
netsh interface ipv4 set address name="vEthernet (DockerNAT)" static 10.0.75.1 255.255.255.0
You have to run this command everytime whenever you are doing system restart and docker completes start process (due to any reason).
TIP : create a batch file of this command and save somewhere handy.
Note: The ps hack would get undone by any docker update. so be aware...
to install docker, BIOS-level Hardware Virtualization support is required.
so you can do the following..
-Ensure that hardware virtualization support is turned on in the BIOS settings in your mother board settings when you start your computer, under (system security => virtualization technology VTX => enable it) then Save the BIOS settings and boot up the machine normally. then enable hyper v if it was not enabled by running this command in your powershell as an admin:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
For me updating windows 10 pro to version 1809 fixed the issue
On windows 10, I fixed the issue by executing the steps below:
French Windows version:
Close Docker Desktop
Go to "Contrôle des applications et du navigateur"
Click on "Paramètre d'exploit protection" under "Exploit protection"
Go to the tab "Paramètres du programme"
Search "C:\Windows\System32\vmcompute.exe" or "vmcompute.exe"
Click on update and untick all the checkboxes related to all the configurations and then apply
Run Docker Desktop again
English Windows version:
Close Docker Desktop
Go to "App & browser control"
Click on "Exploit protection settings" under "Exploit protection"
Go to the tab "Program settings"
Search "C:\Windows\System32\vmcompute.exe" or "vmcompute.exe"
Click on update and untick all the checkboxes related to all the configurations and then apply
Run Docker Desktop again
Hope this will help someone else.
when you starting windows and starting docker just a right click docker in right bottom bar and switch to windows container

Resources