380

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
  • Moderator Note - Per a (now former) Community Manager, this question is on-topic. Docker is considered a programming tool, and programming tool installation is on-topic. Please debate the scope of this question on Meta if you want to take any action against this question. Commented Mar 21, 2023 at 12:56

22 Answers 22

658

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 on or off] or, if you have a recent Windows version, in Settings -> [Apps] -> [Optional Features] -> [More 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 is supported only on some versions e.g.:

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

Hyper-V is not supported on cheaper or mobile Windows versions e.g.:

Windows 10 Home; Windows 10 Mobile; Windows 10 Mobile Enterprise, Windows 11 Home.

Sign up to request clarification or add additional context in comments.

20 Comments

@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.
Solution B worked for me after upgrading/switching my SSD via the Samsung SSD Migration Tool.
After switching to SSD from a Hybrid Drive using the Samsung Migration tool, Solution B worked for me as well! Thanks!
|
76

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 Comments

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

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 :-)

Other possible steps (for HP-manufactured system), described in this article

  1. Turn on your PC and hold down the F10 key to boot into BIOS (The specific key will depend on your device’s manufacturer, which is HP).
  2. Use the arrow keys, navigate to the Security tab, select System Security, and press Enter.
  3. Select Virtualization Technology (VTx/VTd), then Enable it.
  4. Press F10 to save your changes and exit the BIOS.

Also HP systems might use the technique shown in this video for HP ProBook:

  1. On launch computer, Press Esc, to enter HP Startup Menu
  2. Keyup or keydown to reach "BIOS Setup" (or press F10)
  3. Right-arrow-key to "Advanced" tab, then arrow-key down to the "System Options" (with Enter)
  4. Arrow down to the "Virtualization technology (Vtx)" checkbox and check the box (with Enter) -- see screenshot below
  5. Return to the Main (with Esc), and arrow down to Save Changes and Exit

screenshot of HP ProBook BIOS Enable Virtualization technology Vtx from https://www.youtube.com/watch?v=jcAMlQm3ErQ&t=105s

2 Comments

I had to do the same. I think this is the hard way but it works for sure
Even after trying all the steps in some other answers on Windows 10, I kept getting the same error message -- Until I tried suggestions this answer. F2 key for Lenovo machines to enter BIOS setup .
19

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.

enter image description here

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

Comments

14

I uninstalled Intel HAXM and VirtualBox, Docker now runs

2 Comments

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?
11

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

Docker now is running

Comments

6

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

1 Comment

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

follow the steps bellow:

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

1 step

step 2

Comments

4

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.

Docker Installation Process

2 Comments

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

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:

enter image description here

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

Comments

3

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.

enter image description here

2 Comments

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
3

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

Comments

2

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

Comments

2

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.

Comments

2

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

Comments

2

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.

Comments

2

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

1 Comment

HP zbook. BIOS was correct/enabled, Virtualization was enabled in task manager, accepted command line solutions didn't work, I kept getting the same message in Docker. This finally did the trick.
2

On AMD machines the BIOS setting you have to change might be called SVM Mode. That was the case for my Gigabyte X570 board.

Setting is found in BIOS at: Advanced mode -> Tweaker -> Advanced CPU Settings -> SVM mode (set to enabled)

AMD-V is the renamed trademark for Secure Virtual Machine Mode (SVM).

Comments

1

Issue for me was solved when I uninstalled Cygwin.

Comments

1

I was also getting this below error Docker Setup - Virtualization error

SOLUTION - Need to enable virtualization for OS (Windows 11 in my case)

  1. Restart the System
  2. Press Esc to see options BIOS options
  3. Select F10
  4. Go to System Configuration tab
  5. Enable the Virtualization Technology

enter image description here

Comments

1

I don't know what these commands exactly do, but it worked for me:

bcdedit /set hypervisorlaunchtype auto

bcdedit /set nx AlwaysOff

shutdown /s

Comments

0

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.