Search code examples
windowsdockerdocker-desktop

Docker Desktop won't switch to Windows containers (on Windows 10)


I have Windows 10 Pro, version 21H1. Virtualization is enabled in BIOS, Hyper-V is running. I've installed Docker Desktop for Windows, as described here. I start the Docker Desktop and all seems to work fine with Linux containers. However, when I switch to Windows containers, I keep getting a crash with this stacktrace:

Docker.Core.DockerException: Required service process has exited at Docker.Engines.DockerDaemonChecker.d__5.MoveNext() in C:\workspaces\PR-16360\src\github.com\docker\pinata\win\src\Docker.Engines\DockerDaemonChecker.cs:line 58 --- 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.WindowsContainersEngine.d__12.MoveNext() in C:\workspaces\PR-16360\src\github.com\docker\pinata\win\src\Docker.Engines\WindowsContainersEngine.cs:line 56 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Docker.Engines.WindowsContainersEngine.d__12.MoveNext() in C:\workspaces\PR-16360\src\github.com\docker\pinata\win\src\Docker.Engines\WindowsContainersEngine.cs:line 65 --- 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.d__0.MoveNext() in C:\workspaces\PR-16360\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.d__5.MoveNext() in C:\workspaces\PR-16360\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.d__5.MoveNext() in C:\workspaces\PR-16360\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 92

In the logs I keep seeing this line:

msg="Error watch events stream: Error response from daemon: open \\.\pipe\docker_engine_windows: The system cannot find the file specified."

I tried various recommended fixes, such as:

cd "C:\Program Files\Docker\Docker"
./DockerCli.exe -SwitchDaemon

Nothing works. Please give me some ideas, I don't know what to do anymore.

Thanks,

Greetings,

Sorin


Solution

  • Finally I noticed that the issue was due to the fact I had another, stray Docker daemon (dockerd.exe) running in the background. After stopping that one, I could switch the Docker Desktop to Windows containers. Also, running this in a command line is now successful:

    docker -H "npipe:////./pipe/docker_engine_windows" ps