How to Install Oracle VirtualBox in Ubuntu and Linux Mint

2 min


A simple and easy-to-follow guide to install Oracle VirtualBox in Ubuntu, Linux Mint.

Oracle’s VirtualBox is a virtualization application which brings several advanced features. It can dynamically allocate virtual machine storage, USB, networking, NVMe support and so on. However, other free and open-source virtual machine apps are available such as virt-manager, GNOME Boxes, etc. They have their own benefits and features. However, VirtualBox is a little advanced, hence ideal for experienced users.

Here’s how you can install it in Ubuntu and Linux Mint (latest versions). And these steps also should work in Debian and other Debian & ubuntu-based distros.

Let’s begin.

Install Oracle VirtualBox in Ubuntu, Linux Mint

VirtualBox 7.0+ requires several Qt5 dependencies and associated packages to build kernel modules. First, open a terminal and install the following packages. These are necessary to build the kernel modules.

sudo apt install gcc make perl

Download the DEB package for your system’s Ubuntu version from the link below.

VirtualBox download location in official website
VirtualBox download location on the official website

Once downloaded, go to the downloaded folder (usually ~/Downloads) and run the following. Make sure you change the file name as per the file you downloaded.

sudo dpkg -i virtualbox-7.0_7.0.2-154219~Ubuntu~jammy_amd64.deb

The above command is likely to cause a dependency error. If it does, run the following. Don’t try to install the dependent packages separately by yourself; let the apt take care of it.

sudo apt --fix-broken install

The above command will install the following dependencies for Virtualbox.

libqt5core5a
libqt5dbus5
libqt5gui5
libqt5gui5-gles
libqt5help5
libqt5opengl5
libqt5printsupport5
libqt5widgets5
libqt5x11extras5
libqt5xml5

And finally, it will resume the installation.

Install VirtualBox in Ubuntu 22.04
Install VirtualBox in Ubuntu 22.04
VirtualBox 7 installed in Ubuntu Linux
VirtualBox 7 installed in Ubuntu Linux

Uninstall, re-install and upgrade

If you want to uninstall and reinstall, then you can run the following command to uninstall. Make sure to change the version accordingly in the below command.

sudo apt remove virtualbox-7.0

In addition, if you want to upgrade to the latest version, you must uninstall it first. Then re-install using the above methods with a fresh download. All your created VM and its data are kept during the upgrade. So, you can get all of your VMs created in the prior version. Ideally, they are kept at ~./VirtualBox VMs in your home directory.

Wrapping up

In this guide, you learnt how to install Oracle VirtualBox in Ubuntu and Linux Mint easily. The steps are tested in Ubuntu and Linux Mint. However should work in Debian, elementary OS and other related distros. I hope it helps. If you run into any errors, let me know in the comment box below.


Arindam

Creator and author of debugpoint.com. Connect with me via Telegram, 𝕏 (Twitter), or send us an email.
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

3 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments