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.
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.

VirtualBox Installation:
Download VirtualBox for Ubuntu 22.04.03 from https://www.virtualbox.org/wiki/Linux_Downloads
💡The package architecture has to match the Linux kernel architecture, that is, if you are running a 64-bit kernel, install the appropriate AMD64 package (it does not matter if you have an Intel or an AMD CPU). Mixed installations (e.g. Debian/Lenny ships an AMD64 kernel with 32-bit packages) are not supported. To install VirtualBox anyway you need to setup a 64-bit chroot environment.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 contribThe Oracle public key for verifying the signatures can be downloaded here.
Convert a downloaded binary GPG key file (usually with the
.ascextension) into a keyring format. (If needed, move to the folder where the.asckey is located before executing the following command or provide the full path)sudo gpg --dearmor oracle_vbox_2016.ascThe 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.gpgThe
/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.ascfile into your GPG keyring using the command:gpg --import oracle_vbox_2016.ascOnce the key is imported, view its fingerprint with the command:
gpg --fingerprint key_identifierIn this case, the key identifier is
2980AECF
Finally, install VirtualBox with the command:
sudo apt-get update sudo apt-get install virtualbox-6.1To verify that VirtualBox has been correctly installed on Ubuntu 22.04, check VirtualBox Version with the command:
virtualbox --helpOR
VBoxManage --versionFor 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.





