服务无法启动虚拟机'DockerDesktopVM',因为其中一个Hyper-V组件未运行。

19
我有一个安装了 Window Server 2016/2019 的虚拟机(Openstack),在 Hyper-V 上已经成功安装。但是无法启动 MobyLinuxVM。
通过 PowerShell,在虚拟机上已经启用了 ExposeVirtualizationExtensions。
Docker.Core.DockerException:
Docker.Core.Backend.BackendDestroyException:
Unable to start Hyper-V VM: 'DockerDesktopVM' failed to start.

Failed to start the virtual machine 'DockerDesktopVM' because one of the Hyper-V components is not running.

'DockerDesktopVM' failed to start. (Virtual machine ID 96BDA1DB-4163-4FA5-BEF2-62F1BEC1697E)

The Virtual Machine Management Service failed to start the virtual machine 'DockerDesktopVM' because one of the Hyper-V components is not running (Virtual machine ID 96BDA1DB-4163-4FA5-BEF2-62F1BEC1697E).
at Start-MobyLinuxVM, <No file>: line 688
at <ScriptBlock>, <No file>: line 811
   at Docker.Backend.ContainerEngine.Linux.Start(Settings settings, String daemonOptions, Credential credential)
   at Docker.Backend.BackendNamedPipeServer.<Run>b__8_2(Object[] args)
   at Docker.Core.Pipe.NamedPipeServer.<>c__DisplayClass9_0.<Register>b__0(Object[] parameters)
   at Docker.Core.Pipe.NamedPipeServer.RunAction(String action, Object[] parameters)

  System.Management.Automation.RuntimeException:
  Unable to start Hyper-V VM: 'DockerDesktopVM' failed to start.

Failed to start the virtual machine 'DockerDesktopVM' because one of the Hyper-V components is not running.

  'DockerDesktopVM' failed to start. (Virtual machine ID 96BDA1DB-4163-4FA5-BEF2-62F1BEC1697E)

The Virtual Machine Management Service failed to start the virtual machine 'DockerDesktopVM' because one of the Hyper-V components is not running (Virtual machine ID 96BDA1DB-4163-4FA5-BEF2-62F1BEC1697E).
  at Start-MobyLinuxVM, <No file>: line 688
  at <ScriptBlock>, <No file>: line 811
     at Docker.Backend.ContainerEngine.Linux.DoStart(Settings settings, String daemonOptions, Credential credential)
     at Docker.Backend.ContainerEngine.Linux.Start(Settings settings, String daemonOptions, Credential credential)

     Microsoft.HyperV.PowerShell.VirtualizationException:
     'DockerDesktopVM' failed to start.

Failed to start the virtual machine 'DockerDesktopVM' because one of the Hyper-V components is not running.

     'DockerDesktopVM' failed to start. (Virtual machine ID 96BDA1DB-4163-4FA5-BEF2-62F1BEC1697E)

The Virtual Machine Management Service failed to start the virtual machine 'DockerDesktopVM' because one of the Hyper-V components is not running (Virtual machine ID 96BDA1DB-4163-4FA5-BEF2-62F1BEC1697E).

         Microsoft.Virtualization.Client.Management.VirtualizationOperationFailedException:
         'DockerDesktopVM' failed to start.

Failed to start the virtual machine 'DockerDesktopVM' because one of the Hyper-V components is not running.
            at Microsoft.Virtualization.Client.Management.View.EndMethodReturnInternal(IVMTask task, VirtualizationOperation operation, Boolean affectedElementExpected)
            at Microsoft.Virtualization.Client.Management.VMComputerSystemBaseView.EndSetState(IVMTask setStateTask)
            at Microsoft.HyperV.PowerShell.ExtensionMethods.OperationWatcherExtensions.<>c__DisplayClass4_0`1.<ConvertActionToFunction>b__0(T x)
            at Microsoft.HyperV.PowerShell.ExtensionMethods.OperationWatcherExtensions.PerformOperationWithReturn[T](IOperationWatcher watcher, Func`1 startTaskMethod, Func`2 endTaskMethod, String taskDescription, VirtualizationObject targetObject)
            at Microsoft.HyperV.PowerShell.VirtualMachine.ChangeState(VirtualMachineAction action, IOperationWatcher operationWatcher)
            at Microsoft.HyperV.PowerShell.Commands.StartVM.ProcessOneOperand(VirtualMachine vm, IOperationWatcher operationWatcher)
            at Microsoft.HyperV.PowerShell.Commands.VirtualizationCmdlet`1.ProcessOperands(IList`1 operands, IOperationWatcher operationWatcher)

   at Docker.Core.Pipe.NamedPipeClient.<TrySendAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Docker.Core.Pipe.NamedPipeClient.Send(String action, Object[] parameters)
   at Docker.Actions.DoStart(SynchronizationContext syncCtx, Boolean showWelcomeWindow, Boolean withNotifications)
   at Docker.Actions.<>c__DisplayClass26_0.<StartAsync>b__0()
   at Docker.ApiServices.TaskQueuing.TaskQueue.<>c__DisplayClass18_0.<.ctor>b__1()

你是如何解决这个问题的? - Loran
@Loran 如果你有实际的硬件(不是虚拟机),那么你可以在系统BIOS中启用VT-X虚拟化。如果你有任何云虚拟机,那么只要该云提供商允许你使用此选项,就可以使用它。由于这是与Linux相关的容器,因此我们需要Hyper-V,在我的流水线中我使用了两个虚拟机。一个Windows虚拟机用于实际代码构建,然后将这些文件存储,并在Linux虚拟机中构建Docker镜像。如果你只需要Windows容器,则不需要HyperV。 - Sounak Saha
3个回答

14

解决方法

  1. 在Windows管理工具下打开Hyper-V管理器
  2. 注意DockerDesktopVM不在虚拟机下运行
  3. 在“操作”选项卡下,点击“停止服务”,然后再点击“启动服务”
  4. 重新启动Docker Desktop

这个方法对我有效。


3

我曾遇到同样的问题,按照以下步骤解决了此问题。 如果您能够运行Windows容器,则问题出在Hyper-V上。

  1. 通过以下方式在虚拟机上启用超级: enter image description here
  2. 我们还必须在硬件虚拟化上启用它。这可以通过(IT团队可以帮助,因为这应该在CPU级别完成) enter image description here

0

请确保您的BIOS中启用了VT-X虚拟化功能


这是一个OpenStack虚拟机,因此没有设置BIOS的选项。 - Sounak Saha

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接