'how to get Oracle vm VirtualBox 6.0 and wsl working at the same time [closed]

when i Turn on Windows Subsystem for Linux option in Windows features on or off

VirtualBox out an 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 turn off wsl



Solution 1:[1]

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.

Solution 2:[2]

VirtualBox + WSL2 (on Windows 10 & 11) ?

It's possible to have VirtualBox and WSL2 running at the same time on Windows 10 as well as on Windows 11! Please note that when running both in parallel, VirtualBox is then only capable of running in its slower software virtualization mode.

To setup both systems, make sure that the virtualization options are enabled in your BIOS!

  • Virtual Box - install the newest version on your machine (official download)
  • WSL2 - simply run the command wsl --install in an elevated PowerShell or CMD (official docs)

Troubleshooting

Necessary Windows Features?

Installing WSL via the command line should automatically turn on the following Windows features:

  • Virtual Machine Platform
  • Windows Subsystem for Linux

WSL uses the Hyper-V architecture underneath but the actual Hyper-V features doesn't need to be enabled. In other words: WSL uses the Hyper-V architecture but not the Hyper-V feature (thanks @Cito).

Enable/Disable Windows Features

You can find and edit the Windows features via:

  • Open Control Panel > Programs > Turn Windows Features on or off, or
  • Enter OptionalFeatures.exe into a CMD or PowerShell terminal

Using Windows Home?

If you are running Windows Home, some features might not be installed on your machine. To manually add those virtualization features follow this tutorial.

WSL stopped working?

If you already had WSL installed and made changes to Windows features, WSL might have stopped working all together. Especially when WSL was installed via one of the old methods (not via the wsl --install command line). To repair the WSL installation, you can do the following:

  1. Uninstall and remove WSL completely from your system (backup your files if needed!)
  2. Deactivate all virtualization features
  3. Restart machine
  4. Do a fresh and clean install of WSL via the command line wsl --install
  5. Restart machine again

Slow VirtualBox VMs?

If you see this green turtle symbol turtle icon in the guest window's status bar, VirtualBox is running in software virtualization mode (which is really slow!). The hardware virtualization mode would be displayed with this blue symbol hw virtualization mode icon.

When running in software mode, the reason is most probably an active WSL setup, which relies on the Hyper-V architecture. Another reason could be the Hyper-V features to be turned on. To get back to hardware virtualization mode, make sure that the following features are turned off:

  • Hyper-V
  • Windows Hypervisor Platform

and that the hypervisorlaunchtype is set to off in the Windows Boot Configuration Data (BCD) store. To do so, run the following commands from an elevated command line:

bcdedit /set hypervisorlaunchtype off

After changing the BCD, a reboot is required.


More Information

For more information on:

Solution 3:[3]

in november 2019, i upgraded my Windows 10 family to release 1909 (run winver to check). I wanted to use WSL2.

And then i was unable to run the VMs in Oracle Virtualbox :

Call to WHvSetupPartition failed: ERROR_SUCCESS (Last=0xc000000d/87) (VERR_NEM_VM_CREATE_FAILED).

I had to check the "Plateforme Hyper-V" in "Turn Windows features ON or OFF" And it went OK.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 drkvogel
Solution 2
Solution 3 Francis