Virtualbox refusing 64bit VMs is something that happens to a lot of people it would seem. A quick search reveals hundreds, thousands, even millions of cries for help on this one…
Usually, two culprits are quickly offered and quite often, they are indeed the offending party:
- Disable HyperV
- Enabling HyperV will make HyperV “grab” the virtualization hardware and it won’t play nice and share it with anyone else. To be frank, this is not a HyperV only issue, most (if not all) virtualization tools will do this: choose one solution for all your VM needs.
- Enable hardware virtualization in BIOS/UEFI
- Yup, usually this is enabled, but sometimes this gets disabled and effectively blocks access to hardware virtualization.
But I am not going to talk about these two because many, many other have done so already. This blog will tell you about a third bandit that might be stealing away your access to hardware virtualization.
But before we do that, let’s explain that last sentence: when you cannot start 64bit VMs, it means that your CPU either does not support 64bit applications (which is possible, but exceedingly rare these days), or that you do not have access to the virtualization hardware in your CPU. In this case, your computer will allow you to run 32bit virtual machines using software only virtualization. But since this is a software approach, it will be quite slow and mostly unusable because of that.
Device Guard
Windows Defender in Windows 10 has something called “Device Guard”, this is an enterprise-level feature that probably only is present in the “Pro” version of windows 10 but I have not tested this hypothesis.
Device Guard will lock down access to hardware devices to run only “trusted” applications. More information can be found here: https://docs.microsoft.com/en-us/windows/device-security/device-guard/device-guard-deployment-guide
I found a knowledge base article on the VMWare site that explained how VMWare workstation is “incompatible” with Device Guard here: https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2146361
In the VMWare KB article, it details how Device Guard refuses access to the virtualization hardware (sometimes causing BSOD). This sounds like something that could definitely get in the way of VirtualBox too, right?
So I followed the steps to disable Device Guard and yes, it did immediately solve my problem. My VirtualBox is humming along nicely now. 🙂
Since things can and do dissapear from the Internet, I’ve copied the KB content below:
To disable Device Guard or Credential Guard:
- Disable the group policy setting that was used to enable Credential Guard.
- On the host operating system, click Start > Run, type gpedit.msc, and click Ok. The Local group Policy Editor opens.
- Go to Local Computer Policy > Computer Configuration > Administrative Templates > System > Device Guard > Turn on Virtualization Based Security.
- Select Disabled.
- Go to Control Panel > Uninstall a Program > Turn Windows features on or off to turn off Hyper-V.
- Select Do not restart.
- Delete the related EFI variables by launching a command prompt on the host machine using an Administrator account and run these commands:mountvol X: /s
copy %WINDIR%\System32\SecConfig.efi X:\EFI\Microsoft\Boot\SecConfig.efi /Y
bcdedit /create {0cb3b571-2f2e-4343-a879-d86a476d7215} /d “DebugTool” /application osloader
bcdedit /set {0cb3b571-2f2e-4343-a879-d86a476d7215} path “\EFI\Microsoft\Boot\SecConfig.efi”
bcdedit /set {bootmgr} bootsequence {0cb3b571-2f2e-4343-a879-d86a476d7215}
bcdedit /set {0cb3b571-2f2e-4343-a879-d86a476d7215} loadoptions DISABLE-LSA-ISO,DISABLE-VBS
bcdedit /set {0cb3b571-2f2e-4343-a879-d86a476d7215} device partition=X:
mountvol X: /d
Note: Ensure X is an unused drive, else change to another drive. - Restart the host.
- Accept the prompt on the boot screen to disable Device Guard or Credential Guard.
Conclusion
Now, to be sure, this is not the ideal situation. Device Guard sounds like a good” thing and simply disabling it is a bit heavy handed. I would assume that both VMWare and Oracle should be able to make their products work with Device Guard, but today this is not the case.
do you know which versions of VMWARE or VIRTUAL BOX are capable to fix this problem ?
Thanks in advance.
As far as I know, none so far. But I must admit I stopped trying a while ago.
Considering Virtualbox is primarily used by consumers who typically do not have hardware with enterprise security features like Device Guard, I would not be surprised that this is something not many people encounter and therefore low on the “need to fix” list. But I can very well be wrong about that.
Of course, the HyperV that comes with Windows 10 works fine with Device Guard so you could use that. But for Linux VMs, HyperV has limitations that make it impossible to use for me.
Holy crap. Thank you SO much for this. I have been going insane for the past few months with this new laptop wondering why Hyper-V would work but VirtualBox wouldn’t. This totally solved my problem. Do you have a beer donation fund?
Glad you found this helpful.
“One is glad to be of service!” (Bonus points if you get the movie reference. 😉 )
I don’t have a beer fund, but I always appreciate it when people “spread the news”. 😀
I did find a small issue – and maybe this is known – the changes that are made in the script run don’t persist through a shutdown.
Thoughts? Email me…
That is strange. On my Surface pro 4, the changes do persist…
I am assuming you mean the EFI settings? Maybe there is something in your computer’s bios that is resetting the device guard?
Hi, Thank you for the guide, but can you explain what do you mean by change X to unused drive? I only have one drive. should I just change X to ‘C’?
No, if you allready have a C drive you have to pick another letter. The letter you pick, let’s use V for example, will be used to mount a logical drive onto. Once you run the command, you;ll have a V drive in addition to your C drive. (But of course, yo can just use the letter X for your logical drive too.)
Through this V drive you’re then able to access the EFI partition which is where your bios lives and make the changes to disable the guard.
So use whatever letter you want to mount the EFI environment, except any drive letter that you already have in use. If you only have a C drive, use any letter except C. In your case, just leave the X as it is in the example commands and you should be fine.
Thank you for leading me into what was the solution for my problems. I had “Windows Defender Application Guard” enabled in “Turn Windows features on or off” and just needed to disable it to get VirtualBox up and running again.
Hey great finding! Searching more information I found that there’s even a tool by Microsoft to completely disable Device Guard virtualization features.
Here’s the link: https://docs.microsoft.com/en-us/windows/security/identity-protection/credential-guard/credential-guard-manage#turn-off-with-hardware-readiness-tool
It’s a powershell script that did the job for me with one command. That way you avoid mistakes.
Great addition!
Thanks for sharing. 🙂