Installing Guest Additions For Ubuntu Guests in VirtualBox

UPDATE: This post has been updated for more current releases. Please see the new Install VirtualBox Guest Additions article.

As promised in my previous post on installing VirtualBox Open Source Edititon today I’ll be going over installing the Guest Addition tools for better integration between host and guest. These steps have not been tested on other Linux distributions but I’m sure they’ll work about the same way. I tested these on Kubuntu 7.04 running atop Kubuntu 7.10 beta as the host.

Installing Linux Guest Additions in VirtualBox

VirtualBox has made it pretty easy to install the Guest Additions for improved integration between guest and host. Some of these benefits are mouse-capture improvements and improved video resolution. The mouse capture improvements now allow you to control your virtual machine when the mouse is over the window, and seamlessly return to your host when it is not. Improved video resolution should allow you to customize a better resolution for your guests.

What we need to do to install the Guest Additions is select the option from the VirtualBox menu. You’ll want to do this after your guest is running (the guest-additions are installed to the guest, not the host). Select:

Devices > Install Guest Additions...

This sometimes takes a minute so don’t worry if you don’t see anything right away. This should then prompt you and say something along the lines of:

The Guest Additions image is not found on your host. Would you like to download this image now?

We’ll select YES and let it download the image. The image is downloaded to the host machine and then mounted within the guest. This way it can be shared with future guests without needing to download multiple times. It should also prompt you whether or not you’d like to mount the image. Again, select YES.

At this point you should see a disk image mounted on your desktop. What we’ll do here is run a script that will generate the proper modules to allow for guest additions. In my preferred method we’ll do this:

  1. Open a terminal by pressing ALT-F2 and enter “gnome-terminal” on gnome or “konsole” on KDE.
  2. cd /media/cdrom
  3. sudo bash ./VBoxLinux*

This will grind away at generating the proper modules and then prompt you to restart your guest machine. Once this has finished and you’ve rebooted your guest operating system you should have the guest improvements ready to go. No additional configuration for the mouse integration should be needed, but you may have to manually update to a better resolution as wanted.

Hopefully I’ll have the tutorial for building proper network bridging soon as well. Until then, enjoy your virtualization with VirtualBox!

112 thoughts on “Installing Guest Additions For Ubuntu Guests in VirtualBox

  1. Shaun

    thanks I wanted to fix my available screen resolutions – this works great!
    (Ubuntu 7.1RC1 guest on WinXP)

  2. Jay Armstrong

    Thanks for the tip. I couldn’t make sense of it at first because the guest additions ISO was mounted funny. Now everything is running so seamlessly I had to laugh.

  3. Alistair

    nothing comes up when i click install guest edditions

  4. Dave

    Thanks, I didn’t know how to do it, but I succeeded thanks to this tutorial.

  5. Fanculo

    That crap ruined my box. How can I uninstall it? Thanks.

  6. Mikkel

    Thanks, instruction seem clear enough, but I get an error message:
    bash: ./VboxLinux*: No such file or directory

    I’ve got Dapper Drake installed in Virtualbox on Windows XP. The file I have on the guest desktop is called VBOXADDITIONS_1.5.2_25433 and has picture of a CD for an icon.

    Any further tips???

  7. Nathaniel CJE Culver

    Great tip – thanks for the help. Worked perfectly. Just one slight typo:

    sudo bash ./VBoxLinux*

    Note the uppercase B.


  8. Ubuntu Tutorials

    @Nathaniel – thank you for pointing that out. I’ve updated the post.

    @David – I’ve been tinkering with it off and on without real repeatable success yet. It is on my list however..

  9. Piet

    When I select Devices > Install Guest Additions nothing happens not even an error message. The image is nowhere on my host system, how can I get it?

  10. Peter

    Ditto the above commenter. Nothing happens when the you click “Install Guest Additions”. I’ve waiting 5 minutes already.

  11. JayWalker1

    @ Peter —Try this: Go to Devices and Unmount CD/DVD Rom — Then try install guess addition, it should come up in the desktop.

    My Problem is, i can’t change the refresh rate — when i set it to the highest, i can’t see the screen because it’s blurry — anyone?

  12. HK

    Hey! Peter and Piet! JayWalker1 was right.

    Just unmount as he says, and it’ll show up. Chances are that you already have the image, so it should begin immediately.

    Thank you, Ubuntu Tutorials and Jaywalker.

    Btw, Jaywalker, I’m not experiencing any blurriness.

    I heard something about messing around with a system file on your host, but you gotta look around.

  13. Bob

    Regarding the command to type in the terminal, I had the same problem as Mikkel (posted Nov. 3, 2007). I overcame it by typing the commands given in the tutorial, but in step 3 I typed sudo sh ./ The author was installing a Kubuntu guest on a Kubuntu host, but Mikkel and I are both installing Ubuntu on Windows xp and that seems to require the alternative command in step 3.