How to Install VirtualBox 7 on Ubuntu 22.04 : A Step-by-Step Guide

How to Install VirtualBox on Ubuntu 22.04

In this short article we will learn how to install Oracle VM VirtualBox 7.0 on Ubuntu 22.04 operating system.

Introduction

VirtualBox is a popular virtualization software that allows users to run multiple operating systems on a single machine. If you’re an Ubuntu user and want to harness the power of VirtualBox, this step-by-step guide will walk you through the installation process. The installation steps will be as follow :

  1. Update System Packages
  2. Add the VirtualBox Repository
  3. Install Oracle VirtualBox On Ubuntu 22.04
  4. Verify Virtual Box Installation
  5. Install VirtualBox Extension Pack (Optional)
  6. Optional – Add User to VirtualBox Group

Step 1: Update System Packages

Before installing any new software, it’s essential to ensure that your system is up to date. Open a terminal and run the following commands:

sudo apt update
sudo apt upgrade

This will update the package lists and upgrade any outdated packages on your Ubuntu system.

Step 2: Add the VirtualBox Repository

By default, Ubuntu includes an older version of VirtualBox in its official repositories. To get the latest version, you need to add the VirtualBox repository. Open a terminal and enter the following commands:

wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib"

These commands will download and add the necessary keys and repository to your system.

Output of this commands are as shown below :

ramans@dev01:~$ wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
[sudo] password for ramans: 
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK
ramans@dev01:~$ wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK
ramans@dev01:~$ sudo add-apt-repository "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib"
Repository: 'deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian jammy contrib'
Description:
Archive for codename: jammy components: contrib
More info: http://download.virtualbox.org/virtualbox/debian
Adding repository.
Press [ENTER] to continue or Ctrl-c to cancel.
Adding deb entry to /etc/apt/sources.list.d/archive_uri-http_download_virtualbox_org_virtualbox_debian-jammy.list

Step 3: Install Oracle VirtualBox On Ubuntu 22.04

Once the repository is added, you can install VirtualBox by running the following command:

sudo apt install virtualbox-7.0

This command will download and install the latest version of VirtualBox on your Ubuntu machine.

The output will be shown below :

ramans@dev01:~$ sudo apt install virtualbox-7.0
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following package was automatically installed and is no longer required:
docker-scan-plugin
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
libdouble-conversion3 libmd4c0 libpcre2-16-0 libqt5core5a libqt5dbus5 libqt5gui5 libqt5help5 libqt5network5 libqt5opengl5
libqt5printsupport5 libqt5sql5 libqt5sql5-sqlite libqt5svg5 libqt5widgets5 libqt5x11extras5 libqt5xml5 libsdl-ttf2.0-0
libsdl1.2debian libxcb-xinerama0 libxcb-xinput0 qt5-gtk-platformtheme qttranslations5-l10n
Suggested packages:
qt5-image-formats-plugins qtwayland5
The following NEW packages will be installed:
libdouble-conversion3 libmd4c0 libpcre2-16-0 libqt5core5a libqt5dbus5 libqt5gui5 libqt5help5 libqt5network5 libqt5opengl5
libqt5printsupport5 libqt5sql5 libqt5sql5-sqlite libqt5svg5 libqt5widgets5 libqt5x11extras5 libqt5xml5 libsdl-ttf2.0-0
libsdl1.2debian libxcb-xinerama0 libxcb-xinput0 qt5-gtk-platformtheme qttranslations5-l10n virtualbox-7.0
0 upgraded, 23 newly installed, 0 to remove and 7 not upgraded.
Need to get 105 MB of archives.
After this operation, 271 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://download.virtualbox.org/virtualbox/debian jammy/contrib amd64 virtualbox-7.0 amd64 7.0.8-156879~Ubuntu~jammy [92,6 MB]
. . .
Setting up libqt5help5:amd64 (5.15.3-1) ...
Setting up qt5-gtk-platformtheme:amd64 (5.15.3+dfsg-2ubuntu0.2) ...
Setting up libqt5printsupport5:amd64 (5.15.3+dfsg-2ubuntu0.2) ...
Setting up libqt5opengl5:amd64 (5.15.3+dfsg-2ubuntu0.2) ...
Setting up libqt5x11extras5:amd64 (5.15.3-1) ...
Setting up libqt5svg5:amd64 (5.15.3-1) ...
Setting up virtualbox-7.0 (7.0.8-156879~Ubuntu~jammy) ...
Adding group `vboxusers' (GID 143) ...
Done.
vboxdrv.sh: failed: Look at /var/log/vbox-setup.log to find out what went wrong.

There were problems setting up VirtualBox. To re-start the set-up process, run
/sbin/vboxconfig
as root. If your system is using EFI Secure Boot you may need to sign the
kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load
them. Please see your Linux system's documentation for more information.
Processing triggers for desktop-file-utils (0.26-1ubuntu3) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu3) ...
Processing triggers for libc-bin (2.35-0ubuntu3.1) ...
Processing triggers for shared-mime-info (2.1-2) ...
Processing triggers for mailcap (3.70+nmu1ubuntu1) ...

Install VirtualBox7.0 on Ubuntu 22.04

Step 4: Verify Virtual Box Installation

After the installation is complete, you can verify if VirtualBox is installed correctly. Open VirtualBox from the Applications menu or by running the command virtualbox in the terminal. If VirtualBox opens without any errors, it means the installation was successful.

VirtualBox web GUI

Step 5: Install VirtualBox Extension Pack (Optional)

The VirtualBox Extension Pack provides additional features and functionality, such as USB 2.0/3.0 support, VirtualBox Remote Desktop Protocol (VRDP) support, and more. To install the extension pack, download it from the VirtualBox website (https://www.virtualbox.org/wiki/Downloads), then open VirtualBox and go to File -> Preferences -> Extensions. Click on the “Add Package” button and select the downloaded extension pack.

Step 6: Optional – Add User to VirtualBox Group

To use USB devices and access other advanced features in VirtualBox without using sudo, you can add your user to the vboxusers group. Run the following command:

sudo usermod -aG vboxusers <username>

Replace <your_username> with your actual username, as shown below :

ramans@dev01:~$ sudo usermod -aG vboxusers ramans

Conclusion

By following these steps, you can easily install VirtualBox on your Ubuntu machine. VirtualBox provides a powerful platform for running virtual machines and exploring different operating systems and applications. Enjoy the flexibility and convenience of virtualization with VirtualBox on Ubuntu!

(Visited 214 times, 1 visits today)

You may also like