ChatGPT解决这个技术问题 Extra ChatGPT

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

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

Hardware assisted virtualization and data execution protection must be enabled in the 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?

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.

There's just this weird issue about the GUI.

My specs:

Windows 10 Pro x64 Anniversary Edition

Intel core i5-6300HQ @ 2.30GHz


S
Silverstorm

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

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

Open PowerShell as administrator and Enable Hyper-V with dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All

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

Enable Hypervisor with

bcdedit /set hypervisorlaunchtype auto

Now restart the system and try again.

SOLUTION C

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

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

NOTE 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).

NOTE 2:

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

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

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

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


@Julien try to unistall and reinstall Hyper-V see the edit
In case anyone else has a similar issue, I had recently installed Bash on Ubuntu on Windows (which uses Hyper-V). After I uninstalled it and then followed the steps in this answer, Docker worked for me!
I'm running Windows 10 in Bootcamp on MacBook Pro. I had the same problem. I first tried dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All but didn't seem to solve it, so then I tried bcdedit /set hypervisorlaunchtype auto and Docker is now running for me.
This wasn't the issue in my case, it was the fact that the virtuallization was disabled in the BIOS. I had to enable the virtualization feature in the security tab in the BIOS, which caused docker to work immidiately afterwards.
Solution B worked for me after upgrading/switching my SSD via the Samsung SSD Migration Tool.
L
Lavekush Agrawal

Below is working solution for me, please follow these steps

Open PowerShell as administrator or CMD prompt as administrator Run this command in PowerShell-> bcdedit /set hypervisorlaunchtype auto Now restart the system and try again.

cheers.


Worked for me, without uninstalling Intel HAXM, but now vmware no more works :(
Thanks. This solution worked for Windows 10 Home.
after an hour of trying everything (even Windows documentation) this worked for me on windows 10 home as well.
E
EdwinN1337

In my case I had to enable virtualization in the BIOS setting.

Restart PC While you are on the 'restart' screen press any of these keys and you enter the bios settings in windows: esc, f1, f2, f3, f4, f8 or delete For intel based systems: press f7 (advanced mode) go to advanced cpa configuration enable virtualization

And after all above steps, it finally works :-)


I had to do the same. I think this is the hard way but it works for sure
you sir, are a hero! worked like a charm :)
This is the one that worked for me. Many thanks.
M
Marc

I uninstalled Intel HAXM and VirtualBox, Docker now runs


I had installed HAXM for Android Development, and had to disable HyperV. Removing it restored Docker for Windows. Now if anyone can tell me how to get the Android Emulator and Docker to coexist?
A
Ali Yıldızöz

Note: If your version of Windows supports Hyper-V, you can install docker directly by selecting Use Hyper-V during installation. However, if your Windows does not have this support, follow the solution below.

I had a similar problem. I have enabled Intel Virtual Technology in the bios settings.

https://i.stack.imgur.com/GSdk8.jpg

Then I updated the Linux kernel from here. and it worked

My specs:

Microsoft Windows 10 Home x64 Single Language

Intel(R) Core(TM) i5-7300 @ 2.50GHz


Y
Yahya Hussein

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

Docker now is running


F
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/


G
General Grievance

Try these steps

Run this command in powershell bcdedit /set hypervisorlaunchtype auto Restart your PC Now try docker --version in cmd line


seems to work and I can still use VMWare so thank you
f
friism

Can you try enabling Hyper-V manually, and potentially creating and running a Hyper-V VM manually? Details:

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


For me it didn't work even when Hyper-V was enabled and BIOS configured; I was still getting that error. Disabling Hyper-V + restarting Windows and then enabling it back on solved the problem for me.
a
aph5

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


J
J. Scott Elblein

Try this in PowerShell(admin enabled):

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

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


M
MGreenfield

I also use vagrant. It appears I can only use 1 thing at a time. Uninstalling vagrant/virtualBox allowed me to run docker and vise versa


s
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.


C
Community

In my case even though I used all the solutions mentioned above but nothing worked for me. So I decided to uninstall docker and install it again.

Now in the process, I have noticed that I did not check Use Windows containers instead of Linux containers (this can be changed after installation) in my previous installation, and that is why I got the problem above and the solutions still did not fix it. So ensure to check it before you run desktop docker or uninstall it and install it again by checking this option.

https://i.stack.imgur.com/RbRmY.png


This option no longer exists when installing Docker Desktop. I’ve tried all solutions listed here, nothing is working, even though Task Manager > Performance is showing that virtualisation is enabled.
I have done this just last year with windows 10.
R
Rizwan

Enable the Hyper-V role through Settings Right click on the Windows button/Icon and select ‘Apps and Features’.

1- Select Programs and Features on the right under related settings.

2- Select Turn Windows Features on or off.

2- Select Hyper-V and click OK.

https://i.stack.imgur.com/gzal5.png


Hyper-V platform is grayed out and says: Virtualization support is disabled in the firmware.
The grayed-out problem mentioned above is solved by checking both Virtualizations in BIOS -> Advanced
p
piyush gautam

If solution above does not work, then Go to command prompt and type systeminfo. check Hyper-V Requirements section. If all listed Hyper-V requirements have a value of Yes, your system can run the Hyper-V role. In my case virtualization enable in Firmware was NO. So, I did enabled in system bios by making Virtualization Technology enabled in my HP laptop. Please visit this link to enable it: https://2nwiki.2n.cz/pages/viewpage.action?pageId=75202968


S
Sergey K.

For me, disabling and then enabling Virtualisation in BIOS helped, strangely.


Not an exact science but strangely enough this did it for me as well
E
EoinKanro

It helped me:

Disable components Virtual Machine Platform and Windows Subsystem for Linux

Restart

Enable components

Restart

I think my problem was related to beta version of WSL2. I tried to install android subsystem. But I have deleted it some time ago. So, there was only beta WSL2 left


I
Inez Van Laer

Issue for me was solved when I uninstalled Cygwin.


p
phunder

I tried many of the suggestions here, but did not manage to get it running. What worked for me in the end was to go straight in to the BIOS to activate it. The following article was of great help: https://www.nextofwindows.com/how-to-enable-configure-and-use-hyper-v-on-windows-10


R
Randika

@Silverstorm

I had Hyperv installed and virtualization enabled in my BIOS.

But SOLUTION A didn't work for me.

However, SOLUTION B worked like a charm.

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

Enable Hypervisor with

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


P
Peter Wen

Besides the original answer, I have done the following:

Disable Hyper-V in Windows Features

Turning virtualization off and on in BIOS

Log back in windows, enabled Hyper-V. I was prompted there are updates for Hyper-V and I did the update. Restart when prompted.

It worked!


P
Poly Hamza

If everything is fine with BIOS option I just forced disabling and enabling all HyperV features and this solved my issue --cmd Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All --restart Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V –All


T
Tomasz Dudkowski

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

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

Enable Hyper-V again. Restart.


s
sferrazjr

I had the same issue after installing VMWare, I uninstalled it but this didn't fix the issue.

Solution for me: in "Turn windows features on or off" I turned off:

hyper-v

containers

windows subsystem for linux

then restart

After the restart I got this message from docker:

https://i.stack.imgur.com/CQXrn.png

I ran the ran the command as said in the message

Enable-WindowsOptionalFeature -Online -FeatureName $("VirtualMachinePlatform", "Microsoft-Windows-Subsystem-Linux")

Then restart and voilà, Docker was back with WSL2


M
Mounir bkr

follow the steps bellow:

go to: windows setting => Update & Security => Recovery => Advanced Startup and click on : Restart Now. Troubleshoot => Advanced Option => UEFI Firmware => Restart. go to Bios => configuration => Virtualization technology => enable it. save change and it will works.

https://i.stack.imgur.com/ArOfU.png

https://i.stack.imgur.com/z3q1h.png


M
Mohamed

I had to uninstall VirtualBox to get it to work, such a pity!


关注公众号,不定期副业成功案例分享
Follow WeChat

Success story sharing

Want to stay one step ahead of the latest teleworks?

Subscribe Now