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…
Start by making sure you have the VirtualBox repository active.
# cat /etc/yum.repos.d/virtualbox.repo
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 (at present 4.3).
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
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:
# /etc/init.d/vboxdrv start