How to Install Oracle VirtualBox on Ubuntu 22.04

Postgraduate in Communications Engineering with working experience in the Support Desk and self-study in software development.
Search for a command to run...

Postgraduate in Communications Engineering with working experience in the Support Desk and self-study in software development.
What is SSH? The Secure Shell protocol (SSH) is used to create secure connections between your device and GitHub Cloud. SSH uses two keys, a public key and a private key. The public key can be distributed. The private key should be protected. The...
The git log command is used to view the commit history of a Git repository. You can customize the output format to show specific details in a more readable or structured way. Below are some useful variations and formatting options for git log: To sh...

Overview This article will teach us how to: Install Ubuntu Server 24.04 on a laptop from scratch Install Ubuntu server by using Vagrant tool with ISO image Prerequisites: A laptop without any OS installed; A virtualization software Virtualbox t...

The /etc/passwd and /etc/shadow files are the backbone of Linux user management. Together, they store user account information and handle authentication securely. This article provides a hands-on guide to understanding these files, their structure, a...

In Linux, links are powerful tools that allow you to create references to files and directories. There are two main types of links: hard links and soft links (also known as symbolic links or symlinks). Understanding the differences between these two ...

A hostname is a human-friendly name given to a computer. It is a unique identifier that allows us to identify the machine in various network communications, making it easier to locate and manage devices. Type: hostname To see where it is stored, typ...

Oracle VirtualBox is a powerful, open-source, cross-platform virtualization software. It allows users to run multiple operating systems simultaneously on a single physical machine. This capability is extremely useful in various domains, including DevOps and Systems Engineering, where it serves several critical functions.
VirtualBox is categorized as Type2 hypervisor. It helps you to create guest operating systems (virtual machines) on a host operating system.

Download VirtualBox for Ubuntu 22.04.03 from https://www.virtualbox.org/wiki/Linux_Downloads
Add the following line to your /etc/apt/sources.list. For Ubuntu 22.04 and older, replace '<mydist>' with 'jammy',
deb [arch=amd64 signed-by=/usr/share/keyrings/oracle-virtualbox-2016.gpg] https://download.virtualbox.org/virtualbox/debian jammy contrib
The Oracle public key for verifying the signatures can be downloaded here.
Convert a downloaded binary GPG key file (usually with the .asc extension) into a keyring format. (If needed, move to the folder where the .asc key is located before executing the following command or provide the full path)
sudo gpg --dearmor oracle_vbox_2016.asc
The keyring format is more suitable for use with APT (Advanced Package Tool) and package managers.
Move the formatted GPG key file into the following folder usr/share/keyrings.
sudo mv oracle_vbox_2016.asc.gpg /usr/share/keyrings/oracle-virtualbox-2016.gpg
The /usr/share/keyrings/ directory is a common location for storing keyring files that APT can use to verify the authenticity of packages from specific repositories.
Before checking the fingerprint (a unique identifier for a GPG key that is used to verify its authenticity), import the GPG key from the oracle_vbox_2016.asc file into your GPG keyring using the command:
gpg --import oracle_vbox_2016.asc
Once the key is imported, view its fingerprint with the command:
gpg --fingerprint key_identifier
In this case, the key identifier is 2980AECF

Finally, install VirtualBox with the command:
sudo apt-get update
sudo apt-get install virtualbox-6.1
To verify that VirtualBox has been correctly installed on Ubuntu 22.04, check VirtualBox Version with the command:
virtualbox --help
OR
VBoxManage --version
For a more comprehensive check, you can create a new virtual machine and attempt to run it. If the VM starts correctly (even if it only displays a boot error message), VirtualBox is working as expected.
