1

Why do I keep getting this error. It has been days now googling and trying to find a solution for this issue. I have no clue how to resolve this can someone please help me understand how to fix this ?

docker version:

Version 2.0.0.3 (31259) Channel: stable Build: 8858db3

Unable to create: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Hyper-V was unable to find a virtual switch with name "DockerNAT".
at New-Switch, <No file>: line 121
at <ScriptBlock>, <No file>: line 411
   at Docker.Core.Pipe.NamedPipeClient.Send(String action, Object[] parameters) in C:\workspaces\stable-18.09.x\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:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\src\Docker.Windows\Actions.cs:line 92
   at Docker.Actions.<>c__DisplayClass19_0.<Start>b__0() in C:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\src\Docker.Windows\Actions.cs:line 74
   at Docker.WPF.TaskQueue.<>c__DisplayClass19_0.<.ctor>b__1() in C:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\src\Docker.WPF\TaskQueue.cs:line 59
Illep
  • 16,375
  • 46
  • 171
  • 302
  • Possible duplicate of [Docker : Hyper-V was unable to find a virtual switch with name "DockerNAT"](https://stackoverflow.com/questions/54762593/docker-hyper-v-was-unable-to-find-a-virtual-switch-with-name-dockernat) – Waqas Ahmed Sep 08 '19 at 12:34

3 Answers3

1

I also spent days trying to install and get Docker working correctly on Windows. It turned out that the company's antivirus had rules to block the creation of virtual switches. Also, uninstalling Docker left things behind which prevents a fresh install. Here is what I suggest doing:

  • Uninstall Docker.
  • Disable antivirus.
  • Make sure '%userprofile%.docker' does not exist.
  • Enable 'Container' and 'Hyper-V' in 'Turn Windows features on or off'.
  • Install Docker for Windows.
RobertBaron
  • 2,817
  • 1
  • 12
  • 19
0

After uninstalling and installing multiple times, despite 'Hyper-V' is enabled, I kept getting this error.

Running the MOFCOMP command and a reboot fixed this problem for me.

Running this command: (Command Prompt as administrator)

MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof

Then restart.

0

I had the same issue, here is what worked for me:

  • Turn off the Hyper-V setting in Control Panel->Programs and Features ->"Turn Windows features on or off"
  • Restart computer
  • After computer has been restarted, your existing docker instance will detect that your Hyper-V setting is turned off and will ask you if you want to allow docker to enable the Hyper-V feature
  • Click "Yes" to allow docker to enable the Hyper-V feature on your machine
  • From there allow docker to start and do its thing

After doing these steps the error went away and my docker instance was working again.

Hope this solves your issue. Enjoy!

Aaron
  • 23
  • 2