Windows 10 Build 1903 Vagrant/VirtualBox Vagrant Up Error
The Problem
After I upgraded Windows 10 to build 1903, I just couldn’t get my lab to start using vagrant up
.
Every time I tried, I would see the VirtualBox icon appear on - then immediately disappear from - the taskbar 3 times, after which I would receive the following error in the console:
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["startvm", "45a55ebd-3932-449e-b364-dbd95354060b", "--type", "gui"]
Stderr: VBoxManage.exe: error: Call to WHvSetupPartition failed: ERROR_SUCCESS (Last=0xc000000d/87) (VERR_NEM_VM_CREATE_FAILED)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component ConsoleWrap, interface IConsole
I tried removing/reinstalling Vagrant and VirtualBox, deleting all the base VMs and the .vagrant
folder,
then eventually, deleted all Boxes saved in the Vagrant folder.
None of which improved the situation.
How I Fixed It
Initially, all of my Googling led me to articles which suggested turning off Hyper-V components in Windows Optional Features.
Except…
Get-WindowsOptionalFeature -Online -FeatureName *hyper* | Format-Table DisplayName, State
DisplayName State
----------- -----
Windows Hypervisor Platform Disabled
Hyper-V Disabled
Hyper-V Platform Disabled
Hyper-V Management Tools Disabled
Hyper-V Module for Windows PowerShell Disabled
Hyper-V Hypervisor Disabled
Hyper-V Services Disabled
Hyper-V GUI Management Tools Disabled
This was a head-scratcher, for sure.
Some gaming, coffee and some more intense Googling later, I ended up going page-by-page through the following article - eventually finding the solution, as below (SIC):
I am running Virtual Box Version 6.0.8 r130520 (Qt5.6.2) on Windows 10 Pro version 1903 (OS Build 18362.116).
I have Windows 7 and a Windows 10 Insider (20H1) virtual machines. Both were running without problems until yesterday when I turned on WIndows Sandbox. After doing so both VM’s gave the above error when I tried to power them up. Turning off Windows Sandbox didn’t solve the problem.
My hunch was that turning on Sandox activated some part of Hyper-V which was not deactivated when Sandbox was turned off so I installed Hyper-V (no Sandbox), rebooted and then immediately uninstalled Hyper-V and rebooted twice. No more error message. Both VM’s working as I expect them to.
TL;DR - What Was the Answer, Steve
- Uninstall Windows Sandbox, from Windows Features
- Reboot
- Install Hyper-V
- Reboot
- Uninstall Hyper-V
- Reboot
- Reboot again
Note: Below console output is edited for privacy and brevity.
vagrant up
Checking dependencies...
- All dependencies already satisfied
Bringing machine 'dc01' up with 'virtualbox' provider...
...
...
...
==> dc01: Machine booted and ready!
That’s what I wanted to see :)