wsl2-faq Will I be able to run WSL 2 and other 3rd party virtualization tools such as VMware, or VirtualBox? states:
......and versions of VirtualBox before VirtualBox 6 (VirtualBox 6.0.0 released in December 2018 now supports Hyper-V as a fallback execution core on a Windows host!)
This is quite misleading...
according to here and here, WSL2 is still not co-exists with VirtualBox 6.0.x yet.
when WSL2 is running, starting VirtualBox 6.0.x virtual machine will failed:
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}
I'm quite expecting WSL2 and VirtualBox 6.0 can running at the same time, but before that comes true, could you please correct the faq doc?
Thanks!
From the Virtual Box 6.0.0 changelog, it states that it can also use Hyper-V as the fallback hypervisor.

As well, Oracle's documentation says that it's possible to run Hyper-V with Virtual Box.
I think you're running into a specific error, to me Oracle is clearly indicating that they do have support for Hyper-V which is why we have the link our docs that say so. Is there a way we could make the statement clearer?
yes, Hyper-V and VirtualBox 6.0 looks can play together, as the Oracle document you mentioned as well as the here (those time there is no WSL2 yet).
but now it really looks problem to have WSL2 together with VirtualBox,
Are WSL 2 and VirtualBox currently mutually exclusive?
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.
Hyper-V usage by VirtualBox started working with 1809, and some change in 1903 broke it.
......
The 6.1.0_BETA1 seemingly fixed it (but in fact it just accidentally disabled the optimization, so it was REALLY slow), and 6.1.0_RC1 restored the optimization which means that it doesn't work again with 1903 and 1909.
Hyper-V Powering Windows Features (2019.12.12)
Unless I missed something, it isn't. If you enable even Sandbox (which uses only one Hyper-V service), for example, Virtualbox doesn't run.
maybe it's not a bug of WSL doc nor WSL2, but Windows (Hyper-V API) or VirtualBox......
Just record some more details for the errors I met. (maybe there have no way but waiting newer version of Windows10 and/or VirtualBox)
HostOS: Win10 Insider 18990 x64 (for WSL2)
VirtualBox: latest 6.0.14 (as of now 6.1.0 comes out, maybe need to try on it.)
Errors when starting VMs when Hypver-V enabled (with WSL2 running) -- All VMs are able to running correctly when disabled Hyper-V.
uncheck "Enable VT-x/AMD-v" (32bit Guest OS)
ERROR shows on GUI:
Raw-mode is unavailable courtesy of Hyper-V. (VERR_SUPDRV_NO_RAW_MODE_HYPER_V_ROOT).
VM log:
CPUM: No hardware-virtualization capability detected
"Enable VT-x/AMD-v" (32-bit Guest OS; or 64-bit Guest OS which must check this)
ERROR shows on GUI:
Call to WHvSetupPartition failed: ERROR_SUCCESS (Last=0xc000000d/87) (VERR_NEM_VM_CREATE_FAILED).
VM log
32-bit Guest OS:
00:00:01.795686 HM: HMR3Init: Attempting fall back to NEM: VT-x is not available
00:00:01.816332 CPUM: No hardware-virtualization capability detected
64-bit Guest OS
00:00:01.824889 HM: HMR3Init: Attempting fall back to NEM: VT-x is not available
00:00:01.844124 NEM: Adjusting APIC configuration from X2APIC to APIC max mode. X2APIC is not supported by the WinHvPlatform API!
00:00:01.844126 NEM: Disable Hyper-V if you need X2APIC for your guests!
Try this command:
VBoxManage setextradata global "VBoxInternal/NEM/UseRing0Runloop" 0
It works but very slow with type 2 hypervisor because type 1 is already in the chair.
Try this command:
VBoxManage setextradata global "VBoxInternal/NEM/UseRing0Runloop" 0It works but very slow with type 2 hypervisor because type 1 is already in the chair.
Thanks a lot. It really works :)
follow the same link, below is a bit safer to try(affect not globally, but only the VM you are editing)
# add one line to your VM.box file <ExtraData> section
<ExtraDataItem name="VBoxInternal/NEM/UseRing0Runloop" value="0"/>
Thanks @Biswa96
Since the WA
goto C:\Program Files\Oracle\VirtualBox
# for one VM
VBoxManage setextradata "<VM Name>" "VBoxInternal/NEM/UseRing0Runloop" 0
or
# globally
VBoxManage setextradata global "VBoxInternal/NEM/UseRing0Runloop" 0
is working with
I'm closing this ticket.
I've struggled for days because of this! Thanks for all the work. You saved my day.
Same problem here, thanks very much for helping !
Is there any efect on performance of VM ?
Yes, running with this disabled hurts the performance of vbox. WSL consumes some sort of "hypervisor type 1 slot", so vbox won't run. You should be able to run both at once, but you can't. Shutting down WSL2, and starting VBOX can be done on the same machine.... but not both at once.
Currenty at Virtualbox 6.1.8, converting WSL's ubuntu-20.04 to WSL2 on Windows 10 2004 (May 10th.) Enables Windows Virtualization Platform.
As a virtualbox guest I am running Manjaro on kernel version 5.6, this works flawlessly along with other distributions as well, but when enabling Windows Virtualization Platform, what happens is that there seem to be some memory segmentation problems/VPU related problems, especially related to cryptographic tools like PGP. One example is: updating packages that are gpg signed, verification of the signature and package integrity fails. Regarding memory, the problem can sometimes be observed when attemting to run processes for example firefox or even smaller programs like lsof corrupts and their PID becomes defunct.
This nature is similar on all the virtualbox guests i have tested, like Debian, Manjaro, Fedora e.t.c..
I tested on several because I had to eliminate any flawed nature of the manjaro and archlinux keyrings that are cached.
Rolling the ubuntu instance back to WLS1 and turning the virtualization feature off in Windows 10 pro, returns virtualbox into a working state.
I have therefore concluded that running WSL2 and Virtualbox is not possible as it is.
I am instead running Visual studio code, connected to ssh remote (vscode extention) on my manjaro instance + docker setup (manjaro is running a vscode server to provide connectivity over ssh, and this works just as well or maybe slightly better performance wise than connecting vscode to a WSL2 instance running docker for example.
I don't think I understand the purpose WSL2. You can't break all virtualization, that renders it useless to me.
I think the solution (when I can face the effort) is uninstall windows, put fedora on the bare metal and then kvm/qemu windows on top with hardware passthrough, and any other VMs needed can run in parallel.
I don't think I understand the purpose WSL2. You can't break all virtualization, that renders it useless to me.
I think the solution (when I can face the effort) is uninstall windows, put fedora on the bare metal and then kvm/qemu windows on top with hardware passthrough, and any other VMs needed can run in parallel.
I get what you say, I have been running steady with Debian for over 15 years or so before switching to Manjaro, then I got a new computer with Windows preinstalled (reinstalled that stuff and changed a few settings, I have been running windows 10 at work because, policy and have never enjoyed that much, but always had Linux in a virtualbox environment since I'm seemingy uncapable of productivity outside of a Linux distro with i3 which is my prefered goto WM. Anyway, I descided to not do the usual and keep windows 10 pro on it, this machine is very powerful already so it feels alright running Windows on it with vbox running Manjaro/Debian and the others that I use for testing and documenting setups like I always has. And being aware of WSL i gave that a try on older versions of windows 10, but since it was not capable of running docker, I ditched it completely until now. We finally got WSL2 which supports running docker in WSL. Yes I'm aware of docker desktop on windows, but I prefer it along with openjdk and such on Linux, besides I do a lot of shell and python scripting on Linux spesific envs.. Anyway I will need access to my Virtual box vm's and they have to be fully functional. After half an hour I was able to narrow the scope down to WSL2 and the Hyper-V'ing.
What's a bit curious to me however is why this happens when running with the virtualization platform enabled, I would understand that if the full Hyper-V stuff gets enabled that the "ring type" is changed on the base os, which may cause issues (running a vm inside a vm causes disruptions between the hardware layer and the virtual layers).. However I did not think that this feature in windows did the same thing, although it may seem like it still does that even then.
I'm however fine when connected through remote-ssh to my manjaro box and utilize the same setup from work, which is good.
I must say that after a couple of months I'm still not a fan of windows, eventhough I find it interesting what they are doing, trying to merge the gap between win and linux, a wake-up call has occurred. VSCode is absolutely a thing of greatness and it behaves so fast and well even with the vim extention which is a must for me (one must be honest right?!)
It's technology and must be explored. But I hope that one day we can ignore Hyper-V because it's not good at all and then it will be possible to run a seamless Windows/Linux setup without the issues that are being observed right now.
WSL2 is not yet fit for purpose. Wasted best part of a day trying to figure out this one. Winding back to WSL1.
I too am unable to get WSL2 to work with VirtualBox. I'm running Ubuntu on both WSL and VB. When WSL2 is enabled and I start my Ubuntu in VB, I get a blank rectangular screen with a rapidly blinking cursor, which persists indefinitely. Of course, I configured HyperV for the VB VM, and made sure that HyperV was enabled in Windows Features.
What's worse, disabling WSL2 using any of the normal means doesn't restore VB to working state. Fortunately I was able to use Windows Restore to just before I installed WSL2 and it works. I did this twice; the second time I had to restore back to the first installation of WSL2, and this time I also had to reinstall ("Repair") VB.
It would be great to use WSL2, but for now I have to stick to WSL1 because I need VirtualBox; I need its ability to checkpoint.
WSL2 works fine with vmware player (which is the setup I am using now). Microsoft broke something in virtualbox with WSL2, I have verified this on a couple different workstations. Did not appear to be virtualbox's fault, but it is unusable ATM. I guess it will be fixed sometime....
Thanks @Biswa96
Since the WA
goto C:\Program Files\Oracle\VirtualBox # for one VM VBoxManage setextradata "<VM Name>" "VBoxInternal/NEM/UseRing0Runloop" 0 or # globally VBoxManage setextradata global "VBoxInternal/NEM/UseRing0Runloop" 0is working with
- Win10 Insider 18990 x64 (for WSL2)
- VirtualBox-6.1.0
I'm closing this ticket.
Works but. Machine was loaded, worked several minutes and got frozen. Probably just because of slow hypervisor type 2 performance
@ivictbor Try latest version 6.1.16, it has some fixes for Hyper-V.
https://www.virtualbox.org/wiki/Downloads
@onomatopellan but it could work, or not . See https://github.com/MicrosoftDocs/WSL/issues/798
this should be reopened. the workarounds only work for some users and even when they do the performance is terrible and the guests are still unstable and prone to crashes. yes, with VB 6.1.16
Most helpful comment
Thanks @Biswa96
Since the WA
is working with
I'm closing this ticket.