Docker Desktop installation failed (windows 10) - docker

So I'm trying to install Docker Desktop 4.13.1 on Windows 10 but I get this error after a while,
**Installation Failed**
Component CommunityInstaller.AutoStartAction failed: Access to the registry key 'HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run' is denied.
at CommunityInstaller.InstallWorkflow.<DoHandleD4WPackageAsync>d__30.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 CommunityInstaller.InstallWorkflow.<DoProcessAsync>d__23.MoveNext()
I've tried disabling my antivirus software but that didn't help. I can't even find anything relating to this topic on the internet. I don't know how to provide the necessary permissions to Docker.
Is there any way I can fix this?

Alright, so after a lot of headbanging, I finally found a fix. This may not work for you but it's worth trying.
First, open command prompt and run,
wsl --status
If you get something like "you have an update," you're at the right place. Then run,
wsl --install -d ubuntu
Let it finish and then run,
wsl --update
Then reboot your system and open the docker installer again. It should install fine now.

Related

How to solve this Error response from daemon [duplicate]

While I am trying to start with docker on my windows 10 machine it is returning the following error.
ERROR: open \.\pipe\docker_engine_linux: The system cannot find the file specified.
I found when I logon to my computer, the hyper VM could not run docker virtual machine automatically though my docker desktop is running. Once I start docker virtual machine on hyper VM and restart docker once again, it works okay. But this is not a permanent solution. Could I get some help please?
Restarting Docker Desktop for Windows helped me. You can do that by right-click on tray icon and selecting restart.
The same problem with Me. I am writing this command in PowerShell Run As Administrator. Switch Docker from Windows to Linux and write the command like this:
cd "C:\Program Files\Docker\Docker"
./DockerCli.exe -SwitchLinuxEngine
This is the Simple way to solve this.
In my case, the reason for the error was even easier than the main answer ("close and open it again") suggests. Docker Desktop was just not running anymore!
When I hovered over the tray icon, it vanished.
Further details:
Docker Desktop had crashed, or it was closed because of a forced update. I had this problem after updating Java runtime environment.
When I opened Docker Desktop then, an update ran, and I could not even choose between yes or no, running for at least 5 minutes with the tray icon only showing "Docker Desktop is starting". The menu had crashed as well.
Update 10 / 2022
I solved this issue by restarting WSL, as only restarting Docker was not solving it for me.
In my situation, Docker was running as expected before encountering this issue.
These are the steps I took
Close Docker Desktop
Open cmd and run wsl --shutdown
Start Docker Desktop and press Restart on the notification below
(It should pop up in a few seconds)
I am able to auto trigger docker VM start on Hyper V by enabling the following in setting :
While the error below error continuing till docker starts okay and containers are running okay.
ERROR: open .\pipe\docker_engine_linux: The system cannot find the file specified.
Try running the below commands in the Powershell and start the docker
Net stop com.docker.service
And then
Net start com.docker.service
My Docker Desktop was sort of freezing and was not starting up. Just kept showing Starting... for ever. Any docker command in terminal was throwing same exception "Error response from daemon: open \.\pipe\docker_engine_linux:". I tried some options a mentioned above, didn't worked on Windows 10. I just went to Windows Services ( In search box type "services"). Look for "Docker Desktop Service". Stop and Start it once. Then try starting your Docker Desktop again. It came up back super fast.
Try to add the folder with your project in Settings -> Resources -> File Sharing. And click the button Apply & Restart
I was facing the same issue while installing docker on windows 10. Later I could resolve the issue by updating the Linux kernel.
Go to this link and update the package for x64 machine
https://learn.microsoft.com/en-us/windows/wsl/install-win10#step-4---download-the-linux-kernel-update-package
One way of solving this problem is doing the following step again every time you open your pc:
# -------------------- enable the wsl for linux on windows ------------------- #
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
# ---------------------- enable virtual machine feature ---------------------- #
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
# ------------------------ set wsl as default version ------------------------ #
wsl --set-default-version 2
and then start docker desktop icon
and docker engine will start without any porblem
Tried a lot of things.
Helped:
Close Docker.
Start Docker as administrator.
In my case Docker Desktop was running fine but when I run docker pull for window image where as I also set switch to window container as well But I face this error Error response from daemon: open \.\pipe\docker_engine_linux: The system cannot find the file specified
Finally I fixed it by running the below command in powershell as an administrative mode
Enable-WindowsOptionalFeature -Online -FeatureName $("Microsoft-Hyper-V", "Containers") -All
I was getting similar problem on window 10 so what i uninstall the verison 4.16 and install old version 4.13.
From setting update of docker desktop i click on update to latest version and after it works
Created all file that were missing earlier
I have my cloudflare WARP running that was causing this issue I just toggled it off and it worked.
I updated docker to the latest version. Error has gone.
to solve this problem make sure you install one of the linux distribution like alpine or ubunto and that step alot of youtube vedio tutorial miss nowaday in 2022 and by the way this step is menthoned in the https://learn.microsoft.com/en-us/windows/wsl/install-manual and i mean here the step number 6 in the manual installation of windows subsystem for linux as short wsl => https://learn.microsoft.com/en-us/windows/wsl/install-manual
WSL 2 Installation was incomplete. After doing a 'restart' on Docker, it prompted me to get the Linux Kernel installed.
This message appeared while using IntelliJ service. Solutions for me was that Docker installed in windows should also be running and showing list of container. Once Docker desktop app shows container list. This docker was connected to intellij and error message was gone.
Purging data of HYPER-V, WSL 2 and Windows Containers did the trick for me. Purge data section is in troubleshooting.
I had the same issue ,I uninstalled the latest version and Installed Docker desktop 4.13, my problem is solved.
here is the download link :
https://desktop.docker.com/win/main/amd64/89412/Docker%20Desktop%20Installer.exe
Update Jan 2023
Follows up with #Michiel Pater's solution, in case wsl --shutdown hangs in your terminal, open task manager as administrator, find Windows Subsystem for Linux then kill it. After serveral seconds, press Restart from Docker Desktop notification
Error is resolved with latest Docker for Windows release 4.16.3 from 30. of January 2023.
Check here for details.
Solution For:
Docker forever in "Docker is starting.." at Windows task
Docker desktop is starting error
Docker "unable to calculate image disk size"
unable to calculate disk size docker
failed to ping VM diagnosticsd with error:
Get "http://ipc/ping": open \.\pipe\dockerDiagnosticd: The system
cannot find the file specified.
The same problem with Me in 2023. I am writing this command in PowerShell Run As Administrator. Switch Docker from Windows to Linux and write the command like this:
cd "C:\Program Files\Docker\Docker"
./DockerCli.exe -SwitchLinuxEngine
This is the simplest and best way to solve this.
ERROR:
C:\Users\user1>docker run hello-world
docker: Error response from daemon: open \.\pipe\docker_engine_linux: The system cannot find the file specified.
See 'docker run --help'.
solution:
use this command => cd "C:\Program Files\Docker\Docker"

Docker Desktop - unable to install (Windows 11)

I have been running Docker for the past 1 year on my work laptop. I recently started receiving requests to update the version. Ever since then, my Docker Desktop installer has been failing. Please keep in mind that I have already tried the following and it hasn't worked:
Ensured that Docker desktop has been completely uninstalled on my work device
Tried installing the previous docker desktop versions that were working
Unchecked the box to install the required modules for wsl (tried it with and without)
Here is the error I receive:
Component CommunityInstaller.ExecAction failed: Process InstallerCli.exe exited with code 1
at CommunityInstaller.InstallWorkflow.d__30.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 CommunityInstaller.InstallWorkflow.d__24.MoveNext()
Any suggestions on why this is happening and how to resolve it?
Thanks in advance.
Deleted the folders:
C:\ProgramData\Docker (if you cant, rename the folder)
C:\Program Files\Docker
After this, docker 4.6.0 was installed successfully.

Docker Failed to Start

I have installed the Docker and then I have started the Docker. Docker says that "Docker is starting." Then,Docker says "Docker Failed to Start". Please, Could you help me?
Docker Error Detail:
System.InvalidOperationException:
Failed to deploy distro docker-desktop to C:\Users\---\AppData\Local\Docker\wsl\distro: exit code: -1
stdout: The operation could not be started because a required feature is not installed.
stderr:
at Docker.ApiServices.WSL2.WslShortLivedCommandResult.LogAndThrowIfUnexpectedExitCode(String prefix, ILogger log, Int32 expectedExitCode) in C:\workspaces\PR-15138\src\github.com\docker\pinata\win\src\Docker.ApiServices\WSL2\WslCommand.cs:line 146
at Docker.Engines.WSL2.WSL2Provisioning.<DeployDistroAsync>d__17.MoveNext() in C:\workspaces\PR-15138\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\WSL2\WSL2Provisioning.cs:line 169
--- 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.Engines.WSL2.WSL2Provisioning.<ProvisionAsync>d__8.MoveNext() in C:\workspaces\PR-15138\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\WSL2\WSL2Provisioning.cs:line 78
--- 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.Engines.WSL2.LinuxWSL2Engine.<DoStartAsync>d__25.MoveNext() in C:\workspaces\PR-15138\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\WSL2\LinuxWSL2Engine.cs:line 99
--- 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.ApiServices.StateMachines.TaskExtensions.<WrapAsyncInCancellationException>d__0.MoveNext() in C:\workspaces\PR-15138\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\TaskExtensions.cs:line 29
--- 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.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__5.MoveNext() in C:\workspaces\PR-15138\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 67
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Docker.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__5.MoveNext() in C:\workspaces\PR-15138\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 92
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Docker.Engines.Engines.<WaitCurrentTransitionsAsync>d__30.MoveNext() in C:\workspaces\PR-15138\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\Engines.cs:line 358
--- 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.Engines.Engines.<RestartAsync>d__26.MoveNext() in C:\workspaces\PR-15138\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\Engines.cs:line 250
In my scenario, I needed to install WSL 2 and my computer didn't have it.
Installing it made docker run successfully.
Try the below steps if you are installing docker for the first time.
First, we need to activate WSL from Windows.
Control Panel -> Programs -> Turn Windows features Turn On or Off
You need to check
Windows Subsystem For Linux
Windows Hypervisor Platform
Virtual Machine Platform
Then Click ok
After that, you need to Enable WSL 1 and update it to WSL 2 (https://learn.microsoft.com/en-us/windows/wsl/install-win10#manual-installation-steps)
To Install WSL 1 which comes built-in, open PowerShell as Administrator and run:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
After that download the WSL 2 update from Microsoft. Use below this: WSL2 Linux kernel update package for x64 machines
After installing the above package, you need to set WSL 2 as the default version.
Open PowerShell as Administrator and run:
wsl --set-default-version 2
Now restart your computer. Now your docker should work.
Please note that to update to WSL 2, you must be running Windows 10.
For x64 systems: Version 1903 or higher, with Build 18362 or higher.
For ARM64 systems: Version 2004 or higher, with Build 19041 or higher.
My Solution:
I have checked the Prerequisites for Docker. I have applied the second step in prerequisites. (Windows Subsystem for Linux Installation with Manual Installation Steps) It has fixed the error for me.
If you get an error like this (during this installation process):
WslRegisterDistribution failed with error: 0x80370114 Error: 0x80370114 The operation could not be started because a required feature is not installed. (I encountered this error.) Please, apply this.
These steps are quoted from the "this" named hyperlink above.
1. Open "Windows Security"
2. Open "App & Browser control"
3. Click "Exploit protection settings" at the bottom
4. Switch to "Program settings" tab
5. Locate "C:\WINDOWS\System32\vmcompute.exe" in the list and expand it
6. Click "Edit"
7. Scroll down to "Code flow guard (CFG)" and uncheck "Override system settings"
8. Start vmcompute from powershell "net start vmcompute"
9. Then go back and command wsl --set-default-version 2
I have fixed my problems like that. Good luck :)
Docker failed to start WSL 2 update
I just did this on powershell
wsl --install -d Ubuntu
wsl --update
wsl --shutdown
The problem is in WSL as it becomes unresponsive and returns a service error. Follow the below steps
1. Uncheck the Windows Subsystem for Linux in Windows Features
2. Restart
3. Turn the feature back on
4. Re-apply the WSL2 update
5. Restart
The combination of the above answer and installation of new destro worked for me
Uninstall existing installation
Install With Admin privilege
Restart
Follow the accepted answer here https://answers.microsoft.com/en-us/insider/forum/all/wsl-2-installing-linux-failed-error-code/bae391d1-4215-4d93-b0c4-3d96404a7c74
Install a linux destro follow this https://learn.microsoft.com/en-us/windows/wsl/install-win10#step-4---download-the-linux-kernel-update-package
Launch Linux desktop as admin
I was facing the same problem in my windows cooperate desktop. Unfortunately most of the windows settings changes are not available for users and controlled by IT team. What I did to make docker running is
Open Docker Desktop
Go to Settings
Turn off "Use the WSL 2 based engine" which switch to legacy Hyper-V
I know this is not ideal but atleast got docker working.
Fyi -- jprism's answer worked for me.
My issues were...
Docker install worked but would not start successfully, I got "WSL not installed" message.
Tried the WSL installation instructions from
https://learn.microsoft.com/en-us/windows/wsl/install
Default WSL installation was not found from PS session. Would not run from the command line without specifying the distro. Worked when I explicitly specified the default distro with the -d argument
Enabled WSL Subsystem as per https://www.windowscentral.com/install-windows-subsystem-linux-windows-10
Enabled all Hyper-V options in Control Panel > Programs and features > Turn Windows features on or off in addition WSL Subsystem
Finally as per jprism modified Docker settings to use Hyper-V
this can help you
& 'C:\Program Files\Docker\Docker\DockerCli.exe' -SwitchDaemon
run this in powershell.
WSL2 cannot running.Reset winsock can fix it. Use following steps.
PS C:\WINDOWS\system32> wsl.exe --shutdown
PS C:\WINDOWS\system32> wsl.exe
The attempted operation is not supported for the type of object referenced.
PS C:\WINDOWS\system32> netsh winsock reset
Successfully reset the Winsock Catalog.
You must restart the computer in order to complete the reset.
After reboot ur system please run this command:
PS C:\WINDOWS\system32> wsl.exe
This will solve this error. I got it resolved at my machine.
Much much easier solution:
On Windows 11 with Docker Desktop v4.13.1 everything works fine with both Linux and Windows containers.
Than after a couple of restarts I suddenly get the same error (Docker failed to start etc.)
Click on Troubleshoot in the header menu. Here you can Clean / Purge data, after that it works again.
Uninstall Docker Desktop
Delete the following:
delete %appdata%\Docker*
delete %appdata%\Docker Desktop*
delete %LOCALAPPDATA%\Docker*
Reinstall Docker Desktop
Source
What fixed this for me was
Hit windows key, type "cmd", hit enter
Right click menu bar, select "Properties"
Uncheck "Use legacy console"

Error response from daemon: open \\.\pipe\docker_engine_linux: The system cannot find the file specified

While I am trying to start with docker on my windows 10 machine it is returning the following error.
ERROR: open \.\pipe\docker_engine_linux: The system cannot find the file specified.
I found when I logon to my computer, the hyper VM could not run docker virtual machine automatically though my docker desktop is running. Once I start docker virtual machine on hyper VM and restart docker once again, it works okay. But this is not a permanent solution. Could I get some help please?
Restarting Docker Desktop for Windows helped me. You can do that by right-click on tray icon and selecting restart.
The same problem with Me. I am writing this command in PowerShell Run As Administrator. Switch Docker from Windows to Linux and write the command like this:
cd "C:\Program Files\Docker\Docker"
./DockerCli.exe -SwitchLinuxEngine
This is the Simple way to solve this.
In my case, the reason for the error was even easier than the main answer ("close and open it again") suggests. Docker Desktop was just not running anymore!
When I hovered over the tray icon, it vanished.
Further details:
Docker Desktop had crashed, or it was closed because of a forced update. I had this problem after updating Java runtime environment.
When I opened Docker Desktop then, an update ran, and I could not even choose between yes or no, running for at least 5 minutes with the tray icon only showing "Docker Desktop is starting". The menu had crashed as well.
Update 10 / 2022
I solved this issue by restarting WSL, as only restarting Docker was not solving it for me.
In my situation, Docker was running as expected before encountering this issue.
These are the steps I took
Close Docker Desktop
Open cmd and run wsl --shutdown
Start Docker Desktop and press Restart on the notification below
(It should pop up in a few seconds)
I am able to auto trigger docker VM start on Hyper V by enabling the following in setting :
While the error below error continuing till docker starts okay and containers are running okay.
ERROR: open .\pipe\docker_engine_linux: The system cannot find the file specified.
Try running the below commands in the Powershell and start the docker
Net stop com.docker.service
And then
Net start com.docker.service
My Docker Desktop was sort of freezing and was not starting up. Just kept showing Starting... for ever. Any docker command in terminal was throwing same exception "Error response from daemon: open \.\pipe\docker_engine_linux:". I tried some options a mentioned above, didn't worked on Windows 10. I just went to Windows Services ( In search box type "services"). Look for "Docker Desktop Service". Stop and Start it once. Then try starting your Docker Desktop again. It came up back super fast.
Try to add the folder with your project in Settings -> Resources -> File Sharing. And click the button Apply & Restart
I was facing the same issue while installing docker on windows 10. Later I could resolve the issue by updating the Linux kernel.
Go to this link and update the package for x64 machine
https://learn.microsoft.com/en-us/windows/wsl/install-win10#step-4---download-the-linux-kernel-update-package
One way of solving this problem is doing the following step again every time you open your pc:
# -------------------- enable the wsl for linux on windows ------------------- #
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
# ---------------------- enable virtual machine feature ---------------------- #
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
# ------------------------ set wsl as default version ------------------------ #
wsl --set-default-version 2
and then start docker desktop icon
and docker engine will start without any porblem
Tried a lot of things.
Helped:
Close Docker.
Start Docker as administrator.
In my case Docker Desktop was running fine but when I run docker pull for window image where as I also set switch to window container as well But I face this error Error response from daemon: open \.\pipe\docker_engine_linux: The system cannot find the file specified
Finally I fixed it by running the below command in powershell as an administrative mode
Enable-WindowsOptionalFeature -Online -FeatureName $("Microsoft-Hyper-V", "Containers") -All
I was getting similar problem on window 10 so what i uninstall the verison 4.16 and install old version 4.13.
From setting update of docker desktop i click on update to latest version and after it works
Created all file that were missing earlier
I have my cloudflare WARP running that was causing this issue I just toggled it off and it worked.
I updated docker to the latest version. Error has gone.
to solve this problem make sure you install one of the linux distribution like alpine or ubunto and that step alot of youtube vedio tutorial miss nowaday in 2022 and by the way this step is menthoned in the https://learn.microsoft.com/en-us/windows/wsl/install-manual and i mean here the step number 6 in the manual installation of windows subsystem for linux as short wsl => https://learn.microsoft.com/en-us/windows/wsl/install-manual
WSL 2 Installation was incomplete. After doing a 'restart' on Docker, it prompted me to get the Linux Kernel installed.
This message appeared while using IntelliJ service. Solutions for me was that Docker installed in windows should also be running and showing list of container. Once Docker desktop app shows container list. This docker was connected to intellij and error message was gone.
Purging data of HYPER-V, WSL 2 and Windows Containers did the trick for me. Purge data section is in troubleshooting.
I had the same issue ,I uninstalled the latest version and Installed Docker desktop 4.13, my problem is solved.
here is the download link :
https://desktop.docker.com/win/main/amd64/89412/Docker%20Desktop%20Installer.exe
Update Jan 2023
Follows up with #Michiel Pater's solution, in case wsl --shutdown hangs in your terminal, open task manager as administrator, find Windows Subsystem for Linux then kill it. After serveral seconds, press Restart from Docker Desktop notification
Error is resolved with latest Docker for Windows release 4.16.3 from 30. of January 2023.
Check here for details.
Solution For:
Docker forever in "Docker is starting.." at Windows task
Docker desktop is starting error
Docker "unable to calculate image disk size"
unable to calculate disk size docker
failed to ping VM diagnosticsd with error:
Get "http://ipc/ping": open \.\pipe\dockerDiagnosticd: The system
cannot find the file specified.
The same problem with Me in 2023. I am writing this command in PowerShell Run As Administrator. Switch Docker from Windows to Linux and write the command like this:
cd "C:\Program Files\Docker\Docker"
./DockerCli.exe -SwitchLinuxEngine
This is the simplest and best way to solve this.
ERROR:
C:\Users\user1>docker run hello-world
docker: Error response from daemon: open \.\pipe\docker_engine_linux: The system cannot find the file specified.
See 'docker run --help'.
solution:
use this command => cd "C:\Program Files\Docker\Docker"

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.

Resources