
How to Install VirtualBox 7 on Ubuntu 24.04: A Step-by-Step Guide
Virtualization is a powerful tool for developers, system administrators, and tech enthusiasts, allowing you to run multiple operating systems on a single machine. Oracle VM VirtualBox is a leading free and open-source hypervisor, and installing it on Ubuntu 24.04 Noble Numbat is a straightforward process.
This guide provides the definitive method for installing VirtualBox 7 on your Ubuntu 24.04 system. By using the official Oracle repository, you ensure you always have the latest, most secure version available directly through your system’s package manager.
Prerequisites
Before you begin, make sure you have:
- An up-to-date Ubuntu 24.04 system.
- A user account with
sudo
or root privileges. - A stable internet connection.
Step 1: Update Your System
First, it’s crucial to ensure your system’s package list and installed packages are fully up to date. This prevents potential conflicts and ensures all dependencies are current.
Open your terminal and run the following command:
sudo apt update && sudo apt upgrade
Step 2: Add the Official VirtualBox Repository
To install VirtualBox, we’ll add Oracle’s official APT repository. This involves importing the GPG keys to verify the authenticity of the packages and then adding the repository source itself.
Import the Oracle GPG Keys: These keys are used to sign the VirtualBox packages, confirming that they are genuine and have not been tampered with.
sudo apt install gpg -y wget -O- https://www.virtualbox.org/download/oracle_vbox_2016.asc | sudo gpg --dearmor --yes -o /usr/share/keyrings/oracle-virtualbox-2016.gpg
Add the VirtualBox Repository: Now, create a new repository source file that points to the official VirtualBox repository for Ubuntu 24.04.
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/oracle-virtualbox-2016.gpg] http://download.virtualbox.org/virtualbox/debian noble contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list
Step 3: Install VirtualBox 7
With the repository successfully added, you need to update your package list one more time to include the new packages from the VirtualBox source.
Update the Package List Again:
sudo apt update
Install the VirtualBox Package: Now you can install the latest stable version of VirtualBox 7. The package manager will automatically handle all required dependencies.
sudo apt install virtualbox-7.0 -y
After the installation completes, you have successfully installed the core VirtualBox application.
Step 4: Install the VirtualBox Extension Pack (Highly Recommended)
The VirtualBox Extension Pack unlocks critical features for your virtual machines. This step is essential for unlocking the full functionality of your VMs, including:
- USB 2.0 and 3.0 device support
- Host webcam passthrough
- VirtualBox Remote Desktop Protocol (VRDP)
- Disk encryption
Download the Extension Pack: You must download the Extension Pack that matches your installed VirtualBox version. You can find your version by running
vboxmanage --version
. Then, usewget
to download the corresponding file.wget https://download.virtualbox.org/virtualbox/7.0.18/Oracle_VM_VirtualBox_Extension_Pack-7.0.18.vbox-extpack
Note: If a newer version is available, simply replace
7.0.18
in the URL with the latest version number.Install the Extension Pack: Use the
vboxmanage
command to install the downloaded file.sudo vboxmanage extpack install Oracle_VM_VirtualBox_Extension_Pack-7.0.18.vbox-extpack
You will be prompted to agree to the license terms and conditions. Read them and type
y
to proceed.
Step 5: Add Your User to the vboxusers
Group
For your user account to access features like USB devices, shared folders, and other hardware integrations, it must be a member of the vboxusers
group.
This is a crucial final configuration step. Run the following command, which automatically adds your current user ($USER
) to the group:
sudo usermod -aG vboxusers $USER
Important: For this change to take effect, you must log out and log back in or completely reboot your system.
Launching VirtualBox
You have now successfully installed and configured VirtualBox 7 on Ubuntu 24.04. You can launch the application from your Activities menu by searching for “VirtualBox”. You are now ready to create your first virtual machine and explore the world of virtualization.
Source: https://kifarunix.com/install-virtualbox-7-on-ubuntu-24-04/