Are WSL 2 and VirtualBox currently mutually exclusive?

Discussions related to using VirtualBox on Windows hosts.
Post Reply
Zefrem23
Posts: 2
Joined: 2. Nov 2019, 13:48

Are WSL 2 and VirtualBox currently mutually exclusive?

Post by Zefrem23 »

Hi, I've been using VirtualBox guests on Windows for ages and all has worked fine. However I recently updated to the fast ring of the Windows distribution in order to try out the new Windows Subsystem for Linux (WSL 2) . It seems to be the case that, if I'm trying to run Ubuntu or any other WSL system, VirtualBox guests refuse to boot and give errors, and if I then repair this error by running the bcdedit command mentioned in other threads on this topic, then the WSL guests fail to launch with the error, "Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS."

So it seems like this is an either/or situation at present? Or has anyone managed to get both working together at the same time under Windows v1903 build 18990.1?
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Are WSL 2 and VirtualBox currently mutually exclusive?

Post by scottgus1 »

Yes, WSL2 is not compatible with Virtualbox, due to WSL2 using Hyper-V, which uses VT-x exclusively and doesn't share it with Virtualbox. To use Virtualbox properly, for now*, you have to have Hyper-V off, which turns off anything that uses Hyper-V.

*The developers are working on ways to allow Virtualbox to coexist with Hyper-V - actually, to use Hyper-V instead of the Virtualbox substructure - but it's still very much a work in progress. For now it's one or the other.
Zefrem23
Posts: 2
Joined: 2. Nov 2019, 13:48

Re: Are WSL 2 and VirtualBox currently mutually exclusive?

Post by Zefrem23 »

Aaaah, that's a bugger. Thanks for the confirmation, at least now I won't be moved to waste any more time trying to get them to play nice with each other. Hopefully there'll be a proper solution at some point.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Are WSL 2 and VirtualBox currently mutually exclusive?

Post by scottgus1 »

Fellow volunteer MultiOS found a tutorial https://www.tenforums.com/tutorials/139 ... puter.html that shows more about why Hyper-V and other virtualizers can't play together, and an easy way to turn Hyper-V on or off during the boot process.
multiOS
Volunteer
Posts: 824
Joined: 14. Sep 2019, 16:51
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: WIN11,10, 7, Linux (various)
Location: United Kingdom

Re: Are WSL 2 and VirtualBox currently mutually exclusive?

Post by multiOS »

It seems that Microsoft believes/believed that WSL 2 and VirtualBox have been compatible since the release of VirtualBox 6.0 in Dec 2018. See the third FAQ on this list (dated 30 May 2019): https://docs.microsoft.com/en-us/windows/wsl/wsl2-faq

They were probably; and still are, (partially) correct, but only for people who have the age expectation and the time to fill of the top ten in this list: https://en.wikipedia.org/wiki/Longevity ... n_religion :D If you can currently get VirtualBox to the stage of launching a VM you probably won't realise it's working because you'll think VirtualBox has frozen/crashed, when in reality it may just be running extremely slowly (watch for the Green Turtle in the VirtualBox Task Bar which indicates the 'fall back' use of Hyper-V). Hopefully, Microsoft's statement that they "are investigating ways to help resolve this issue" is still good, or:

(a) third-party developers who need their applications to have access to virtualisation features are just left with getting the best they can out of the Hyper-V (Hypervisor Platform) API's that Microsoft has already made available;
(b) users will have to continue making a choice of between running either Hyper-V features or third-party apps. but not both at the same time.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Are WSL 2 and VirtualBox currently mutually exclusive?

Post by socratis »

The problem with using Hyper-V as the virtualization back-end is that it's slower than molasses. Given Hyper-V's age (after Win10-1809), there's a lot of room for improvement. The question is will Microsoft invest the time to optimize it?
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply