How to install VirtualBox Extension Pack to VirtualBox latest version on Linux?

First, you need to adhere to the VirtualBox Extension Pack Personal Use and Evaluation License.


Second, I advise to only install this package if actually needed, here is the description of the VirtualBox Extension Pack functionality:

Oracle Cloud Infrastructure integration, USB 2.0 and USB 3.0 Host Controller, Host Webcam, VirtualBox RDP, PXE ROM, Disk Encryption, NVMe.


Now, let's download the damn thing:

  • we need to store the latest VirtualBox version into a variable, let's call it LatestVirtualBoxVersion

  • download the latest version of the VirtualBox Extension Pack, one-liner follows


LatestVirtualBoxVersion=$(wget -qO - https://download.virtualbox.org/virtualbox/LATEST-STABLE.TXT) && wget "https://download.virtualbox.org/virtualbox/${LatestVirtualBoxVersion}/Oracle_VM_VirtualBox_Extension_Pack-${LatestVirtualBoxVersion}.vbox-extpack"

Simplification attribution goes to guntbert. Thank you.

You might want to verify its integrity by comparing its SHA-256 checksum available in file:

https://www.virtualbox.org/download/hashes/${LatestVirtualBoxVersion}/SHA256SUMS

using

sha256sum -c --ignore-missing SHA256SUMS

Then, we install it as follows:

sudo VBoxManage extpack install --replace Oracle_VM_VirtualBox_Extension_Pack-${LatestVirtualBoxVersion}.vbox-extpack

To verify if it has been successfully installed, we may list the installed extension packs:

VBoxManage list extpacks

To uninstall the extension pack:

sudo VBoxManage extpack uninstall "Oracle VM VirtualBox Extension Pack"

You can install the Extension Pack via the GUI too:

First you visit the VirtualBox download page, there under the heading
Virtualbox ... Extension Pack you find a link All supported platforms. A click on this link downloads the the extension pack.

Now from the Menu select File/Preferences

enter image description here

click on the icon I marked to select an extension file and proceed.

Of course the CLI method has the big advantage that you get it much quicker and need not scroll through the EULA...


Keeping your Extension Pack up-to-date from CLI.

I am assuming you always have the latest VBox version installed (Oracle provides repositories for Ubuntu, Debian, OpnenSUSE, SLES, Fedora and Oracle Linux).

Get the version number of the latest version:

vboxversion=$(wget -qO - https://download.virtualbox.org/virtualbox/LATEST.TXT)

wget -qO - keeps wget quiet and retrieves the content of that file to stdout, where it can be saved into the variable.

Download the latest Extension Pack

wget "https://download.virtualbox.org/virtualbox/${vboxversion}/Oracle_VM_VirtualBox_Extension_Pack-${vboxversion}.vbox-extpack"

Install it (even if an older version already exists)

sudo vboxmanage extpack install --replace Oracle_VM_VirtualBox_Extension_Pack-${vboxversion}.vbox-extpack