I tried installing Docker in windows 10; I activated WSL and virtualization in windows features too, and also installed the latest ubuntu distro.
But when starting docker it holds on for little bit longer than usual and says "failed to start docker".
Following is first error I got:
Docker.Core.HttpBadResponseException:
{"message":"1 error occurred:nt* starting WSL integration service: synchronising agents: starting added distros: 1 error occurred:nt* waiting for WSL integration for Ubuntu: timed out while polling for WSL distro integration to become ready in "Ubuntu"nnnn"}
at Docker.Core.GoBackend.GoBackendClient.<PostNoBodyWithError>d__19.MoveNext() in C:workspaces4.16.xsrcgithub.comdockerpinatawinsrcDocker.CoreGoBackendGoBackendClient.cs:line 226
--- 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__11.MoveNext() in C:workspaces4.16.xsrcgithub.comdockerpinatawinsrcDocker.EnginesWSL2LinuxWSL2Engine.cs:line 54
--- 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:workspaces4.16.xsrcgithub.comdockerpinatawinsrcDocker.ApiServicesStateMachinesTaskExtensions.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__6.MoveNext() in C:workspaces4.16.xsrcgithub.comdockerpinatawinsrcDocker.ApiServicesStateMachinesStartTransition.cs:line 91
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Docker.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__6.MoveNext() in C:workspaces4.16.xsrcgithub.comdockerpinatawinsrcDocker.ApiServicesStateMachinesStartTransition.cs:line 118
--- 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.EngineStateMachine.<StartAsync>d__15.MoveNext() in C:workspaces4.16.xsrcgithub.comdockerpinatawinsrcDocker.ApiServicesStateMachinesEngineStateMachine.cs:line 72
--- 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.<StartAsync>d__23.MoveNext() in C:workspaces4.16.xsrcgithub.comdockerpinatawinsrcDocker.EnginesEngines.cs:line 109
And then on later tries the error I got was different:
Docker.Core.HttpBadResponseException:
{"message":"1 error occurred:nt* starting WSL integration service: integration service is already runningnn"}
at Docker.Core.GoBackend.GoBackendClient.<PostNoBodyWithError>d__19.MoveNext() in C:workspaces4.16.xsrcgithub.comdockerpinatawinsrcDocker.CoreGoBackendGoBackendClient.cs:line 226
--- 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__11.MoveNext() in C:workspaces4.16.xsrcgithub.comdockerpinatawinsrcDocker.EnginesWSL2LinuxWSL2Engine.cs:line 54
--- 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:workspaces4.16.xsrcgithub.comdockerpinatawinsrcDocker.ApiServicesStateMachinesTaskExtensions.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__6.MoveNext() in C:workspaces4.16.xsrcgithub.comdockerpinatawinsrcDocker.ApiServicesStateMachinesStartTransition.cs:line 91
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Docker.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__6.MoveNext() in C:workspaces4.16.xsrcgithub.comdockerpinatawinsrcDocker.ApiServicesStateMachinesStartTransition.cs:line 118
--- 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.EngineStateMachine.<StartAsync>d__15.MoveNext() in C:workspaces4.16.xsrcgithub.comdockerpinatawinsrcDocker.ApiServicesStateMachinesEngineStateMachine.cs:line 72
--- 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.<StartAsync>d__23.MoveNext() in C:workspaces4.16.xsrcgithub.comdockerpinatawinsrcDocker.EnginesEngines.cs:line 109
I have tried most of the things I searched online. I uninstalled, shut down the pc and installed again as admin; all in vein. And yes, I also enabled WSL2.
Then I again uninstalled and cleared all docker folders on the system and re-installed, shutting down and installing. No difference.
3
Answers
Make sure you are using WSL 2 version. You can update version with below command.
After updating version restart system, issue should be resolved.
I was facing the same issue in Windows 11 home.
The below commands fixed it:
wsl --shutdown
wsl
Similar to previous answers. In my case, after shutting Docker service and Docker desktop and then
wsl --shutdown
.I then updated wsl with
wsl --update
which installed version 2 and started Docker service and then Docker Desktop and all worked fine again.