How to install Virtualbox Guest Additions for a Linux Guest?

Advertisements

sun virtualbox logo“We all love Virtualbox”. Installing Guest Additions on Virtualbox enables you to use some very powerful  features such as seamless integration and full screen resolution mode. You can read more about these features in an article which we have already authored. In this article we will show you how to install virtualbox guest additions in 5 easy steps: (Remember All this steps are supposed to be performed inside the guest OS, not on the Host)

1. Mount Virtualbox ISO Image by clicking on Devices > Install Guest Additions… in the Virtualbox Guest window that is currently running your Linux OS (Guest).

2. Now copy the Guest Additions Installer from the mount folder (Where the VBOXGUESTADDITIONS iso image got mounted), to your home folder. It is a file named VBoxLinuxAdditions.run. If you are using a 32 bit system, then you must rename this file to VBoxLinuxAdditions-x86.run

3. Change the filetype of VBoxLinuxAdditions-x86.run and make it executable by running the following command:

sudo chmod +x VBoxLinuxAdditions-x86.run

4. Now install dkms and the GNU C Compiler using the following command:

sudo yum -y install dkms gcc

Debian and Ubuntu Users may use this command:

sudo apt-get install dkms gcc

5. Now you have to install Build and Kernel Header files for your system. The installation depends on the type of Linux Guest you are using. For Installing the Build and Kernel Headers on a RedHat or it’s derivatives like Fedora or CentOS, you must see this. And for Installing the Build and Kernel Headers on a Debian or it’s derivatives like Ubuntu, you must see this.

6. Finally, Install Guest Additions by using the following command:

sudo ./VBoxLinuxAdditions-x86.run

In case you get an error such as “No support for OpenGL direct rendering” then you should check this tip.

Screenshot showing the successful installation of Guest Additions on a Linux Guest OS in Virtualbox

Screenshot showing the successful installation of Guest Additions on a Linux Guest OS in Virtualbox

This Guide has been successfully tested on RedHat Enterprise Linux 5, Fedora 10, Ubuntu 8.04, Ubuntu 8.10, Debian 5.0 , Fedora 11 and CentOS-5

You should now reboot your virtual machine, after which you will notice that the VM has been automatically switched to Seamless Mode and the resolution has been changed (rather upgraded) to 1024×768. You should see our article on how to enable higher screen resolutions in a Virtualbox Linux Guest OS. Should you have any problems, let us know about it in the comments.

_

   Facebook 


 Leave a Comment




Browse the Archives


RSS feed | Trackback URI

35 Comments »

2009-05-26 06:40:24

Согласен, что пост получился удачным. Хорошая работа!

 
2009-05-27 13:03:27

thanks for sharing this … I was looking for this type tutorial

 
Comment by GunnarPermalink to this comment
2009-06-01 21:42:54

Had to install yum, but otherwise your article showed exactly what was missing… ;D
Thanx!

2009-06-02 08:28:14

Install yum, as in? Yum comes pre-installed on any rpm based linux system and you have apt-get for debian based systems.

 
 
Comment by mijnkPermalink to this comment
2009-06-03 07:22:59

VirtualBox 2.2.4 Guest Additions installation
Please install the build and header files for your current Linux kernel.
I get the following with Fedora 10. I have installed the headers, gcc, etc. but I get this…

The current kernel version is 2.6.27.5-37.fc9.i686
This system does not seem to have support for OpenGL direct rendering.
VirtualBox requires Linux 2.6.27 or later for this. Please see the log
file /var/log/vboxadd-install.log if your guest uses Linux 2.6.27 and you still see this message.
Problems were found which would prevent the Guest Additions from installing.
Please correct these problems and try again.

2009-06-03 11:37:30

Hey mijnk, You cam bypass the OpenGL installation by just installing video drivers for the x11, use this command:

sudo ./VBoxLinuxAdditions-x86.run x11

 
 
Comment by kalidossPermalink to this comment
2009-06-05 13:27:32

hai friends,

i am using rhel5 ; when i am trying to install VirtualBox-2.2.2_46594_rhel5-1.i386.rpm

it said some error that

“Creating group ‘vboxusers’. VM users must be member of that group!

No precompiled module for this kernel found — trying to build one. Messages
emitted during module compilation will be logged to /var/log/vbox-install.log.

Compilation of the kernel module FAILED! VirtualBox will not start until this
problem is fixed. Please consult /var/log/vbox-install.log to find out why the
kernel module does not compile. Most probably the kernel sources are not found.
Install them and execute

/etc/init.d/vboxdrv setup

as root.”

give some solution to this problem.

2009-06-06 02:49:02

run this command in a guest terminal:

sudo /etc/init.d/vboxdrv setup

 
 
Comment by junoPermalink to this comment
2009-06-14 00:27:38

While trying to install Guest Addition on Fedora 10 I am getting ERROR :

“The current kernel version is 2.6.27.5-37.fc9.i686
This system does not seem to have support for OpenGL direct rendering.
VirtualBox requires Linux 2.6.27 or later for this. Please see the log
file /var/log/vboxadd-install.log if your guest uses Linux 2.6.27 and you still see this message.
Problems were found which would prevent the Guest Additions from installing.
Please correct these problems and try again.”

though I tried to install OpenGl using “sudo ./VBoxLinuxAdditions-x86.run x11″ but this time I am getting ERROR “VirtualBox 2.2.4 Guest Additions installation
Please install the build and header files for your current Linux kernel.” and as a result installation get fail.

please help.

 
 
Comment by mark.87Permalink to this comment
2009-06-30 18:27:35

Hi i got error whan want to isntall :
Error: Cannot retrieve repository metadata (repomd.xml) for repository: fedora. Please verify its path and try again, same error when i want to install kernel. pls help.

 
2009-06-30 18:56:57

You should see this: http://bit.ly/f11rep

 
2009-06-30 19:22:20

no x11 use this command instead
sudo ./VBoxLinuxAdditions-x86.run -nox11

 
2009-06-30 19:27:59

nox11 doesn't install x11 rite?

 
2009-07-03 11:42:52

Bravo! Nice Article.,

2009-07-13 20:55:24

Hey Judith… Thanks you liked it

 
 
2009-07-03 11:43:39

thank you dear friend,

2009-07-13 20:55:57

Welcome!

 
 
2009-07-03 11:44:29

Thank you for this site, such as multi information.I! Thank you!,

 
Comment by haxwithaxePermalink to this comment
2009-07-13 15:24:51

This guide plus the x11 switch got my FC5 guest install working. thanks.
the steps i took were:
install dkms(gcc was already installed)
moved the contents of the cd into a dir in my home dir and ran ./VBoxLinuxAdditions-x86.run x11
why the x11 switch helped i’m not sure ’cause the build failed when it tried to build the vboxdrv module but this helped. : )

2009-07-13 20:57:11

x11 switch actually makes sure the opengl graphics driver is not used. This is what i learnt from my experimentation :-)

 
 
2009-07-14 10:58:08

Hi webmaster! gui

 
Comment by SebastianPermalink to this comment
2009-09-18 18:55:37

Hi,

im Using Fedora 11 as Guest on XP Host. When trying to install the guest addition I recive the folowing Warning:

Unknown Version of the X Window System installed. Not installing X Window System drivers

thx for Your Help in Advance

 
Comment by AlPermalink to this comment
2009-10-13 21:47:55

Hi, I have a similar problem with Guest Additions 3.0.6 and the current kernel version is 2.6.29.4-167.fc11.i586, indicating to install the build and header files. Followed all instructions but still no joy.

Please help.

Kind regards, Al

 
Comment by DerekPermalink to this comment
2009-10-16 09:38:05

hi,
I am running fedora core 11 2.6.29.4-167.fc11.i586
guest additions 2.2.4
and when i run the sudo ./VBoxlinuxAddition-x86.run x11 command it returns and error that says to install the build and hearder files on your current linux kernal. Any help would be appreciated

Comment by glenPermalink to this comment
2009-10-22 04:01:53

re-read step 5, which tells you how install build and header files;

sudo yum install kernel-devel kernel-headers

you then restart, then goto step 6

 
Comment by ParikshithPermalink to this comment
2009-11-09 21:43:02

That is because yum install will always get the latest kernel headers, which may not correspond to the actual kernel version.
Use this code to get the kernel headers corresponding to your actual kernel version.

sudo yum install kernel-devel-$(uname -r)

 
 
Comment by JohnPermalink to this comment
2009-10-21 23:19:52

Hey this worked great! Thanks for sharing it. However for Ubuntu 9.04, the command is apt -y, not apt -get. Took me a little while to figure it out. Thanks again!

 
In case you have a problem to be solved or a trouble to be shot or you are looking for some help on this topic you might try the Digitizor Forums for better help and faster reply.

Name (required)
E-mail (required - never shown publicly)
URI
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment.

Trackback responses to this post