Docker for Windows 错误:“必须在 BIOS 中启用硬件辅助虚拟化和数据执行保护”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/39684974/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 19:40:44  来源:igfitidea点击:

Docker for Windows error: "Hardware assisted virtualization and data execution protection must be enabled in the BIOS"

windowsdocker

提问by Julien

I've installed Docker and I'm getting this error when I run the GUI:

我已经安装了 Docker,但在运行 GUI 时出现此错误:

Hardware assisted virtualization and data execution protection must be enabled in the BIOS

必须在 BIOS 中启用硬件辅助虚拟化和数据执行保护

Seems like a bug since Docker works like a charm from the command line, but I'm wondering if anyone has a clue about why this is happening?

似乎是一个错误,因为 Docker 就像命令行中的魅力一样,但我想知道是否有人知道为什么会发生这种情况?

Before you ask, yes, I've enabled virtualization in the BIOS and the Intel Processor Identification Utility confirms that it's activated. Docker, docker-machine and docker-compose all work from the command line, Virtualbox works, running Docker from a Debian or Ubuntu VM works.

在你问之前,是的,我已经在 BIOS 中启用了虚拟化,并且英特尔处理器识别实用程序确认它已被激活。Docker、docker-machine 和 docker-compose 都可以从命令行运行,Virtualbox 可以运行,从 Debian 或 Ubuntu VM 运行 Docker 可以运行。

There's just this weird issue about the GUI.

GUI 有一个奇怪的问题。

My specs:

我的规格:

  • Windows 10 Pro x64 Anniversary Edition
  • Intel core i5-6300HQ @ 2.30GHz
  • Windows 10 专业版 x64 周年纪念版
  • 英特尔酷睿 i5-6300HQ @ 2.30GHz

回答by Silverstorm

If the features described are enabled the problem is with Hyper-V that is disabled or Hypervisor agent not running

如果启用了所描述的功能,则问题在于 Hyper-V 已禁用或 Hypervisor 代理未运行

SOLUTION A(If Hyper-V is totally disabled or not installed)

解决方案 A(如果 Hyper-V 完全禁用或未安装)

  1. Open PowerShell as administrator and

  2. Enable Hyper-V with

    dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All

  1. 以管理员身份打开 PowerShell 并

  2. 启用 Hyper-V

    dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All

SOLUTION B(If Hyper-V feature is already enabled but doesn't work)

解决方案 B(如果 Hyper-V 功能已启用但不起作用)

Enable Hypervisor with

启用管理程序

bcdedit /set hypervisorlaunchtype auto

Now restart the system and try again.

现在重新启动系统并重试。

SOLUTION C

解决方案 C

If the problem persists probably Hyper-V on your system is corrupted, so

如果问题仍然存在,您的系统上的 Hyper-V 可能已损坏,因此

  1. Go in Control Panel -> [Programs] -> [Windows Features] and completely uncheck all Hyper-V related components. Restart the system.

  2. Enable Hyper-V again. Restart.

  1. 进入控制面板 -> [程序] -> [Windows 功能] 并完全取消选中所有与 Hyper-V 相关的组件。重新启动系统。

  2. 再次启用 Hyper-V。重新开始。

NOTE 1:

注 1

Hyper-V needs hardware virtualization as prerequisite. Make sure your PC supports it, if yes and still won't work there is the possibility your BIOS is not configured correctly and this feature is disabled. In this case, check, enable it and try again. The virtualization features could be reported under different names according the platform used (e.g if you don't see any option that uses virtualization label explicitly, on AMD you have to check SVMfeature state, on Intel the VT-xfeature state).

Hyper-V 需要硬件虚拟化作为先决条件。确保您的 PC 支持它,如果是但仍然无法工作,则可能是您的 BIOS 配置不正确并且此功能被禁用。在这种情况下,请检查、启用它并重试。虚拟化功能可以根据所使用的平台以不同的名称报告(例如,如果您没有看到任何明确使用虚拟化标签的选项,则在 AMD 上您必须检查SVM功能状态,在 Intel 上检查VT-x功能状态)。

NOTE 2:

笔记2:

Hyper-V canbe installed only with some version e.g.:

Hyper-V只能安装在某些版本中,例如:

Windows 10 Enterprise; Windows 10 Professional; Windows 10 Education.

Windows 10 企业版;Windows 10 专业版;Windows 10 教育版。

Hyper-V cannotbe installed on cheaper or mobile Windows versions e.g.:

Hyper-V不能安装在更便宜或移动的 Windows 版本上,例如:

Windows 10 Home; Windows 10 Mobile; Windows 10 Mobile Enterprise.

Windows 10 家庭版;Windows 10 移动版;Windows 10 移动企业版。

回答by Lavekush Agrawal

Below is working solutionfor me, please follow these steps

以下是我的工作解决方案,请按照以下步骤操作

  1. Open PowerShell as administrator or CMD prompt as administrator

  2. Run this command in PowerShell-> bcdedit /set hypervisorlaunchtype auto

  3. Now restart the system and try again.

  1. 以管理员身份打开 PowerShell 或以管理员身份打开 CMD 提示符

  2. 在 PowerShell-> 中运行此命令 bcdedit /set hypervisorlaunchtype auto

  3. 现在重新启动系统并重试。

cheers.

干杯。

回答by Marc

I uninstalled Intel HAXM and VirtualBox, Docker now runs

我卸载了 Intel HAXM 和 VirtualBox,Docker 现在可以运行

回答by Yahya Hussein

For me, all I had to do it uninstalling VMware.

对我来说,我只需要卸载 VMware。

Docker now is running

Docker 现在正在运行

回答by Forrest Murray

Open the task manager and click on the performance tab. If virtualization is disabled, you need to follow the instructions here to enable it: https://blogs.technet.microsoft.com/canitpro/2015/09/08/step-by-step-enabling-hyper-v-for-use-on-windows-10/

打开任务管理器并单击性能选项卡。如果禁用虚拟化,您需要按照此处的说明启用它:https: //blogs.technet.microsoft.com/canitpro/2015/09/08/step-by-step-enabling-hyper-v-for-在 windows-10/ 上使用

回答by aph5

In my case I had to uninstall hyper-v, restart pc, and run docker again.

就我而言,我必须卸载 hyper-v,重新启动电脑,然后再次运行 docker。

回答by H35am

Try this in PowerShell(admin enabled):

在 PowerShell 中试试这个(启用管理员):

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

This will install HyperVisor without management tools, and then you can run Docker after this.

这将在没有管理工具的情况下安装 HyperVisor,然后您可以在此之后运行 Docker。

回答by steven

I have tried many suggestions above but docker keeps complaining about hardware assisted virtualization error. Virtualization is enabled in BIOS, and also Hyper-V is installed and enabled. After a few try and errors, I eventually downloaded coreinfo tool and found out that Hypervisor was not actually enabled. Using ISE (64 bit) as admin and run command from above Solution B and that enables Hypervisor successfully (checked via coreinfo -v again). After restart, docker is now running successfully.

我已经尝试了很多上面的建议,但是 docker 一直在抱怨硬件辅助虚拟化错误。在 BIOS 中启用了虚拟化,并且还安装并启用了 Hyper-V。经过几次尝试和错误后,我最终下载了 coreinfo 工具,发现实际上并未启用 Hypervisor。使用 ISE(64 位)作为管理员并从上面的解决方案 B 运行命令并成功启用管理程序(再次通过 coreinfo -v 检查)。重启后,docker现在运行成功。

回答by Ralph

@Silverstorm

@银色风暴

I had Hyperv installed and virtualization enabled in my BIOS.

我在 BIOS 中安装了 Hyperv 并启用了虚拟化。

But SOLUTION A didn't work for me.

但是解决方案 A 对我不起作用。

However, SOLUTION B worked like a charm.

然而,解决方案 B 就像一个魅力。

SOLUTION B (If Hyper-V feature is already enabled but doesn't work)

解决方案 B(如果 Hyper-V 功能已启用但不起作用)

Enable Hypervisor with

启用管理程序

bcdedit /set hypervisorlaunchtype auto Now restart the system and try again.

bcdedit /set hypervisorlaunchtype auto 现在重新启动系统并重试。