Docker Community Forums

Share and learn in the Docker community.

Docker Desktop still using Hyper-V in Windows 10 even though it's configured to use WSL 2?

Docker desktop x64 2.3.1.0
Windows 10 Enterprise 2004

Even though it’s set up not to use hyper-V, I get an error message when starting docker desktop if the Hyper-V Host Compute Service is not enabled. Should this work even if none of the hyper-v services are running?

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.Core.WslShortLivedCommandResult.LogAndThrowIfUnexpectedExitCode(String prefix, ILogger log, Int32 expectedExitCode) in C:\workspaces\master\src\github.com\docker\pinata\win\src\Docker.Core\WslCommand.cs:line 119
   at Docker.Engines.WSL2.WSL2Provisioning.<DeployDistroAsync>d__16.MoveNext() in C:\workspaces\master\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\WSL2\WSL2Provisioning.cs:line 142
--- 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__6.MoveNext() in C:\workspaces\master\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\WSL2\WSL2Provisioning.cs:line 44
--- 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__23.MoveNext() in C:\workspaces\master\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\WSL2\LinuxWSL2Engine.cs:line 91
--- 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\master\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\master\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\master\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 92

Thanks!

Just as an example this occurs for the hello-world if the “Hyper-V Host Compute Service” is disabled. If I turn that service on it works.

C:\dev\docker>docker run hello-world
docker: error during connect: Post http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.40/containers/create: 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.
See 'docker run --help'.

+1 - I have same experience with WIn 10 Pro 2004

Read https://docs.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/linux-containers

One detail I didn’t comprehend when I made this thread is that WSL ver 2 actually requires the core functionality of Hyper-V intself, while WSL 1 didn’t. The good news is that you can still disable all mentions of hyper-v in the add/remove features list, but the bad news is that there is still a single service (out of the 7 or so labelled Hyper-V) that you can’t disable for WSL2+docker to still work. Obviously you don’t want to disable hyper-v in bios for this same reason.

Also if you have a secure sign on setup in win10, that uses hyper-v as well, so disabling it completely might break login.