Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
    
SUSE Linux comes with the VirtualBox additions. I thought the same would hold for Ubuntu. –  Andrew J. Brehm Aug 19 '10 at 22:14

3 Answers 3

up vote 4 down vote accepted

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.

share|improve this answer
    
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 Aug 31 '10 at 19:23
    
Is this answer still valid for 12.04? –  opensourcechris Dec 17 '12 at 14:04
    
I followed this answer using Ubuntu 12.04 and it has worked fine so far. –  opensourcechris Dec 17 '12 at 14:11

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.

share|improve this answer
    
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 5 '12 at 2:02

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

See this answer for details.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.