How to use WSL and Oracle VirtualBox at the Same Time

There was a time when folks were using Oracle VirtualBox to get familiar with Linux distributions, but times have changed since 2016 when Microsoft introduced WSL, and now you don’t need to download any extra software to enable Virtual Technology.

You just need to enable “Window Subsystem for Linux”, and after that, you can download the distribution file from the Microsoft Store and get the experience of Linux on Windows technology.

If you have not yet installed WSL2 on Windows 10 or 11, then you must try it once. If it is suitable for you, then you can continue to use it, or else you can come back to VirtualBox and VMware.

To get started with WSL2, check out this post: How to install WSL2 on Windows 10? where we have explained the installation process of WSL2.

Once you installed WSL2 just make sure to follow the below step, which will allow VirtualBox machines to get boot properly without throwing any error on your screen, which can save a few hours or minutes to fixing up the issue.

I guess I should start showing the method.

Fix VirtualBox machine not booting up

If you are also facing some kind of issue like the VirtualBox machine not starting after the installation of WSL2, then you can follow the below method, which will fix the error.

Personally, in my case, the system was not able to boot my virtual machine. I thought it may be something I had tinkered with the machine, but when I checked the message it said something like “init is conflicting”.

While reading the error, it strikes me that Ubuntu 20.04.5 is also using the init system, which means that WSL2 is conflicting between WSL and VirtualBox machine.

So to reconfirm, I stopped the machine and turned off the WSLfeature from optional features, which made the VirtualBox run again.

Well, now I have identified the problem, so let’s fix this problem. While fixing this issue, my search result took me to the StackOverflow post, where I found a command that resolves this issue, so you also just need to run the below command as an administrator in the command prompt or PowerShell, which will fix the VirtualBox startup issue after installing WSL.

bcdedit /set hypervisorlaunchtype off

After invoking the command you need to restart your system to see changes. Still, if the problem persists, then you need to uncheck the following option Hyper-V and window sandbox from optionalfeatures.

And to revert these changes, you can run the below command.

bcdedit /set hypervisorlaunchtype auto

If your problem is solved, then do let me know in the comment section.

Leave a Reply