MicrosoftDocs / WSL

Source code behind the Windows Subsystem for Linux documentation.
https://docs.microsoft.com/windows/wsl
Other
1.89k stars 556 forks source link

WSL does not work with VirtualBox #1807

Closed provanguard closed 8 months ago

provanguard commented 11 months ago

Documentation Issue

The documentation falsely indicates that WSL 2 works with VirtualBox. When following the links to the list of issues, there is a ticket open for the last 3 years with the title: "WSL2 breaks VirtualBox 6.1". Please either update the WSL documentation with the statement that WSL breaks VirtualBox, or make it work. I would prefer the latter, but the first one needs to be done anyway for the time being.

Link to documentation page

https://learn.microsoft.com/en-us/windows/wsl/compare-versions

Suggested Improvements

Please either update the WSL documentation with the statement that WSL breaks VirtualBox, or make it work. I would prefer the latter, but the first one needs to be done anyway for the time being.

ashemedai commented 10 months ago

I use WSL 2 and VirtualBox 6, now 7, without any issues for at least two years without any problems whatsoever.

provanguard commented 10 months ago

Here is the github ticket for reference and details. As far as I can see, the issue is not resolved.

https://github.com/MicrosoftDocs/WSL/issues/798

@ashemedai Could you please share details of your configuration for all relevant applications and services?

ashemedai commented 10 months ago

I guess we get into a semantic discussion of what exactly "breaks" and "does not work" entails. With the type of work I do, "break" and "does not work", means that using one completely stops me from using the other because of refusal to start, error messages, and so on.

So from that point of view, I have no problems using WSL 2 and VirtualBox and my many guests side-by-side.

If you refer to that issue and mean "does not work", it stops VirtualBox from using full HyperV capabilities for VirtualBox VMs, then I can say that I see the same. But this is more a performance issue rather than a breakage one, in my opinion. And that would definitely be good to mention.

polarathene commented 10 months ago

If it helps, while I haven't tried with VirtualBox I get the impression it's the same limitations that VMware also has that the docs give even less indication of. I've provided plenty of resources and references to docs that may need to be updated here: https://github.com/MicrosoftDocs/WSL/issues/1820

With VMware, I had installed it first and had some guests with work left in a suspended state under the impression I could successfully resume them after installing WSL2. That was not the case and several failures were encountered attempting to.

New VMs could be created and would also fail when I enabled VT-x / AMD-V or similar features. Those are not compatible, VM guest performance may be degraded, although impact may not be noticeable depending on hypervisor, workload and hardware.

craigloewen-msft commented 8 months ago

I closed out the linked issue, and as @ashemedai has explained, Virtualbox can work with WSL installed, as it does have support for Hyper-V. Since this original issue is describing Virtualbox not working with WSL, I believe we've answered it and will close out the issue for bookkeeping. If you still have any questions please feel free to reopen. THank you!

blakemcbride commented 8 months ago

I use WSL 2 and VirtualBox 6, now 7, without any issues for at least two years without any problems whatsoever.

I cannot get WSL 2 (Windows 11) to work in VirtualBox 7.0.12. I have spent hours on it and tried everything I can find. Since you have it working, if you can provide all of your settings perhaps others can too. For example:

  1. What are all of your VirtualBox VM settings?
  2. What are all of your Windows feature settings?
  3. bcdedit /enum {current}

Thanks. This would really help a lot!!

ashemedai commented 8 months ago

Hi @blakemcbride - this topic and my response was about WSL2 running next to VirtualBox. I have never tried to run WSL2 in VirtualBox. I think WSL2's use of virtualisation might just not play nice with what VirtualBox currently supports.