How to fix VirtualBox VM launch error on Linux
On some Linux distributions, the VirtualBox VM tool refuses to launch after installation. There are many different reasons why your VM may not be starting. In this guide, we’ll go through various fixes to solve it.
Fix 1 – Install VirtualBox kernel driver
Usually, the primary reason your VirtualBox VM is not launching on Linux is that you have neglected to install the VirtualBox kernel driver. This driver is required on Linux host machines, and without it, VMs simply will error out and refuse to launch.
To install the VirtualBox kernel driver on your operating system, open up a terminal window by pressing Ctrl + Alt + T or Ctrl + Shift + T on the keyboard. Then, follow the step-by-step instructions below.
Step 1: The VirtualBox kernel driver usually fails to install when the user has neglected first to install the kernel headers. Kernel headers make it possible to build custom modules, such as the VirtualBox kernel driver.
To install the Linux kernel headers on your Linux PC, enter the commands below that correspond with your distribution.
Ubuntu
sudo apt install linux-headers-$(uname -r)
Debian
sudo apt-get install linux-headers-$(uname -r)
Arch Linux
sudo pacman -S linux-headers
Fedora
sudo dnf install "kernel-devel-uname-r == $(uname -r)"
OpenSUSE
sudo zypper install kernel-devel
Step 2: After installing the Linux kernel headers on your Linux system, the module can be re-setup. For best results, it’s a good idea to reinstall VirtualBox module package altogether, rather than dealing with various confusing commands.
To reinstall VirtualBox module package, enter the commands below in the terminal that correspond with the Linux distribution you currently use.
Ubuntu
sudo apt install virtualbox-dkms --reinstall
Debian
sudo apt install virtualbox-dkms --reinstall
Arch Linux
sudo pacman -R virtualbox-host-modules-arch sudo pacman -S virtualbox-host-modules-arch
Fedora
sudo dnf remove VirtualBox akmod-VirtualBox sudo dnf install VirtualBox akmod-VirtualBox
OpenSUSE
sudo zypper remove virtualbox-kmp-default
sudo zypper install virtualbox-kmp-default
Step 3: After reinstalling the VirtualBox kernel module package on your Linux PC, the modules should be built and set up on your Linux PC. Now you must load the module into the system. To do that, enter the modprobe vboxdrv command.
sudo modprobe vboxdrv
Alternatively, reboot your PC. When you log in, the kernel driver will be loaded!
Fix 2 – Install VirtualBox extension package
Sometimes VirtualBox VMs do not launch on Linux systems because they were created with the VirtualBox extension package enabled, and the extension package is no longer installed. To fix this problem, open up a terminal window by pressing Ctrl + Alt + T or Ctrl + Shift + T on the keyboard and enter the commands below that correspond with your Linux distribution.
Ubuntu
sudo apt install virtualbox-ext-pack
Debian (Sid only)
sudo apt-get install virtualbox-ext-pack
On other releases of Debian, do the following.
wget https://download.virtualbox.org/virtualbox/6.1.4/Oracle_VM_VirtualBox_Extension_Pack-6.1.4.vbox-extpack
Open up your Linux file manager and double-click on the Ext pack to load it into Debian.
Arch Linux/Fedora/OpenSUSE
wget https://download.virtualbox.org/virtualbox/6.1.4/Oracle_VM_VirtualBox_Extension_Pack-6.1.4.vbox-extpack
Open up your Linux file manager. Then, double-click on the Ext pack with your mouse. It will allow you to install it into VirtualBox with no issues.
Fix 3 – Change ownership of the /usr/ directory
You may run into an error with VirtualBox, where the kernel module is installed on your system, yet the program still will not launch any VMs. The reason this error happens is that there are certain components for VirtualBox in the /usr/
directory that make the program run. The /usr/
directory can sometimes have permission issues. Typically, the /usr/
directory is owned by the root user. A VirtualBox error occurs when the folder is not owned by root.
To fix this error, open up a terminal window by pressing Ctrl + Alt + T or Ctrl + Alt + T on the keyboard. Then, follow the step-by-step instructions below.
Step 1: Run the ls -l command on the root directory to determine if your /usr/
folder’s ownership permissions.
ls -l /
You can also isolate /usr/
by applying the grep command.
ls -l / | grep usr
Look through the ls prompt for usr. If it is owned by root, you should see something similar to what is shown below in your terminal.
drwxr-xr-x 14 root root 4096 Mar 27 2019 usr
If your /usr/
folder is owned by root, it will have root root
exactly like the example below. If it is not owned by root, it will display your username where root root
is in the prompt.
Step 2: Assuming your /usr/
directory is not owned by the root user, make use of the chown command to change it’s permissions so it is.
sudo chown root:root /usr/
Step 3: Re-run the ls -l command to make sure that the chown command has changed the ownership of the /usr/
folder so that it matches the code below.
drwxr-xr-x 14 root root 4096 Mar 27 2019 usr
Minor issues – Update VirtualBox
Minor issues with VirtualBox can usually be fixed by simply updating the program to a newer release. Oracle works very hard to patch out bugs. To update VirtualBox on your Linux PC, open up a terminal window and use the package manager to install updates the way you typically would.