我已经安装了Docker,当我运行GUI时,我得到这个错误:

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

似乎是一个bug,因为Docker在命令行中工作得很好,但我想知道是否有人知道为什么会发生这种情况?

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

GUI有个奇怪的问题。

我的规格:

Windows 10 Pro x64周年纪念版 英特尔酷睿i5-6300HQ @ 2.30GHz


当前回答

以下是我的工作方案,请按照以下步骤进行

以管理员身份打开PowerShell或以管理员身份打开CMD提示符 在PowerShell-> bcdedit /set hypervisorlaunchtype auto . sh中执行该命令 现在重新启动系统并重试。

欢呼。

其他回答

在AMD机器上,你必须更改的BIOS设置可能被称为SVM模式。我的Gigabyte X570板子就是这种情况。

BIOS中的设置如下:高级模式—> tweak—>高级CPU设置—>支持向量机模式(设置为enabled)

AMD-V是安全虚拟机模式(SVM)的重命名商标。

I don't know how this works, and I don't even know what these commands do, I don't know what is hypervisor or what it does that it interferes with Docker, and I don't know what the nx means in the second command which it is apparently turning it off. I had these commands saved on my computer as "Turn VT-x off" (yet another thing that I don't know what it is, I think it's related to Virtualization Technology which I don't know what that does/is either). But nothing else worked for me (including the accepted answer (which I tested all of it's solutions) and other upvoted answers, although I didn't read all of them), except running both of these. It is completely up to you to test these, I do not guarantee any fixes to you, but it worked for me, I put it in here because I thought it might be helpful for someone else like me who also didn't find other answers to be that helpful:

bcdedit /set hypervisorlaunchtype auto

bcdedit /set nx AlwaysOff

shutdown /s

如果问题仍然存在,可能是系统上的Hyper-V损坏了,所以

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

再次启用Hyper-V。重新启动。

在我的情况下,即使我使用了上面提到的所有解决方案,但没有一个对我有效。所以我决定卸载docker,重新安装。

现在在这个过程中,我注意到我在之前的安装中没有勾选使用Windows容器而不是Linux容器(这可以在安装后更改),这就是为什么我得到了上面的问题,解决方案仍然没有解决它。所以确保在运行desktop docker之前检查它,或者通过检查这个选项卸载它并重新安装它。

如果启用了所描述的特性,则问题在于Hyper-V被禁用或Hypervisor代理未运行。

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

以管理员身份打开PowerShell 启用Hyper-V dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All

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

使用

bcdedit /set hypervisorlaunchtype auto

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

解决方案C

如果问题仍然存在,可能是系统上的Hyper-V损坏了,所以

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

注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 SVM feature state, on Intel the VT-x feature state).

注2:

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

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

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

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