Search code examples
windowsvirtual-machinevirtualboxwindows-subsystem-for-linuxhyper-v

How to get VirtualBox 6.0 and WSL working at the same time


When I turn on Windows Subsystem for Linux option in Windows features on or off, VirtualBox outputs the following error every time I run a VM:

Call to WHvSetupPartition failed: ERROR_SUCCESS (Last=0xc000000d/87) (VERR_NEM_VM_CREATE_FAILED).
Result Code: E_FAIL (0x80004005)
Component: ConsoleWrap
Interface: IConsole {872da645-4a9b-1727-bee2-5585105b9eed}

Is there a way to fix the VirtualBox error without turning off WSL?


Solution

  • I found it! After much research, and trial and error, here is what enabled me to run VMs in VirtualBox on Windows 10 with Windows Subsystem for Linux installed:

    In an elevated (admin) cmd.exe or PowerShell, do:

    bcdedit /set hypervisorlaunchtype off

    and make sure Hyper-V and Windows Sandbox are disabled in Windows Features (which you can get to by entering OptionalFeatures.exe at a command prompt, or via the Control Panel).

    Also, Virtualisation options should be enabled in the BIOS, and I think (I don't have time to test right now) that "Virtual Machine Platform" and "Windows Hypervisor Platform" should be enabled.

    VirtualBox 6.0.14, Windows Version 10.0.18362.356.