What about Oracle VirtualBox on your favourite Linux distro?

Paul Guerin
Oracle Developers
Published in
4 min readSep 26, 2022

--

Installing Oracle VirtualBox in Windows is easy enough — but what about on Linux?

Each Linux distro has their own default repository, and Oracle provides a VirtualBox package for most of the major Linux distributions. The following link lists the Oracle provided packages for VirtualBox:

https://www.virtualbox.org/wiki/Linux_Downloads

The major Linux distributions below do provide a package for VirtualBox :

Debian

https://wiki.debian.org/VirtualBox

Ubunto

https://ubuntu.com/tutorials/how-to-run-ubuntu-desktop-on-a-virtual-machine-using-virtualbox#1-overview

Arch

https://wiki.archlinux.org/title/VirtualBox

Fedora

https://rpmfusion.org/Howto/VirtualBox?highlight=%28%5CbCategoryHowto%5Cb%29

For Fedora, the RPM Fusion repo has a package for VirtualBox. Also, the Guest Additions is packaged separately and is only for a virtual machine running Fedora Linux.

Through trial and error I’ve found the easiest and most reliable way to get VirtualBox for Fedora Linux is not through RPM Fusion, but via the Oracle VirtualBox website.

To install VirtualBox for Fedora we’ll follow this procedure.

Is VirtualBox already installed?

Determine if a VirtualBox is currently installed in Fedora:

dnf list --installed | grep -i virtual

If you need to, you can remove an existing VirtualBox like this:

sudo dnf autoremove VirtualBox-6.1# alternative
sudo dnf autoremove Virtualbox-server-6.1.28-1.fc35

Now install VirtualBox (lastest at time of writing is 6.1.38) from the Oracle supplied RPM package:

# some dependencies come from RPM Fusion
sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
# install dependencies for Virtualbox
sudo dnf install kernel-devel-$(uname -r) akmod-VirtualBox akmods
# install the Virtualbox package
sudo dnf install https://download.virtualbox.org/virtualbox/6.1.38/VirtualBox-6.1-6.1.38_153438_fedora35-1.x86_64.rpm --allowerasing

Now restart the VirtualBox kernel module:

sudo systemctl restart vboxdrv

Quickly confirm that the kernal modules are installed:

sudo lsmod  | grep -i vbox

To use VirtualBox, the user needs to be added to the VirtualBox group:

# usermod -a -G vboxusers <username>

Confirm your group membership with the following:

$ groups
me wheel vboxusers

Install the Extension Pack

The extension pack provides the following added functionality to VirtualBox:

— The virtual USB 2.0 (EHCI) device.

— The virtual USB 3.0 (xHCI) device.

— VirtualBox Remote Desktop Protocol (VRDP) support.

— Host webcam passthrough.

— Intel PXE boot ROM.

— Disk image encryption with AES algorithm.

— Cloud integration features.

The extension pack may be desirable, especially if you’re interested in the integration with OCI.

When installing an extension pack, the only requirement is that it match the same version as the VirtualBox that you have installed.

Oracle provides a full list of extension packs for each VirtualBox release, so that you can choose that which matches the version of VirtualBox installed:

https://www.virtualbox.org/wiki/Download_Old_Builds_6_1

Now you have the URL, you can download directly:

wget https://download.virtualbox.org/virtualbox/6.1.38/Oracle_VM_VirtualBox_Extension_Pack-6.1.38.vbox-extpack

Now just confirm there are no other extension packs installed:

VBoxManage list extpacks# Note: extension packs can be uninstalled with:
sudo VBoxManage extpack uninstall "Oracle VM VirtualBox Extension Pack"

Install the extension pack with:

sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-6.1.38.vbox-extpack

You’ll be greeted with a prompt to accept the license terms and conditions.

After you accept the license terms and conditions, you can confirm that the new extension pack is installed with:

VBoxManage list extpacks

Install the Guest Additions

The extension pack is for the host machine. There is a Guest Additions for the guest operating system.

The distro that provides the VirtualBox package will also provide the package for the Guest Additions. On a virtual machine running Fedora, the Guest Additions package is installed by:

sudo dnf install virtualbox-guest-additions

Alternatively, you may follow this article here for a manual installation on a virtual machine:

Paul Guerin has presented at some of the world’s leading Oracle conferences, including Oracle Open World 2013. Since 2015, his work has been featured in the IOUG Best Practices Tip Booklet, and in publications from AUSOUG, Oracle Technology Network, Quest, and Oracle Developers (Medium). In 2019, he was awarded as a most valued contributor for the My Oracle Support Community. He continues to be a participant of the Oracle ACE program.

--

--