In this tutorial, we will guide you on how to install Oracle’s VirtualBox and Extension Packs on Ubuntu. VirtualBox is a powerful x86 and AMD64/Intel64 virtualization product for enterprise and home use. It is a versatile tool that allows you to run multiple operating systems on your machine without the need for partitioning or rebooting.
To install Oracle’s VirtualBox for Extension Packs on Ubuntu, you need to add the Oracle repository to your software sources, download and install the signature key, update the software sources cache, install VirtualBox, install DKMS, and then install the Extension Pack using the command line or VirtualBox Manager GUI.
Before we begin, you need to have a Ubuntu system with sudo privileges.
Removing the Current VirtualBox Version
If you have an older version of VirtualBox installed on your system, it is recommended to remove it before proceeding with the installation of a new version. You can do this by running the following command in your terminal:
sudo apt purge virtualbox
This command will remove the VirtualBox package from your system.
Adding Oracle Repository to Software Sources
To install the Oracle’s version of VirtualBox, you need to add the Oracle repository to your software sources. You can do this by running the following command:
sudo add-apt-repository "deb http://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib"
In this command,
$(lsb_release -cs) is a command substitution that returns the codename of your Ubuntu installation. This is necessary to ensure that the correct repository is added for your specific version of Ubuntu.
Downloading and Installing the Signature Key
Next, you need to download and install the signature key from the Oracle repository. This is necessary to ensure the authenticity of the software you are installing. Run the following command to do this:
wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -
In this command,
wget is used to download the signature key, and
apt-key add - adds the key to your system’s list of trusted keys.
Updating Software Sources Cache
After adding the Oracle repository and the signature key, you need to update your system’s software sources cache. This can be done by running the following command:
sudo apt-get update
This command will update your system’s list of available packages and their versions.
Now, you can install VirtualBox by running the following command:
sudo apt-get install virtualbox-<version>
<version> with the desired version of VirtualBox (e.g., 6.1). This command will install VirtualBox on your system.
Dynamic Kernel Module Support (DKMS) is a framework used to generate Linux kernel modules whose sources generally reside outside the kernel source tree. It is recommended to install dkms package to ensure that the VirtualBox host kernel modules are properly updated if the Linux kernel version changes during the next upgrade. Run the following command to install DKMS:
sudo apt-get install dkms
Installing VirtualBox Extension Pack
To enhance the functionality of VirtualBox, you can install the Extension Pack. First, download the Extension Pack from the Oracle VirtualBox Download page. Make sure to download the Extension Pack that matches your installed version of VirtualBox.
Once downloaded, you can install it using the VirtualBox Manager GUI or via the command line. To install the Extension Pack using the command line, run the following command:
VBoxManage extpack install [--replace] <filename>
<filename> with the path to your downloaded extension pack. Use the
--replace option if you have an older version of the extension pack already installed.
In this tutorial, we have shown you how to install Oracle’s VirtualBox and Extension Packs on Ubuntu. With VirtualBox installed, you can now run multiple operating systems on your Ubuntu machine without the need for partitioning or rebooting. Remember to keep your VirtualBox and Extension Pack up-to-date to ensure optimal performance and security.
Yes, VirtualBox is available for various Linux distributions, including Ubuntu, Debian, Fedora, and CentOS. You can check the VirtualBox website for specific instructions on how to install it on different distributions.
You can check the version of VirtualBox installed on your system by running the following command in your terminal:
vboxmanage --version. This will display the version number of VirtualBox.
By default, VirtualBox requires sudo privileges to run. However, you can add your user to the
vboxusers group to allow running VirtualBox without sudo. You can do this by running the command
sudo usermod -aG vboxusers <username>, replacing
<username> with your actual username. After adding yourself to the group, you will need to log out and log back in for the changes to take effect.
To uninstall VirtualBox from your Ubuntu system, you can run the following command in your terminal:
sudo apt-get remove virtualbox. This will remove the VirtualBox package from your system. Additionally, if you want to remove all the configuration files associated with VirtualBox, you can use the command
sudo apt-get purge virtualbox.
Yes, VirtualBox allows you to run various operating systems, including macOS and Windows, on your Ubuntu machine. However, please note that running macOS on non-Apple hardware may violate Apple’s licensing terms. Additionally, for Windows, you will need to have a valid license to install and use it within VirtualBox.
To update VirtualBox to the latest version, you can use the following command in your terminal:
sudo apt-get upgrade virtualbox. This will upgrade VirtualBox to the latest available version. Alternatively, you can also download the latest version from the VirtualBox website and install it manually.
It is generally recommended to use Extension Packs that match the version of VirtualBox you have installed. Using an Extension Pack from a different version may cause compatibility issues. Therefore, it is best to ensure that the Extension Pack version matches the VirtualBox version you are using.