Docker for Windows error: “Hardware assisted virtu

2020-05-10 18:42发布

问题:

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

回答1:

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)

  1. Open PowerShell as administrator and

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

  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.

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.



回答2:

Below is working solution for 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.

cheers.



回答3:

I uninstalled Intel HAXM and VirtualBox, Docker now runs



回答4:

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/



回答5:

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

Docker now is running



回答6:

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


回答7:

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



回答8:

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.



回答9:

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.



回答10:

Issue for me was solved when I uninstalled Cygwin.



回答11:

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



回答12:

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



回答13:

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



回答14:

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!


回答15:

Try these steps

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


回答16:

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



回答17:

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

  1. Restart PC
  2. 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
  3. For intel based systems:
    • press f7 (advanced mode)
    • go to advanced
    • cpa configuration
    • enable virtualization

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