8

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?

Hennes
  • 64,768
  • 7
  • 111
  • 168
endolith
  • 7,507
  • 25
  • 84
  • 121

3 Answers3

6

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.

developmentalinsanity
  • 2,560
  • 1
  • 19
  • 9
  • 1
    Put that line in a file in the directory /etc/kernel/postinst.d, and it will run automatically whenever a new packaged kernel is installed. – rakslice Apr 05 '12 at 02:02
6

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.

Gilles 'SO- stop being evil'
  • 69,786
  • 21
  • 137
  • 178
  • Aha! I'd seen virtualbox-guest-additions, but it's just a copy of the ISO image. – endolith Aug 20 '10 at 14:00
  • This doesn't seem to fully work, though. The mouse is integrated, but the resolution doesn't change when the window is resized. Seamless mode is not available, etc. – endolith Aug 31 '10 at 13:32
  • @endolith: I have Ubuntu 10.04 i386 running inside closed-source VirtualBox 3.1 on a Linux amd64 host, with the OSE guest additions from the Ubuntu packages, and both these features work for me. Maybe it depends on the architecture, VirtualBox version, host OS, ... – Gilles 'SO- stop being evil' Aug 31 '10 at 19:23
  • Is this answer still valid for 12.04? – OpenCoderX Dec 17 '12 at 14:04
  • I followed this answer using Ubuntu 12.04 and it has worked fine so far. – OpenCoderX Dec 17 '12 at 14:11
  • These packages are now called: virtualbox-guest-utils virtualbox-guest-x11 virtualbox-guest-dkms Installing virtualbox-guest-dkms has the side effect of installing the guest utilities immediately, if necessary. – Cory Jun 03 '15 at 04:42
0

Another solution would be to install dkms (Dynamic Kernel Module Support).

See this answer for details.

Csq
  • 277
  • 2
  • 8