简体   繁体   English

无法在 Windows 10 中启动 Docker - 抛出 Hyper-V 错误

[英]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?在 Windows 10 中启动 docker 时出现以下错误。谁能指导我正确安装 docker?

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.在管理员模式下从命令提示符运行“MOFCOMP %SYSTEMROOT%\\System32\\WindowsVirtualization.V2.mof” 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.我已经通过删除所有 MobyLinuxVM 虚拟机解决了这个问题。 Following are its steps.以下是它的步骤。

  1. Open Hyper-V Manager打开 Hyper-V 管理器
  2. Select all MobyLinuxVM from Virtual Machines.从虚拟机中选择所有 MobyLinuxVM。
  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:假设您正在尝试运行 Windows 容器:

Right click on the Docker system tray icon, then select “Switch to Windows Containers”.右键单击 Docker 系统托盘图标,然后选择“切换到 Windows 容器”。

It will eventually have you reboot the system, but will no longer attempt to run the MobyLinuxVm as mentioned in your error message.它最终会让您重新启动系统,但不会再尝试运行错误消息中提到的 MobyLinuxVm。

If it helps anyone, I am on Apple hardware (MacOS) running a Windows 10 VM via Parallels.如果它对任何人有帮助,我将使用通过 Parallels 运行 Windows 10 VM 的 Apple 硬件 (MacOS)。 I also made sure that under my parallel settings > Processors and Memory > Advanced, I had Hypervision applications enabled.我还确保在我的并行设置 > 处理器和内存 > 高级下,我启用了 Hypervision 应用程序。

This issue is very similar to this the another question Docker - The computer 'WINDOWS10-ON-SE' could not be resolved这个问题与Docker的另一个问题非常相似- The computer 'WINDOWS10-ON-SE' could not beresolution

See my answer at https://stackoverflow.com/a/45099242/279272请参阅我在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.我也面临同样的问题,但它本质上是随机的,我发现这是由于 docker start 脚本无法访问网卡。 This inaccessibility further blocks the start up process of docker.这种不可访问性进一步阻止了 docker 的启动过程。

I found one hack and it is working fine on my windows machine我发现了一个 hack,它在我的 Windows 机器上运行良好

Hack黑客

Open C:\\Program Files\\Docker\\Docker\\resources\\mobylinux.ps1 with any editor in admin mode.在管理模式下使用任何编辑器打开C:\\Program Files\\Docker\\Docker\\resources\\mobylinux.ps1 Find following code (around line 164)找到以下代码(大约第 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.在如下所示的新行中在第 165 行之后添加一个return并保存文件。

$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现在重启docker,重启完成后在dos admin模式下执行以下命令手动设置网卡

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).每当您进行系统重启并且 docker 完成启动过程(由于任何原因)时,您都必须运行此命令。 TIP : create a batch file of this command and save somewhere handy.提示:创建此命令的批处理文件并保存在方便的地方。

Note: The ps hack would get undone by any docker update.注意:任何 docker 更新都会撤销 ps hack。 so be aware...所以要注意...

to install docker, BIOS-level Hardware Virtualization support is required.要安装 docker,需要 BIOS 级别的硬件虚拟化支持。 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. - 确保在启动计算机时在主板设置中的 BIOS 设置中打开硬件虚拟化支持,在(系统安全 => 虚拟化技术 VTX => 启用它)下,然后保存 BIOS 设置并正常启动机器。 then enable hyper v if it was not enabled by running this command in your powershell as an admin:然后通过在您的 powershell 中以管理员身份运行此命令来启用 hyper v(如果它未启用):

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

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

On windows 10, I fixed the issue by executing the steps below:在 Windows 10 上,我通过执行以下步骤解决了该问题:

French Windows version:法语 Windows 版本:

  1. Close Docker Desktop关闭 Docker 桌面
  2. Go to "Contrôle des applications et du navigateur"转到“控制应用程序和导航”
  3. Click on "Paramètre d'exploit protection" under "Exploit protection"点击“Exploit protection”下的“Paramètre d'exploit protection”
  4. Go to the tab "Paramètres du programme"转到选项卡“Paramètres du program”
  5. Search "C:\\Windows\\System32\\vmcompute.exe" or "vmcompute.exe"搜索“C:\\Windows\\System32\\vmcompute.exe”或“vmcompute.exe”
  6. Click on update and untick all the checkboxes related to all the configurations and then apply单击更新并取消选中与所有配置相关的所有复选框,然后应用
  7. Run Docker Desktop again再次运行 Docker 桌面

English Windows version:英文视窗版本:

  1. Close Docker Desktop关闭 Docker 桌面
  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"搜索“C:\\Windows\\System32\\vmcompute.exe”或“vmcompute.exe”
  6. Click on update and untick all the checkboxes related to all the configurations and then apply单击更新并取消选中与所有配置相关的所有复选框,然后应用
  7. Run Docker Desktop again再次运行 Docker 桌面

Hope this will help someone else.希望这会帮助别人。

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Windows 10 上 Docker-Desktop 的 Hyper-V 和数据执行的错误消息无法启动 - Error Message for Hyper-V and Data Execution for Docker-Desktop on Windows 10 Failing to Start 无法启动 Hyper-V VM:“DockerDesktopVM”无法在 windows 10 机器中启动 - Unable to start Hyper-V VM: 'DockerDesktopVM' failed to start in windows 10 machine Docker 镜像和容器位置与 Windows 10 使用 hyper-v - Docker images and containers location with Windows 10 using hyper-v 带有VBox悖论的Windows 10 Docker。 除非禁用Hyper-V,否则Virtual Box不会运行,除非启用Hyper-V,否则Docker无法启动 - Windows 10 Docker with VBox paradox. Virtual Box wouldn't run unless Hyper-V is disabled and Docker wouldn't start unless Hyper-V is enabled 无法使用 windows 中的 Docker 启用 Hyper-V 服务 10 - Cannot enable Hyper-V service with Docker in windows 10 Docker 引擎 Hyper-V 代理 - Windows 10 不工作 - Docker Engine Hyper-V Proxy - Windows 10 Not working 在 Windows 中启动 docker 时出现 Hyper-V 错误 - Hyper-V error when starting docker in windows Windows中的docker需要启用Hyper-V吗? - docker in windows need Hyper-V enabled? 在Windows 10(启用Hyper-V)和Linux OS上安装docker有什么区别? - What's the difference between installing docker on Windows 10(Hyper-V enabled) and Linux OS? 从 Windows 10 PgAdmin 连接安装在 Hyper-V Ubuntu 中的 docker 中的 PostgreSQL - Connecting PostgreSQL installed in docker inside Hyper-V Ubuntu from Windows 10 PgAdmin
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM