How to install VirtualBox Guest Additions in Ubuntu

Yesterday I talked about how to create an Ubuntu virtual machine in VirtualBox and today I will walk through installing VirtualBox Guest Additions in Ubuntu. It, of course, requires using the command line!

The VirtualBox Guest Additions are very similar to the Virtual Machine Additions that comes with Virtual PC. They basically add a couple of nice extra features that improve performance and allow better integration between the guest OS and the host OS.

  • Ability to move mouse between guest and host OS without having to press the right CTRL key to switch.
  • Clipboard support, so you can cut and paste between the guest and host OS
  • Automatic resize of the guest OS when you resize the VirtualBox window.

Here are the steps to install Guest Additions in Ubuntu for VirtualBox:

Step 1: First start up your Ubuntu guest OS and then click on Devices and choose Install Guest Additions.

install guest additions

Now the ISO for Guest Additions will be mounted automatically and you should see the CD icon on your desktop.

Step 2: Now while inside Ubuntu, click on Applications, then Accessories, and then Terminal.

ubuntu terminal

 

Step 3: Now go to the directory where the Guest Additions are stored by typing in the following:

cd /media/cdrom

Then type ls to get a listing of the files. You should see four, two for Windows and two for Linux.

virtualbox guest additions

Since my computer is not 64-bit and we are working with Ubuntu here, we will need to run the Linux x86 installer. Go ahead and type in the following to being the installation:

VBoxLinuxAdditions-x86.run

You’ll be asked for the Administrator password and then the install will begin.

Step 4: The installer will create a few new folders, etc and install Guest Additions.

install virtualbox guest additions

Step 5: After the installation has completed, you have to restart the guest OS. You can restart Ubuntu 9.04 by clicking on your name at the top right and choosing Restart. Before Ubuntu 9.04, you had to restart by going to System first.

restart ubuntu 9.04

When Ubuntu loads up, it will display a message stating that the guest OS supports mouse pointer integration. If you see this message, it means you have successfully installed VirtualBox Guest Additions on Ubuntu.

guest additions ubuntu virtualbox

Now you can enjoy Ubuntu in a higher resolution than 800×600 since it supports 3D acceleration once Guest Additions are installed. Enjoy!

  1. Asdan says:

    Thank you Aseem ,

    I am new to Ubuntu and I tried a month ago via Googling on how to install the Virtual Additions but failed enough that I gave up. But now followed your method I was able to install it.

  2. With Ubuntu Jaunty desktop 9.04 and virtualbox 3.0 i received the message "command not found" after running sudo VBoxLinuxAdditions-amd64.run. Running the command as sudo ./VBoxLinuxAdditions-amd64.run fixed this, and installation resumed as described.

  3. frenzi says:

    Thank you for the great tutorial. Got me rocking in no time. I notice that in your quote as to what to type in the terminal to run the installer you only put "VBoxLinuxAdditions-x86.run" when in your images you have the full command entered which is the only way that worked for me as "sudo ./VBoxLinuxAdditions-x86.run". Just thought I would point that out to help avoid confusion.

    Thx again!

  4. ottzen says:

    Thanks for your Howto, but as I'm trying this, all the time the GuestAdditions install ends upp saying "This program must be run with administrator privileges. Aborting" without me ever having a chance of putting in a password Oo.

    Yes, I'm somewhat of a Linux noob, but I'd really like to get it to work!

    Please help…

    Thanks, ottzen

  5. Blackbird502 says:

    Very helpful article… will be wonderful until I get back to a real Linux machine. Cheers!

  6. SOS says:

    Excellent article. After a lot of searching and failed attempts your step by step guide helped me to install guest additions.

    I would agree with frenzi above who stated that your article didn't include the full command line of “sudo ./VBoxLinuxAdditions-x86.run” which I spotted from your screenshot.

    Many thanks

  7. ernesto says:

    Thank you !!! I forgot the ./ before the file

  8. Ashitkin Alexander says:

    Thanks! an excellent tutorial.

  9. Cat5 says:

    Thanks for a clear and effective explanation!

  10. ukdutypaid says:

    Cheers.. I've been allover for this too. 1st time it made sense and yes the ./ is missing. One soon works it out though..

    Right then, what do I do with Linux then… Also, running it as a VM completely hammers my machine. It crawls… doubt that is Ubuntu's fault though. My machine crawls anyway and this is a second operating system, I'm now running…

  11. Suman says:

    Thank you so much for the spoonfeeding.

  12. nh99 says:

    It seems like everytime there is a kernel update pushed through the update manager, you need to redo these steps.

  13. mprincipe983 says:

    In my case this procedure doesn't work. I have a WIndows XP host and a Ubuntu 9.10 guest. After step 1, the cd is not mounted automatically. My guest OS is in another iso file mounted on a cd and it seems like it cannot mount two cds at the same time … I don't know. I am not too familiar with Linux. Can anybody help?

  14. pichai says:

    I've setup guest additions in the menu, this makes CDROM VBOXADDITIONS_3. to appear in guest. But it only has folder OS2 and Readme.txt file

  15. ALvin says:

    Same crap – I only have an OS2 folder and Readme.txt which talks about where the WINDOWS drivers have gone…

    NO UBUNTU DRIVERS ON THE DISK!

  16. I like this tutorial. I think the screenshots help out quite a bit. It's one thing to outline commands, but another to display each step like this.

  17. HaydenB says:

    This is great, thanks! I've been wanting to play around with Ubuntu without getting another PC for a while now.

  18. eagle1 says:

    only getting an OS2 folder on ubuntu after clicking install guest additions. i then went to:
    http://download.virtualbox.org/virtualbox/3.1.4/
    grabbed the 3.1.4 iso and same deal…what going on here?

  19. realmrealm says:

    from the virtualbox documentation for installing linux guest additions:

    "

    Before installing the Guest Additions, you will have to prepare your guest system for building external kernel modules. This works similarly as described in Section 2.3.2, “The VirtualBox kernel module”, except that this step must now be performed in your Linux guest instead of on a Linux host system, as described there.

    Again, as with Linux hosts, we recommend using DKMS for Linux guests as well. If it is not installed, use this command:

    sudo apt-get install dkms

    Install DKMS before installing the Linux Guest Additions.

    "

  20. Fred Nurk says:

    $ sudo apt-get install linux-image-virtual linux-headers-virtual virtualbox-ose-guest-source virtualbox-ose-guest-x11

  21. Diane says:

    Thanks… worked fine.

  22. Hassan says:

    Thanks, it's helpful.

    Hassan

  23. PinGuaS says:

    muito obrigado (thanks man) XD

  24. dhillon says:

    Please help. I have installed VB 3.1.6 and made an ubuntu guest OS. I am unable to make it full screen. If I do the VB changes to fullscreen but the visual of VM remains small.

    I tried to follow guest additions but there is no option of Devices in virtual box. How can I install any guest additions?

    I get a message while starting VM that chnage the color to 32 bit under Display, but that option is also not available.

    Please help.

  25. jocull says:

    Excellent. This is exactly what I was having trouble with.

  26. dslarge says:

    Excellent! This worked very well. I'm a neophyte and now can really dig into learning Ubuntu! Thank's for the help!

  27. Vicer says:

    Thank you. This helped me as well.

  28. Alek says:

    I'm running Ubuntu 10.04 as a guest on a Macintosh OS X 10.6

    I ran into an issue where cd /media/cdrom wasn't working. I found that replacing cdrom with the name of the mounted disk worked out perfectly.

  29. TheBlindWatcher says:

    Thanks, it worked for a while, but now when I resize, huge blocks of window refuse to repaint, it becomes unusable and I have to restart. In fact, I'm going to have to uninstall this to get anything done.

  30. Ebonweaver says:

    These instructions are completely wrong (maybe just radically out of date, I'm on Virtualbox 3.2.8 with Ubuntu 10). There is no cdrom in /media and nothing auto runs when you choose install guest additions from the Virtualbox menu. You access the guest additions disk by clicking the Places menu in Ubuntu and choosing the vboxadditions volume. In the window that opens you click the Open Autorun Prompt button to install. You will then see a progress window similar to the screenshot above, and it will say press return when it's finished. At that point you reboot to use the new drivers. Much easier than using command line.

  31. Animesh Kumar says:

    I am using a guest OS of Windows XP on a Sony Vaio laptop (CS 17G). Your post was very helpful to add "guest additions". However, I still get the "Display unknown" message in Ubuntu when I open the "Display Settings" within Ubuntu.

  32. Anton says:

    Thank you, Ebonweaver.

    Your instructions worked like a charm. :-)

  33. GoodTimeTribe says:

    Your post was valuable to me today. It helped me get it working with the correct steps. Thanks a ton.

  34. gilbejam says:

    I get an error when trying to change directory, "No such file or directory."

    Since I can't change the directory, I can't navigate to the file to authenticate as administrator and run the add-ons.

    Any suggestions would be great.

  35. montecchyo says:

    Thanks very much. This tutorial was very helpful.

  36. Rick says:

    I'm stuck at the first step. When I select Install Guest Additions from the Devices menu, nothing happens. Nothing mounts anywhere and I can't go forward. What am I missing?

  37. asmgx says:

    Thanks a lot. This is very helpful

  38. Christopher says:

    Thanks, was having a helluva time with this. :)

  39. Gau says:

    Actually the right option would be:
    sudo sh VBoxLinuxAdditions.run

    In order to avoid the message:
    sudo: unable to execute ./VBoxLinuxAdditions.run: Permission denied

    Thanks by the way :)

Leave a Reply