31

I recently updated my Windows 10 version to version 2004. I also updated WSL to WSL2.

I encountered a problem while trying to use a Virtual Machine (Windows 10 Host/Windows 10 Guest) through VirtualBox 6.1.8. Everytime I try to boot it, it becomes really slow and doesn't make it past the boot loading screen.

I thought the newest versions of VB fixed this issue (according to this documentation from Microsoft).

What can I do to fix this?

Liastre
  • 1,281
  • 11
  • 29
tbmsilva
  • 339
  • 1
  • 3
  • 9
  • It's not quite a solution but I've found a way to improve my workflow. If you don't require to use both at the same time, but you don't want to disable windows features (and reboot everytime), you can just open up a powershell session and shutdown wsl temporarily. `wsl --suthdown` – augustoht Nov 08 '21 at 14:23

3 Answers3

27

Downgrade to WSL1, if you want to save yourself from days of wasted effort.

I've upgraded to WSL2 and tried a bit to get VirtualBox to work with it and I couldn't find anything useful. There are few guides suggesting that turning off some features of VirtualBox will make it work, however it will make it even slower than what it is right now, which really defeats the purpose.

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

https://superuser.com/q/1531337

Zaigham R.
  • 612
  • 1
  • 6
  • 12
  • 9
    Sadly, the MS docs issue was closed with the assertion that it works. I opened a new case: https://github.com/MicrosoftDocs/WSL/issues/798 – Jeff Learman Jul 16 '20 at 13:09
  • 4
    In case anyone is confused with downgrading, follow this https://github.com/MicrosoftDocs/WSL/issues/590#issuecomment-602029634 – techolic Nov 19 '20 at 04:39
20

Since VirtualBox 6.0 support for Hyper-V has been added, but it is still experimental, which explains the bad performance (https://docs.oracle.com/en/virtualization/virtualbox/6.0/admin/hyperv-support.html).

I was able to fix this issue via disabling WSL2 in the Windows Features. If you go into Control Panel > All Control Panel Items > Programs and Features > Windows Features you will find a list, where you can disable or enable some Windows features.

Probably Hyper-V is already disabled in the features and you may wonder why VirtualBox still doesn't work properly. That is because WSL2 uses Hyper-V under the hood, even if it is not enabled for your custom use.

To make your VirtualBox usable again you have to uncheck the features Virtual Machine Platform and Windows Subsystem for Linux too and restart your PC for the effect to take place.

Clearly this will disable your PC to use WSL2 but at any time you may reactivate these features to work with WSL2 again. If you are not forced to use VirtualBox and WSL2 at the same time this works like a charm.

Shorxy
  • 598
  • 5
  • 12
2

You must activate "Windows Hypervisor Platform".

To do this, search for "windows resources" on Start menu. Open the "Activate/Deactivate Windows Resources" in the search result.

Select the option "Windows Hypervisor Platform" on the list and click Ok. This is an API exposed by Microsoft to make third parties virtualization providers compatible with Hyper-V, witch is used by WSL2.

That's because only one hypervisor may run at once on the host machine. So, the Microsoft Hyper-V hypervisor used by WSL2 prevents the VirtualBox to use the processor virtualization extensions.

See the FAQ below:

https://learn.microsoft.com/en-us/windows/wsl/wsl2-faq#will-i-be-able-to-run-wsl-2-and-other-3rd-party-virtualization-tools-such-as-vmware-or-virtualbox

Peter V. Mørch
  • 13,830
  • 8
  • 69
  • 103
Marcelino
  • 45
  • 1
  • 5
    I already have it enabled. I tried changing the acceleration paravirtualization interface, to every option, but had no improvements. Enabling/Disabling the Nested Paging acceleration also seemed to make no difference. I don't know why this is so slow. – tbmsilva Jul 20 '20 at 19:26
  • This is actually called "Turn Windows features on or off", not "Activate/Deactivate Windows Resources". – Andrew Jan 16 '22 at 23:07