简体   繁体   中英

Unable to start Docker in Windows 10 - Hyper-V error is thrown

I get the below error while starting of docker in Windows 10. Anyone can guide me to install docker correctly?

Unable to create: The running command stopped because the preference variable 
"ErrorActionPreference" or common parameter is set to Stop: Hyper-V encountered
an error trying to access an object on computer 'XXXX' because the object was not 
found. The object might have been deleted, or you might not have permission to 
perform the task. Verify that the Virtual Machine Management service on the 
computer is running. If the service is running, try to perform the task again by 
using Run as Administrator.
at New-MobyLinuxVM, <No file>: line 242
at <ScriptBlock>, <No file>: line 362
   at Docker.Backend.HyperV.RunScript(String action, Dictionary`2 parameters)
   at Docker.Backend.ContainerEngine.Linux.Start(Settings settings)
   at Docker.Core.Pipe.NamedPipeServer.<>c__DisplayClass8_0.<Register>b__0(Object[] parameters)
   at Docker.Core.Pipe.NamedPipeServer.RunAction(String action, Object[] parameters)

Versions

OS : Windows 10 Enterprise 
Version : 1607 
OS Build : 14393.576
Docker Version : 1.12.3 (Stable)

Run “MOFCOMP %SYSTEMROOT%\\System32\\WindowsVirtualization.V2.mof” from command prompt in admin mode. No need to restart machine as well after this execution, it worked for me.

I have also faced this same issue. I have solved it by removing all MobyLinuxVM virtual machines. Following are its steps.

  1. Open Hyper-V Manager
  2. Select all MobyLinuxVM from Virtual Machines.
  3. Right click and delete all of these virtual machines.
  4. Restart docker.

These steps has solved this issue on my system.

Assuming you are trying to run a Windows container:

Right click on the Docker system tray icon, then select “Switch to Windows Containers”.

It will eventually have you reboot the system, but will no longer attempt to run the MobyLinuxVm as mentioned in your error message.

If it helps anyone, I am on Apple hardware (MacOS) running a Windows 10 VM via Parallels. I also made sure that under my parallel settings > Processors and Memory > Advanced, I had Hypervision applications enabled.

This issue is very similar to this the another question Docker - The computer 'WINDOWS10-ON-SE' could not be resolved

See my answer at https://stackoverflow.com/a/45099242/279272

I was also facing the same issue but it was random in nature, I found it is due to some inaccessibility of network card by the docker start script. This inaccessibility further blocks the start up process of docker.

I found one hack and it is working fine on my windows machine

Hack

Open C:\\Program Files\\Docker\\Docker\\resources\\mobylinux.ps1 with any editor in admin mode. Find following code (around line 164)

$networkAdapter | Remove-NetIPAddress -Confirm:$false -ea SilentlyContinue

$networkAdapter | Set-NetIPInterface -Dhcp Disabled -ea SilentlyContinue

$networkAdapter | New-NetIPAddress -AddressFamily IPv4 -IPAddress $switchAddress -PrefixLength ($SwitchSubnetMaskSize) -ea Stop | Out-Null

Add a return after line 165 in a new line like below and save the file.

$networkAdapter | Remove-NetIPAddress -Confirm:$false -ea SilentlyContinue

$networkAdapter | Set-NetIPInterface -Dhcp Disabled -ea SilentlyContinue

return

$networkAdapter | New-NetIPAddress -AddressFamily IPv4 -IPAddress $switchAddress -PrefixLength ($SwitchSubnetMaskSize) -ea Stop | Out-Null

Now restart docker and after restart completion execute following commands in dos admin mode to setup the network card manually

netsh interface ipv4 set address name="vEthernet (DockerNAT)" static 10.0.75.1 255.255.255.0

You have to run this command everytime whenever you are doing system restart and docker completes start process (due to any reason). TIP : create a batch file of this command and save somewhere handy.

Note: The ps hack would get undone by any docker update. so be aware...

to install docker, BIOS-level Hardware Virtualization support is required. so you can do the following..

-Ensure that hardware virtualization support is turned on in the BIOS settings in your mother board settings when you start your computer, under (system security => virtualization technology VTX => enable it) then Save the BIOS settings and boot up the machine normally. then enable hyper v if it was not enabled by running this command in your powershell as an admin:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All

对我来说,将 Windows 10 专业版更新到 1809 版解决了这个问题

On windows 10, I fixed the issue by executing the steps below:

French Windows version:

  1. Close Docker Desktop
  2. Go to "Contrôle des applications et du navigateur"
  3. Click on "Paramètre d'exploit protection" under "Exploit protection"
  4. Go to the tab "Paramètres du programme"
  5. Search "C:\\Windows\\System32\\vmcompute.exe" or "vmcompute.exe"
  6. Click on update and untick all the checkboxes related to all the configurations and then apply
  7. Run Docker Desktop again

English Windows version:

  1. Close Docker Desktop
  2. Go to "App & browser control"
  3. Click on "Exploit protection settings" under "Exploit protection"
  4. Go to the tab "Program settings"
  5. Search "C:\\Windows\\System32\\vmcompute.exe" or "vmcompute.exe"
  6. Click on update and untick all the checkboxes related to all the configurations and then apply
  7. Run Docker Desktop again

Hope this will help someone else.

当您启动 Windows 并启动 docker 时,只需右键单击右下栏中的 docker 并切换到 Windows 容器

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