366

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
Julien
  • 4,434
  • 3
  • 16
  • 19
  • **Moderator Note** - Per a (now former) Community Manager, [this question is on-topic](https://meta.stackoverflow.com/a/380590/2370483). Docker is considered a programming tool, and programming tool installation is on-topic. Please debate the scope of this question on [Meta](https://meta.stackoverflow.com/) if you want to take any action against this question. – Machavity Mar 21 '23 at 12:56

22 Answers22

635

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.

Silverstorm
  • 15,398
  • 2
  • 38
  • 52
  • 3
    @Julien try to unistall and reinstall Hyper-V see the edit – Silverstorm Oct 13 '16 at 13:49
  • 5
    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! – Kyle Challis Oct 27 '16 at 18:07
  • 24
    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. – Johnny Oshika Nov 15 '16 at 01:27
  • 3
    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. – shahar_m Jan 11 '17 at 09:14
  • @shahar_m if virtualization is disabled obviously Hyper-V cannot run correctly. However virtualization by default usually is enabled on computers with CPU that can support it. Why downvote? – Silverstorm Jan 11 '17 at 20:22
  • @Silverstorm Ok, but it seems that I can't upvote unless the answer is changed.. how about mentioning the virtualization setup in BIOS? or just add another comma :) – shahar_m Jan 12 '17 at 09:21
  • @shahar_m I have update the answer. However downvote should be used for wrong answers not for answers that doesn't report every possible problem. – Silverstorm Jan 12 '17 at 23:18
  • @Kyle: Please write an answer. – Lightness Races in Orbit Mar 12 '17 at 14:05
  • enabling hyper-v from command line and restart the computer worked for me. however, i have to do that every time i restart my computer. i'm working Windows10 on a MacbookPro. Don't know if that makes any difference. – Laurence Oct 24 '17 at 22:09
  • For me "B" did the job. It's interesting because all was OK for months until today, when I converted my windows system disk from MBR to GPT using mbr2gpt.exe and set the BIOS to UEFI. After these changes Docker stopped working with this error. But "B" made it ok again, thanks! – szegheo Jun 21 '18 at 23:22
  • also make sure to use windows containers. – Muhammad Younus Aug 18 '18 at 18:23
  • Frustrating, I meet all the requirements, but it hasn't worked for me, I'll wait for the XXII century. – jcarlosweb Jan 10 '19 at 05:14
  • @jcarlosweb If you meet the requirements and you have tried all methods above, almost certainly you have disabled virtualization in your BIOS. – Silverstorm Jan 11 '19 at 20:16
  • 5
    Solution B worked for me after upgrading/switching my SSD via the Samsung SSD Migration Tool. – plocks Feb 28 '19 at 15:09
  • Problem after restoring PC image to new hardware using Acronis, Solution C worked. – Vicki Apr 01 '19 at 15:29
  • 1
    After switching to SSD from a Hybrid Drive using the Samsung Migration tool, Solution B worked for me as well! Thanks! – TechnoBrat Jul 12 '19 at 17:52
  • On Windows 10 Home the only choice I know of is [Docker Toolbox](https://docs.docker.com/toolbox/toolbox_install_windows/). However it's legacy. – thinwybk Aug 07 '19 at 07:18
  • I had working Hyper-V, then installed VirtualBox, then wanted to go back to Hyper-V. Had to do Solution C - reinstalling Hyper-V. – Govert Nov 26 '19 at 11:41
  • I just want to say thank you! Tried a lot of stuff from Microsoft, Github Issues etc. but solution B) was the key! Thanks big times! – INsanityDesign Apr 16 '20 at 13:38
  • THANK YOU! "> bcdedit /set hypervisorlaunchtype auto" worked for me! – TruncatedCoDr Jul 23 '20 at 18:37
  • Solution B worked for me after I started using BlueStacks (using HyperV as well) – Daric Jun 21 '22 at 09:58
  • I'm on Windows 10 Pro with WSL 2 and Virtualbox already running, doing solution A with no luck, continue with solution B and still no luck, solution C solved the problem, thank you. – Remo Harsono Nov 16 '22 at 19:45
  • Feature name Microsoft-Hyper-V is unknown. – greendino Mar 19 '23 at 10:33
  • @Silverstorm I went with solution C. However, when I re-enabled Hyper-V, Hypervisor was disabled so I couldn't enable it. Strange, because it was enabled before I disabled Hyper-V. – Rod Apr 10 '23 at 20:47
  • solution B worked for me, Hyper-V was enabled – Sebastián Aug 11 '23 at 19:17
  • I run in a problem where my hypervisor is already enabled in my Windows 10 Pro. This one saves me - Solution A – SimplifyJS Aug 12 '23 at 11:59
70

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.

Lavekush Agrawal
  • 6,040
  • 7
  • 52
  • 85
47

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

Nate Anderson
  • 18,334
  • 18
  • 100
  • 135
EdwinN1337
  • 551
  • 5
  • 4
  • I had to do the same. I think this is the hard way but it works for sure – Carloshf Jan 28 '21 at 09:47
  • 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 . – Keshav Aug 13 '23 at 16:03
18

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
Ali Yıldızöz
  • 389
  • 2
  • 12
14

I uninstalled Intel HAXM and VirtualBox, Docker now runs

Marc
  • 442
  • 7
  • 15
  • 19
    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? – Dieter Menne Oct 03 '17 at 18:47
  • 2
    http://www.itwriting.com/blog/9371-how-to-run-android-studio-on-windows-without-disabling-hyper-v.html – Dieter Menne Oct 03 '17 at 18:49
10

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

Docker now is running

Yahya Hussein
  • 8,767
  • 15
  • 58
  • 114
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
General Grievance
  • 4,555
  • 31
  • 31
  • 45
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

Mounir bkr
  • 1,069
  • 6
  • 6
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

sferrazjr
  • 315
  • 2
  • 14
3

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

Community
  • 1
  • 1
DINA TAKLIT
  • 7,074
  • 10
  • 69
  • 74
  • 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. – dazonic Mar 17 '21 at 12:38
  • I have done this just last year with windows 10. – DINA TAKLIT Mar 17 '21 at 13:48
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

Rizwan
  • 3,741
  • 2
  • 25
  • 22
  • 1
    Hyper-V platform is grayed out and says: Virtualization support is disabled in the firmware. – Fanky Feb 04 '22 at 10:23
  • The grayed-out problem mentioned above is solved by checking both Virtualizations in BIOS -> Advanced – Fanky Feb 04 '22 at 10:32
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

EoinKanro
  • 105
  • 1
  • 7
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.

J. Scott Elblein
  • 4,013
  • 15
  • 58
  • 94
H35am
  • 768
  • 2
  • 12
  • 32
2

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

aph5
  • 771
  • 2
  • 7
  • 23
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

MGreenfield
  • 355
  • 1
  • 13
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.

steven
  • 21
  • 1
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

Poly Hamza
  • 149
  • 1
  • 8
  • 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. – Ralpharama Sep 20 '22 at 09:01
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).

Firze
  • 3,939
  • 6
  • 48
  • 61
1

Issue for me was solved when I uninstalled Cygwin.

1

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.

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
bzmind
  • 386
  • 3
  • 19
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