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.

_

Buzz This    



     Leave a Comment      Browse the Archives     


  • Ponic
    I have noticed that after each kernel update, I need to re-install guest additions.

    Does yum install dkms after kernel update would eliminate the issue of installing guest additions after each kernel update?
  • dkd903
    Yes, you should re-install dkms after every update!
  • For Your First Problem: Specify the kernel path properly for the makefile.

    For the second query: Yes, after you install the guest additions, you won't be required anymore to hit host key to move the mouse out of the virtual machine
  • Ten Bo
    I received the following message when i ran the .run file.
    Building the VirtualBox Guest Additions kernel modules [FAILED]
    (Your system does not seem to be set up to build kernel modules.
    Look at /var/log/vboxxadd-install.log to find out what went wrong)

    Makefile:23: *** Error: unable to find the sources of your current Linux kernel.
    Specify KERN_DIR= and run Make again.. Stop

    I ran the steps before and btw i run on a virtual Fedora 11 installation and the virtualbox is installed on windows XP.

    Any ideas?
    And btw, will i stop needing to hit host key to move the mounse out of the virtual machine once the additions are installed?

    Best regards
  • Excelente post! me fue de gran utilidad
  • John
    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!
  • Derek
    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
  • Parikshith
    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)
  • glen
    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
  • Al
    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
  • Sebastian
    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
  • Hi webmaster! gui
  • haxwithaxe
    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. : )
  • x11 switch actually makes sure the opengl graphics driver is not used. This is what i learnt from my experimentation :-)
  • Brtty Robertson
    Thank you for this site, such as multi information.I! Thank you!,
  • Nick Smith
    thank you dear friend,
  • Welcome!
  • Judith Cook
    Bravo! Nice Article.,
  • Hey Judith... Thanks you liked it
  • nox11 doesn't install x11 rite?
  • no x11 use this command instead
    sudo ./VBoxLinuxAdditions-x86.run -nox11
  • You should see this: http://bit.ly/f11rep
  • mark.87
    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.
  • juno
    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.
  • Hey Juno, Check this Out - the solution to your problem

    http://digitizor.com/2009/06/17/fix-no-support-...
  • kalidoss
    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.
  • run this command in a guest terminal:

    sudo /etc/init.d/vboxdrv setup
  • mijnk
    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.
  • Hey mijnk, You cam bypass the OpenGL installation by just installing video drivers for the x11, use this command:

    sudo ./VBoxLinuxAdditions-x86.run x11
  • Gunnar
    Had to install yum, but otherwise your article showed exactly what was missing... ;D
    Thanx!
  • Install yum, as in? Yum comes pre-installed on any rpm based linux system and you have apt-get for debian based systems.
  • Thank you!
  • thanks for sharing this ... I was looking for this type tutorial
  • Согласен, что пост получился удачным. Хорошая работа!
blog comments powered by Disqus

Trackbacks