简体   繁体   中英

Cannot start docker on windows 10 pro?

Problem:

When I try to start docker desktop it leaves me this error.

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".

This is the output when I issue docker version command on the terminal.

Client: Docker Engine - Community
 Version:           18.09.2
 API version:       1.39
 Go version:        go1.10.8
 Git commit:        6247962
 Built:             Sun Feb 10 04:12:31 2019
 OS/Arch:           windows/amd64
 Experimental:      false
error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.39/version: 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. 

This working without giving any error when in windows containers. But when I change it to Linux containers this happens. I tried a lot to find a solution to this problem. But I was unable to find a solution. Can someone help me to solve this problem? Thank you.

You may want to check from HyperV console to ensure there is a vnet called DockerNAT.

在此处输入图片说明

tray icon to see if there is some log related to why the vnet cannot be created

在此处输入图片说明

Here is what works for me - open Hyper-V manager and from 'Actions' panel on the right click 'Stop Service' and confirm prompt. Then, Install Docker desktop which will restart your hyper-v and create DockerNat. To check click 'Virtual Switch Manager' from 'Actions' panel and you should see it on the Left.

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 docker was working again

Hope this solves your issue. Enjoy!

I just ran into this issue today my fix was.

  1. bcdedit /set hypervisorlaunchtype auto
  2. Windows features > Hyper-V off
  3. Windows features > Windows hypervisor platform off
  4. Windows features > Virtual machine platform on
  5. Windows features > Windows Subsystem for Linux on
  6. Reboot
  7. CMD as admin > netsh winsock reset
  8. Reboot
  9. Docker Desktop finally connected and everything worked

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM