Docker for Windows error: "Hardware assisted virtualization and data execution protection must be enabled in the BIOS"
WindowsDockerWindows Problem Overview
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
Windows Solutions
Solution 1 - Windows
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.
Solution 2 - Windows
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.
Solution 3 - Windows
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 :-)
Solution 4 - Windows
I uninstalled Intel HAXM and VirtualBox, Docker now runs
Solution 5 - Windows
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.
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
Solution 6 - Windows
For me, all I had to do it uninstalling VMware.
Docker now is running
Solution 7 - Windows
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/
Solution 8 - Windows
Try these steps
- Run this command in powershell --->bcdedit /set hypervisorlaunchtype auto
- Restart your PC
- Now try docker --version in cmd line
Solution 9 - Windows
Can you try enabling Hyper-V manually, and potentially creating and running a Hyper-V VM manually? Details:
Solution 10 - Windows
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.
Solution 11 - Windows
In my case I had to uninstall hyper-v, restart pc, and run docker again.
Solution 12 - Windows
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
Solution 13 - Windows
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.
Solution 14 - Windows
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.
Solution 15 - Windows
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.
Solution 16 - Windows
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
Solution 17 - Windows
For me, disabling and then enabling Virtualisation in BIOS helped, strangely.
Solution 18 - Windows
Issue for me was solved when I uninstalled Cygwin.
Solution 19 - Windows
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
Solution 20 - Windows
@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.
Solution 21 - Windows
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!
Solution 22 - Windows
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
Solution 23 - Windows
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.
Solution 24 - Windows
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:
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
Solution 25 - Windows
I had to uninstall VirtualBox to get it to work, such a pity!