Troubleshooting VirtualBox 2.1.4 Guest Additions (Ubuntu 9.04 guest)

I had a little fun trying to figure this one out today and it seems as though there wasn't any updated instructions on how to get the Guest Additions running in an Ubuntu 9.04 VirtualBox (Kubuntu 9.04 more specifically, but these directions will apply to all flavors of Ubuntu 9.04).

First of all, I'm running (as stated, but just for clarification) VirtualBox 2.1.4 on host: Ubuntu 9.04 and the guest is Kubuntu 9.04 (also verified it on Ubuntu Studio 9.04).

Here are some of the errors you may be getting:

(EE) Failed to load module "vboxvideo" (module does not exist, 0)
(EE) No drivers available.
(EE) module ABI major version (1) doesn't match the server's version (5)
(EE) Failed to load module "vboxvideo" (module requirement mismatch, 0)
(EE) No drivers available.

...among the other log info. If you are getting either of these (or something similar, i.e. different version numbers than what is shown above), then you are in the right place! Maybe.

These errors should only appear (as far as I know) after attempting to install the Guest Additions into an Ubuntu guest machine or, as other people have reported, possibly also when adjusting the display resolution in the guest machine. The reason the error arises is because the additions modify your xorg.conf file with some new/modified entries in an attempt to enable to appropriate VBox modules for video and mouse support as well as the clipboard support (I think that part is included in the mouse driver).

So here's the solution. We'll assume you have already tried at least once to install the VBox guest additions and have attempted to reboot to finalize the changes as it instructs you to. When you booted back up you most likely wound up with a black screen, or a tty login prompt (in the case of Kubuntu), or the following message (as in the case of Ubuntu standard/Studio):

In any case, just ignore the error message if any and try get to a tty (try Host+F2 if you're having trouble) where you should be able to login normally. Once in, we'll need to mount the guest additions ISO and run the guest additions installer again, with a twist.

mount /dev/cdrom
cd /media/cdrom/
sudo mkdir /tmp/ga
sudo ./VBoxLinuxAdditions-x86.run --noexec --target /tmp/ga

It should do a quick dump of the driver files to /tmp/ga. Next, go ahead and check your X Server version:

dpkg -l xserver-xorg-core

You should see something like:

The part we're interested in is just the digits from the version number (2:1.6.0), in this case a 1 and a 6. This is important to determine which drivers to use later. Now, go ahead and execute these commands:

cd /usr/lib/xorg/modules/
sudo cp /tmp/ga/vboxvideo_drv* drivers/
sudo cp /tmp/ga/vboxmouse_drv* input/
cd drivers/
sudo ln -s vboxvideo_drv_16.so vboxvideo_drv.so
cd ../input/
sudo ln -s vboxmouse_drv_16.so vboxmouse_drv.so

Important: notice that the number highlighted above represents the version number we got from dpkg -l earlier? Make sure the numbers you enter match your version as well so the correct files are linked, or you will get errors starting X again. We copied all of the driver files just in case we need any of the others at a later time (i.e. if you upgrade your X Server), but you really don't have to. At this point I usually do a ls -l on the input and drivers directories to make sure I linked to the files properly.

Once you've completed these steps everything should be fixed, and we didn't even need to touch xorg.conf! Go ahead and try starting X with startx. If everything went well it should start right up. You may want to reboot just for good measure, though it's probably not necessary.

If everything is running now, save a snapshot and you're done! You now have your Ubuntu 9.04 guest OS running with VirtualBox Guest Additions installed, and a much nicer resolution to boot.

If you encounter mouse integration issues, continue with this post.

No comments: