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:
- Open a terminal by pressing ALT-F2 and enter “gnome-terminal” on gnome or “konsole” on KDE.
- cd /media/cdrom
- 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!
If this article has been helpful, please consider linking to it.
I feel stupid even asking this but having trouble and looking for someone to point out the obvious. Okay, so i’ve got:
VirtualBox 2.x (just downloaded 1/09)
Host: WinXP SP3 – 32bit
Guest: gOS 3 (Ubuntu 8.04/Hardy)
I have an AMD 5000+ X2 and (nForce4/Gforce6100) and am unsure whether to use the “x86.run” or “amd64.run”? and what happens if i run both for good measure? does that screw things up?
I too searched on many of the forums about how to get the problem resolved.
Finally I came across the fact that the latest version of Virtual Box (2.1) has good support for UBuntu.I Downloaded and configured my Ubuntu 8.10 image (Guest) on Windows XP SP2 (Host).
Now I’m able to run VBoxLinuxAdditions-x86.run with out any problem and am able to install GuestAdditions also.
And the best thing is Virtual Box 2.1 does a lot of things for you automatically.
So enjoy your time with Virtual Box 2.1
Thanks… it worked great!!!
Questions:
I have Virtual Box 2.1 installed on a Host that consists of: WinXP sp3 32bit on Athlon 5000X2. The guests are (32bit) Ubuntu 8.04 and OpenSolaris. Do I execute the x86 or amd64 string in the “sudo bash ./VBoxLinux*” command?
Also, if I already did one of them, and then typed in the other, does it screw everything up? If so, how should I fix it?
I tried this on my Ubuntu 8.10 guest, but after it installed the kernel modules it crashes saying ‘unknown version of X window system’. Anyone know how to fix this?
For Jarno and Ubunto 8.10 users.
Mount the VBoxGuestAdditions.iso then you have to install DKMS in Linux guests.
If it is not installed open terminal and use this command:
sudo apt-get install dkms
and answer “yes” to the question.
Then change to the directory where your iso CD-ROM drive is mounted, you have to type such a command like this
cd /media/cdrom0
finally type this:
sudo sh ./VBoxLinuxAdditions-x86.run
input your password if necessary.
I hope it’s useful.
I tried this:
“sudo ./VBoxLinuxAdditions-x86.run”
and works perfect…
Host: Windows 7
Guest: Ubuntu 8.10
This worked great even with Crunchbang Linux 8.10!
I get as far as inputting my password, which it won’t allow me to do.
Thanks for this. I was having problems understanding why my virtualbox wouldn’t load the additions (they were already mounted)
I had a problem getting it to work on my 64 bit Ubuntu, ended up I had to specify the file and use the All command. I input:
sudo bash ./VBoxLinuxAdditions-amd64 all
Worked fine! And newish versions of VBox all have the correct Additions btw
Belindo Filobeo,
Installing the dkms in ubuntu 8.10 guest i continue having the problem
hi i’m using Ubuntu 8.10 and whenever i try to install guest additions it starts to install but then it says
Unknown version of the X Window System installed.
don’t know if this has anything to do with it but i installed it on an external hard drive. any thoughts???
After step 2 i.e. “cd /media/cdrom” do :
3. Type “sudo bash ./VBoxLinuxAdditions-x86.run” if you have an intel CPU
OR
Type “”sudo bash ./VBoxLinuxAdditions-amd64.run” if you have an AMD CPU.
Done…worked like a charm…have a question now on “shared folder”….I’m a noob so bare with me…how would I mount this inside the Ubuntu guest….I created a folder on my Host XP desktop and want to see it in guest ubuntu.
thx…jc
Yes awesome now the mouse isnt stuck in the window and i dont need to press the host key to free it
My question is does this work in 8.10 as the article is based in an earlier edition
Thanks
Installing Guest Additions should be roughly the same for any Ubuntu release. Give it a try. If it does not, leave a comment here and I’ll try to update the post.
Nothing worked as advertised, I finally got going as follows:
VirtualBox 2.2 on Vista host, running ubuntu 8.10 as guest.
Selecting “devices – Install Guest Additions” did not do anything, /media/cdrom was empty, so I downloaded the iso from virtualbox and saved it in a folder on the vista host.
Goto http://download.virtualbox.org/virtualbox/ and look for the folder for your version (x.x.x) of virtualbox. From in there download VBoxGuestAdditions x.x.x.iso
Start your ubuntu guest and login. Install dkms
sudo apt-get install dkms
reboot the ubuntu box.
There is a bug with ubuntu 8.10, dkms points to wrong kernel header version, so the VBoxLinuxAdditions.run script will fail.
Check which kernel you have.
uname -r
Outputs something like: 2.6.27-11-generic (note this last bit)
Now, fix the incorrect headers problem. (replace generic with your uname output).
sudo apt-get install linux-headers-generic
Almost done, the VBoxGuestAdditions.iso must be mounted.
From the menu in your ubuntu guest window, select
“devices – mount CD/DVD Rom”
Now select option “CD/DVD Rom image” and choose the VBoxGuestAdditions iso file you saved in the vista host earlier.
Now ensure the iso is properly mounted as a cdrom in the guest.
sudo mkdir -p /mnt/cdrom
sudo mount -t iso9660 /dev/scd0 /mnt/cdrom
the cdrom device may differ on your guest, check the output of: ls -l /dev/cdrom
Finally, run the additions script in thu ubuntu guest::
cd /mnt/cdrom
sudo sh ./VBoxLinuxAdditions-x86.run
Worked for me, YMMV.
Works on 9.04 with 2.2.0, but it comes with 64 bit drivers, so run the command without the wild card.
It was really great , thank you verry much but now a little update, the command in the terminal is for Ubuntu 9.04:
" sudo bash VBoxLinuxAddition-x86.run"
Good luck!
There is a very nicely done guide on explaining the entire process of installing the Guest Additions for a Linux Guest. The article also gives an insight to all the problems that you may encounter: http://digitizor.com/2009/05/26/how-to-install-vi...
THANK YOU WES !!!
I found this useful – thank you for your effortss
Hi, I get the following error when I execute the command "sudo bash ./VBoxLinux*" : Detected unsupported x86 environment, what can I do? thanks in advance
Thanks to Wes and Timbo. I entered full filename in step 3 and managed to install guest additions in Ubuntu 9.04 guest on Windows XP SP3 host. But as someone who has been programming for 30 plus years, I can understand why non-techies are slow to move to Linux. I was searching for two days and trying different suggestions, none of which worked mainly because they dealt with older releases, before I found this forum.
I'm running Ubuntu 9.0.4 and trying to install Guest Additions from Vbox 3.0.8.
I got this error " Detected unsupported x86 environment.
To fix this write:
sudo bash ./VBoxLinuxAdditions-86.run
Hope that helps
great!
but the correct command is:
sudo bash ./VBoxLinuxAdditions-x86.run
thanks anyway
Great, it works!
but the correct command is this:
sudo bash ./VBoxLinuxAdditions-x86.run
when i m trying to install guest addition for ubuntu on my window7 host…the terminal window comes but its saying , " u need administrator privilege " ….and i don't know how to give a program administrator privilege in ubuntu…plz any body help me out..
Thanks
Running WIndows 7 64 bit Host with VirtualBox 3.0.10 and Ubuntu 9.1 Needed the VBoxLinuxAdditions-x86.run command (not the amd64 version) and now works fine. needed to reinstall aftre the 9.04 to 9.1 upgrade
thank you this really helped me out.
Thanks for the tutorial. Up and working with
Win7 64-bit host, VirtualBox running Ubuntu 9.1 and XP-Pro
Most useful! Thanks very much
Thanks dude
Thank you!
Works just fine! I do however need to re-install it from time to time since the mouse integration and the full screen does not work. Any ideas why?
Alright, I myself had a HUGE amount of issues trying to get Guest Additions installed on my ubuntu guest os with windows 7 host. After tons of searching I found that I needed several other packages.
sudo apt-get install dkms build-essential linux-headers-server
I myself am running the server version, I guess you just replace server with whatever you are running. After installing these packages and manually mounting the guest additions cd I was able to install them from the terminal. The mouse integration and full screen both work great perfectly now.
Hope this helps anyone who is still having trouble.
@gbo
It will not harm if you install x86
Just a tip for anyone who’s been searching for ‘Guest Additions’ help — Sun (now Oracle) has always included a very thorough, detailed ‘User Manual’ that’s a part of each install. Also on virtualbox.org. The ‘VBoxGuestAdditions.iso’ is put on your hard drive with each install as well. Both are updated with each new version release and Sun (err, Oracle) has done an especially nice job updating the User Manual in accordance with each release.
Online help like the above is often helpful but there’s a lot of pertinent info already included in each VB install. (Also, the User Manual comes as a pdf with a clearly labeled Index.)
@Aaron Your password should work. If it’s running like it is on mine, it won’t show any symbols when you type, but it will accept it once you’ve typed it and press enter.
this method did not work for me – osx snow leopard host, linux mint guest. I got an unsupported x86 error — read somewhere else to go into the guest additions folder and run the autorun.sh file. Did that and it worked
All: this post has been a great resource over the time it’s been running; thanks to all the commenter for the updates over time, it got me out of a hole and a couple of readers of my blog also. RC
ok .. this is all driving me a little silly … not sure if I’m just doin something wrong or what … Host is Windows 7 Guest is Ubuntu 10.04
I have the Guest Additions mounted, but every time I pull up a terminal window and try to run the scrips in this thread, all I get is “file or directory not found” and nothing
All I want to do is Not have to keep hitting Right-Ctrl to get my mouse out of the window, and be able to make the window larger .. right now when I make the window larger, Ubuntu stays same size as it did when it boots (I hope that makes since) .. book marking page for help
Jason, check this page, I just installed ubuntu 10.04 on win7 in virtual box too. worked very good
http://helpdeskgeek.com/linux-tips/install-virtualbox-guest-additions-in-ubuntu/
That looks AWSOME .. but I still cant get it to work
when I mount the guest additions and get the CD on the desktop I’m good. Then when I open a terminal and type in “cd /media/cdrom” all I keep getting is “file or directory not found” and then nothing .. when the treminal opens it shows being in “jason@jason ~ desktop” did I do something wrong or am I just totally missing something?
I’m running Windows 7 64bit and have Ubuntu 10.04 32bit guest with x86 guest additions installed. Mouse/Keyboard integration works great and I can resize VM window and the Ubuntu desktop resizes fine, but the full screen and seemless modes are not working. Both appear to have the same problem. When I go to full screen mode the display updates and I can see Ubuntu in full screen but the graphics are non-responsive except for the mouse cursor. If I move the mouse cursor over a menu item then click it nothing happens. If I exit full screen I can see that the menu did indeed open sine the screen has now refreshed.
Thanks in advance for any help anyone can offer,
Jacob