Switch between Hyper-V and VirtualBox on Windows 10

I have many virtual machines in Oracle VirtualBox, and I also use Docker under Hyper-V. Fortunately, I don’t ever need to do both at the same time because Hyper-V (being a level 1 hypervisor) and VirtualBox (a level 2 hypervisor) cannot run at the same time. I guess I could convert all my VirtualBox images to Hyper-V format, but I switch between Mac, Linux and Windows quite a bit and VirtualBox is more portable.

It’s pretty simple, you’ll need to use bcdedit.exe to create a new boot menu option that reboots the Windows 10 host with Hyper-V disabled. Note that the GUID shown in these examples are from my machine, and yours will be different.

Step 1: Open an Administrator command prompt. Use CMD. This does not work in PowerShell.

Step 2: Run the following command: C:\>bcdedit /copy {current} /d “Disable Hyper-V”
You will see the following result: The entry was successfully copied to {<your GUID will appear here>}.
You can use your own description instead of “Disable Hyper-V” if you like.

Step 3: Run the following command: C:\>bcdedit /set {<use your GUID that was displayed in step 2>} hypervisorlaunchtype off
You will see the following result: The operation completed successfully.

Here’s a screen-shot of the process. Your GUID will be different.

Step 4: Reboot the machine while holding down the shift key. You will be presented with a boot option to “Use another operating system”. Select your new “Disable Hyper-V” option. The machine will boot with Hyper-V disabled and VirtualBox will work.

Bonus tip: You can create a batch file to force a quick reboot with the “Disable Hyper-V” boot option selected. Here’s the batch magic:

bcdedit.exe /bootsequence {<use your GUID that was displayed in step 2>}
shutdown.exe /r /t 0 /f