Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install Virtualbox in WSL Windows 10

I need to have access to Virtualbox from within the WSL, I have tried to sudo apt-get install virtualbox but I end up with the following error:

WARNING: The character device /dev/vboxdrv does not exist.
     Please install the virtualbox-dkms package and the appropriate
     headers, most likely linux-headers-3.4.0+.

     You will not be able to start VMs until this problem is fixed.

4.3.36_Ubuntur105129

like image 305
Heath N Avatar asked Aug 02 '16 19:08

Heath N


People also ask

Can I run VirtualBox on WSL?

Will I be able to run WSL 2 and other 3rd party virtualization tools such as VMware, or VirtualBox? Some 3rd party applications cannot work when Hyper-V is in use, which means they will not be able to run when WSL 2 is enabled, such as VMware and VirtualBox.

Is WSL better than VirtualBox?

WSL also integrates much more fully into Windows than a regular VM in VirtualBox does. While there are ways to integrate your Windows desktop and a Linux VM in VirtualBox, it can take some time to get it working properly.

How do I install distro on WSL2?

To install WSL2 on Windows 10, open Command Prompt as admin and run “wsl –install.” The command will install all the WSL2 components and the Ubuntu Linux distro. To install a specific distro, run “wsl –install -d DISTRO-NAME.” To update the WSL2 kernel, run the “wsl –update” command.


2 Answers

Vagrant is now capable of detecting that it is running on WSL.
How to configure Windows and WSL to enable this feature is described on Vagrant website
They claim it's an advanced feature but the configuration seems quite straightforward.

like image 117
ElmoVanKielmo Avatar answered Sep 22 '22 07:09

ElmoVanKielmo


Unfortunately, that will not work (at least for now), as explained here: https://github.com/Microsoft/BashOnWindows/issues/549

like image 24
kioleanu Avatar answered Sep 21 '22 07:09

kioleanu