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

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

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

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

GUI有个奇怪的问题。

我的规格:

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


当前回答

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

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

其他回答

我尝试了这里的许多建议,但都没能让它运行起来。最后对我有用的是直接进入BIOS激活它。下面的文章很有帮助: https://www.nextofwindows.com/how-to-enable-configure-and-use-hyper-v-on-windows-10

您可以尝试手动启用Hyper-V,并手动创建和运行Hyper-V虚拟机吗?细节:

https://docs.docker.com/docker-for-windows/#/what-to-know-before-you-install https://msdn.microsoft.com/en-us/virtualization/hyperv_on_windows/quick_start/walkthrough_install

在我的例子中,我必须在BIOS设置中启用虚拟化。

重新启动电脑 当你在“重启”屏幕上按下这些键中的任何一个,你进入windows中的bios设置:esc, f1, f2, f3, f4, f8或delete 对于基于英特尔的系统: 按f7(高级模式) 转到高级 注册会计师的配置 支持虚拟化

在以上所有步骤之后,它终于工作了:-)

注意:如果您的Windows版本支持Hyper-V,您可以在安装过程中选择“使用Hyper-V”直接安装docker。 但是,如果您的Windows没有此支持,请遵循下面的解决方案。


我也遇到过类似的问题。 我已经在bios设置中启用了英特尔虚拟技术。

然后我从这里更新了Linux内核。 这个方法奏效了

我的规格:

Microsoft Windows 10 Home x64单语言 Intel(R) Core(TM) i5-7300 @ 2.50GHz

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