After setting up a headless VirtualBox environment on your server, there comes a time when you realize you’ve been using the same old version for so long… that updating doesn’t sound so bad.
If you’ve installed VirtualBox from the repositories, you might enjoy an (almost) painless update procedure. Or not…
Checks & cleanup
Start by making sure you have the VirtualBox repository active.
name=Oracle Linux / RHEL / CentOS-$releasever / $basearch - VirtualBox
Remember the VirtualBox version you are running, or check the installed version with:
yum --enablerepo=virtualbox info VirtualBox*
You can also find the current version in the headless web interface or console program.
Before updating, you need to close all of VirtualBox’s running services. Find out which ones are running with:
ps ax | grep virtualbox
Stop the respective services (or kill them manually if they don’t have a service).
Once you’re sure that all VirtualBox related processes are closed, run
yum --enablerepo=virtualbox update VirtualBox-X.Y
where X.Y is the correct version number.
If you’re switching between major versions, uninstall the old version first, then install the new one
yum --enablerepo=virtualbox remove VirtualBox-X.Y
yum --enablerepo=virtualbox install VirtualBox-X.Z
If all goes well, you should now be running the latest VBox version. The last thing to do is to install the latest VirtualBox additions as well. Grab the correct version from https://www.virtualbox.org/wiki/Downloads and install it with
# vboxmanage extpack install Oracle_VM_VirtualBox_Extension_Pack-X.Y.ZZ-BUILD.vbox-extpack
1. If virtual machines fail to start after the update (complaining of missing modules), check that the VBox kernel modules are loaded:
lsmod | grep vbox
vboxpci 13877 0
vboxnetadp 18384 0
vboxnetflt 17461 0
vboxdrv 419479 4 vboxpci,vboxnetadp,vboxnetflt
If they are missing, try manually starting the module manager:
2. If you’re having trouble with remote desktop being unavailable although the extension package is installed
00:00:00.221835 Oracle VM VirtualBox Extension Pack (Version: 5.2.24 r128163; VRDE Module: VBoxVRDP)
00:00:00.224866 VRDE: VirtualBox Remote Desktop Extension is not available.
try to also install it as the user VirtualBox is running under – normally vbox:
vboxmanage extpack install <.vbox-extpack file>
For other possible issues and solutions also see the getting started with headless VirtualBox article.