Virtualbox - Install Guest Additions over again every time Linux kernel updates

I have Ubuntu running as a Virtualbox, and every time it upgrades the kernel, the Guest Additions stop working. The install process in Linux requires using a virtual CD, running scripts from the command line, etc. and it's annoying.

Is there any way to keep the guest additions constantly working even when the kernel is upgraded? Can they be installed as Ubuntu packages instead of installing off the virtual CD?


Ubuntu provides the guest utilities from the open source edition of Virtual Box. As far as I know, there is no difference between the two editions as far as the Linux guest utilities are concerned (for example, with a closed source edition of VirtualBox, you can access USB devices from a Linux guest even if the VM has the open source guest utilities).

The packages are virtualbox-ose-guest-utils, virtualbox-ose-guest-x11 and virtualbox-ose-guest-dkms. With that last package installed, the necessary kernel modules are compiled automatically when you upgrade the kernel.


You can recompile the kernel modules with

/etc/init.d/vboxadd setup

That way, you don't need to reinstall them - just rebuild the modules after a kernel update.