How to install Oracle VirtualBox on Linux
Oracle’s VirtualBox tool is excellent for emulating other operating systems. If you’re using Linux and you need to run something like Microsoft Windows, Android x86, BSD, and others, you’ll want to install this program on your computer. Here’s how to do it.
Ubuntu installation instructions
On Ubuntu, the Oracle VM VirtualBox app is available in the official software repositories. Start by opening up a terminal window on the Ubuntu desktop to get it working on your computer.
Not sure how to launch a terminal window on the Ubuntu desktop? Press Ctrl + Alt + T on the keyboard. Or, search for “Terminal” in the app menu and launch it that way. Once it is open, use the apt install command to set up the latest “virtualbox” package.
Note: in addition to the “virtualbox” package, you will also need to set up the latest Linux kernel headers. These headers are required for VirtualBox to work correctly on Ubuntu.
sudo apt install virtualbox linux-headers-$(uname -r)
After entering the command above, Ubuntu will ask you for your password. Using the keyboard, enter the password for your username. Then, press the Y key to confirm you wish to install VirtualBox.
Debian installation instructions
VirtualBox is available for Debian Linux users. However, it may be a bit out of date. To get it working on your Debian system, open up a terminal window on the desktop by pressing Ctrl + Alt + T on the keyboard. Or, search for “Terminal” in the app menu and launch it that way.
With the terminal window open and ready to use, run the apt-get install command to install both the “virtualbox” package and the latest Linux kernel headers (if you don’t already have the headers set up on Debian.)
sudo apt-get install virtualbox linux-headers-$(uname -r)
After entering the command above, Debian will ask for your password. Using your keyboard, enter the password for your user account. Then, press the Enter key to submit the password. Finally, press Y to confirm that you wish to install VirtualBox.
Arch Linux installation instructions
Arch Linux always has the latest version of VirtualBox right in the official software repositories. To get it working on your Arch Linux system, start by opening up a terminal window on the desktop.
With the terminal window open on the Linux desktop, use the pacman command to install the “virtualbox” package. To ensure the VirtualBox modules compile correctly, you will also need to install the “linux-headers” package on Arch Linux.
sudo pacman -S virtualbox linux-headers
Once the command above is entered, Arch Linux will ask you for your password. Using your keyboard, enter the password for your username. Then, press the Enter key to confirm you wish to install the packages.
Fedora installation instructions
Oracle VM VirtualBox does not come in the official Fedora Linux software repositories. However, it is possible to get the app working after enabling the RPM Fusion software repositories. Here’s how to enable them.
First, open up a terminal window on the Fedora desktop. You can open up a terminal window by pressing Ctrl + Alt + T on the keyboard. Or by searching for “Terminal” in the app menu. Once it is open, use the commands below to enable RPM Fusion.
sudo dnf install \ https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm sudo dnf install \ https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
After installing both software repositories on Fedora, you’ll be able to install VirtualBox by using the following dnf install command down below.
sudo dnf install VirtualBox kernel-devel kernel-headers
OpenSUSE installation instructions
All current versions of OpenSUSE Linux have VirtualBox available for installation. However, to get the app working on your OpenSUSE Linux system, you’ll need a terminal. You can open up a terminal window by pressing Ctrl + Alt + T on the keyboard. Or, search for “Terminal” in the app menu and launch it that way.
With the terminal window open and ready to use, run the zypper install command and install the “virtualbox” package on your computer.
sudo zypper install virtualbox
Once you run the command above, OpenSUSE will ask you for your password. Using the keyboard, enter your user account’s password. With your password entered, press the Y button to confirm that you would like to install VirtualBox on your OpenSUSE computer.
Generic Linux installation instructions
If you use a Linux operating system that doesn’t have native VirtualBox packages, here’s how you can install it. First, launch a terminal window. Then, once the terminal window is open, use the wget download command to grab the latest VirtualBox package.
wget https://download.virtualbox.org/virtualbox/6.1.30/VirtualBox-6.1.30-148432-Linux_amd64.run
After downloading the package, update the file’s permissions using the chmod command.
chmod +x VirtualBox-6.1.30-148432-Linux_amd64.run
To install VirtualBox, run the command below.
sudo ./VirtualBox-6.1.30-148432-Linux_amd64.run