Sunday, August 2, 2020

Fixes for Vagrant/Virtualbox errors due to latest Windows 10 updates

INTRO


1- Failed to create the host-Only adapter

A Host-Only adapter can usually be created from virtualbox GUI (see below) or from VboxManage.exe call as admin (manually or from an external app).
Note: I could still do it from vagrant before.

Image for post
Create a Host Only adaptor from the vbox GUI
Stderr: 0%...
Progress state: E_FAIL
VBoxManage.exe: error: Failed to create the host-only adapter
VBoxManage.exe: error: Operation canceled by the user
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component VirtualBoxWrap, interface IVirtualBox
VBoxManageHostonly.cpp
Image for post

Workaround

You will have to temporarily change the user account Control setting. That way the vagrant background task won’t hang then crash as windows won’t show the confirmation pop up.

Image for post
Disable notification when apps make changes to the system

2- VT-x is not available

After solving the earlier issue, I tried to run the `vagrant up` again but here comes another error message in my output.

... The command and stderr is shown below.
Command: ["startvm", "6cef1e57-d4d3-4633-a122-1be55e990eec", "--type", "headless"]

Stderr: VBoxManage.exe: error: VMMR0_DO_NEM_INIT_VM failed: VERR_NEM_MISSING_KERNEL_API_2.
VBoxManage.exe: error: VT-x is not available (VERR_VMX_NO_VMX)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component ConsoleWrap, interface IConsole

Workaround

ThereforeVT-x is a set of intel CPU instructions that include hardware virtualization features which accelerate virtual machines. This must be enabled at BIOS level. Coincidentally, I also had to update my laptop BIOS the same week, but it’s not what caused the error.
Windows is known to automatically disable VT-x if Hyper-V is enabled. In my case I am sure the new updates have enabled it back. You will, therefore, have to unset that again.

PS C:\Users\brokedba> bcdedit /set hypervisorlaunchtype off
The operation completed successfully.

No comments:

Post a Comment