How to install Virtualbox Guest Additions for a Linux Guest?

By on May 26th, 2009     

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 1024x768. 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.

 

_




         Submit to Reddit     Stumble


Related Posts by Tags: , , , , ,



  • Pingback: What extra features are available to you on a Guest OS after installing Virtualbox Guest Addtions? « Digitizor

  • Pingback: How to change/improve the display resolution for a Linux Guest OS on Virtualbox? « Digitizor

  • http://coii.ru Avertedd

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

  • Pingback: May 26th, 2009 - Technology

  • http://www.geeksww.com shahryar ghazi

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

  • Gunnar

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

    • http://digitizor.com The Digitizor

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

  • 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.

    • http://digitizor.com The Digitizor

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

      sudo ./VBoxLinuxAdditions-x86.run x11

  • 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.

    • http://digitizor.com The Digitizor

      run this command in a guest terminal:

      sudo /etc/init.d/vboxdrv setup

  • 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.

  • Pingback: Fix the No support for OpenGL direct rendering error during Virtualbox Guest Additions installation | Digitizor

  • Pingback: How to install Virtualbox Guest Additions for a Linux Guest | patio umbrella

  • 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.

  • http://www.facebook.com/profile.php?id=642760453 Debjit Saha

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

  • http://k0n9.com Songpol

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

  • http://intensedebate.com/people/debjitsaha87 The Digitizor

    nox11 doesn't install x11 rite?

  • Judith Cook

    Bravo! Nice Article.,

    • http://digitizor.com The Digitizor

      Hey Judith… Thanks you liked it

  • Nick Smith

    thank you dear friend,

    • http://digitizor.com The Digitizor

      Welcome!

  • Brtty Robertson

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

  • 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. : )

    • http://digitizor.com The Digitizor

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

  • Kazellof

    Hi webmaster! gui

  • Pingback: Instalando Virtualbox Guest Additions no CentOS 5 » Linxcorp

  • 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

  • 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

  • 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

    • 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

    • 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)

      • Anonymous

        thanks, your post is the only one that helped me across my search of the entire web..

      • Joel

        Fantastic post Parikshith, I was pulling my hair out trying to figure out why the above guide refused to work on my PC and laptop, till i read this comment and followed your advise. Is it something to do with using a later version of fedora than the article was made for? I was using the above guide on a fedora 12 setup, and the headers and kernels would not setup with the code given in the guide, but yours worked :D Now i can enjoy mouse intergration and full size screen HOORAY!

  • 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!

  • http://guillermojmc.co.cc Guillermojmc

    Excelente post! me fue de gran utilidad

  • 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

    • http://twitter.com/venosov Víctor

      You need to install kernel-devel, as root execute: “yum install kernel-devel-$(uname -r) “

  • http://digitizor.com The Digitizor

    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

  • 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?

    • Anonymous

      Yes, you should re-install dkms after every update!

  • http://www.cheap-nikeshox.com/ cheap nikeshox

    I like it, very good
    I like it, very good, Particularly in the Authority pages.

  • Muhammad El-Sergani

    splendid!
    thanks a zillion!
    for some unforsaken reason, gcc and dkms slipped my mind :D

  • Pingback: Qbickle · Peppermint Linux OS

  • Pepo

    amazing job, thank you for this awesome how-to

  • Imagineering

    Doesn’t work.
    Ubuntu 10.04 on VirtualBox 3.2.6 on iMac OS X 10.5.8
    When I enter “sudo ./VBoxLinuxAdditions-x86.run” at the end
    I get “command not found” haven’t the faintest idea what that means.
    If I drop the actual VBox file in after sudo ./ I get the same thing.
    Trying the x11 ending,I get same thing, it’s “sod off” all the way.
    Also get “Your system does not seem to be set up to build kernel modules”
    My God, who can understand all this terminal gibberish?
    Thanks for your work guys.

    • Wickedpuppy

      First , can you do a ‘pwd’ and ‘ls’ ? You are awared that the file is in /media and not in /home/$USERNAME right? Perhaps you copied that file into your home dir? In that case your ls should show that file in your current directory.

  • Anonymous

    Please help me.
    I got this with Fedora 13.

    [root@hp VBOXADDITIONS_3.2.6_63112]# sudo ./VBoxLinuxAdditions-x86.run
    Verifying archive integrity… All good.
    Uncompressing VirtualBox 3.2.6 Guest Additions for Linux……..
    VirtualBox Guest Additions installer
    Removing installed version 3.2.6 of VirtualBox Guest Additions…
    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/vboxadd-install.log to find out what went wrong. Once you have corrected it, you can
    run

    /etc/init.d/vboxadd setup

    to build them.
    Doing non-kernel setup of the Guest Additions [ OK ]
    Installing the Window System drivers
    Installing X.Org Server 1.8 modules [ OK ]
    Setting up the Window System to use the Guest Additions [ OK ]
    You may need to restart the hal service and the Window System (or just restart
    the guest system) to enable the Guest Additions.

    Installing graphics libraries and desktop services componen[ OK ]

    When booting the system. It says. “Starting Guest Additions [FAILED] ”

    Do you know a solution?
    Sorry for my bad english.

    • http://twitter.com/venosov Víctor

      You need to install kernel-devel, as root execute: “yum install kernel-devel-$(uname -r) “

  • Pingback: [Fedora]:Instalar VirtualBox Guest Additions en Fedora Core 13 « La victácora

  • N8star10

    Nice tutorial….I’ve been trying to figure out how to do this for a while now…and no one elses worked. Yours worked the first time I tried it and you explained everything very well. Much thanks.

    • Anonymous

      glad you liked it :-)

  • http://healthweeks.com Wilford Lobbins

    hey great information your site contains will return when I have time to read more.

  • http://www.spywaresremoval.com/wmiprvse-exe.html Janel Weneck

    I have being attend to 100% the very same thoughts.

  • http://www.spywaresremoval.com/igfxtray-exe.html Lucius Koiner

    great resources here. I’ll be back for the next your posting. keep writing and happy blogging.

  • http://freebiebus.com Mariah Swails

    Hi. I go through a few of one’s other posts and wished to understand in the event you would be interested in exchanging blogroll links?

  • http://www.jobs163.com/how-to-find-my-dream-job/ find dream job

    Fascinating read, cheers! I lastly capture the important ikon.

  • http://www.bestotools.com Backlink Software

    Awesome share! Thank you very much :)

  • Pingback: Installing VirtualBox Guest Additions

  • http://brooklittle.thumblogger.com Brook Little

    Hello there, Will you be making a another article? The hubby and myself have squandered some time searching over your website and funnily enough you discussed something we were discussing only the other month with our neighbour. We very often notice ourselves quarrelling with the smallest of points, isn’t it silly?

  • http://www.kitchensonclearance.com/ kitchen remodeling

    In search of scouting temporarly to get a decent view on the subject of this specific issue . Checking in Google I now spotted this site. Seeing this kind of review So i am thrilled to enunciate that I get a fine sensation I uncovered everything that I was looking for. I will make sure to remember this website and look constantly.

  • http://68.171.62.9/Invision/index.php?showuser=86727 Bret Guetierrez

    Hello got a really quick question hope someone can help me fast, need this done in one week, one day, a few days, less then a week, really fast, fast. Here it is: F(1) = (3-2*x(1)).*x(1)-2*x(2) + 1 please help or mom are going to kill me.

  • http://www.headrushdesign.com nursing covers

    When I read a great post I do some things:1.Show it to all the close contacts.2.Bookmark it in all of the common bookmarking sites.3.Make sure to come back to the site where I read the post.After reading this article I am seriously thinking of doing all of the above.

  • http://nigeriatalkshow.com/index.php?action=profile;u=11122 Robby

    Hello, Just a quick question. not sure if I can do it in the comment but I really need to know where to find the best website to watch free tv show website. I tried the one in my sig but know it pop up a gateway and I’m tired of it.

  • http://locksmithknoxville.com Locksmith Knoxville TN

    i’m making use of oprea web-browser

  • http://www.articlesbase.com/motorcycles-articles/2009-yamaha-r1-review-3286426.html Rimson54

    This is news which will probably make Twitter explode: MTV is finalizing a deal to bring back its signature series Punk’d with teen superstar Justin Bieber as the new host. MTV is bringing back Ashton Kutcher’s reality series Punk’d and teen sensation Justin Bieber will likely be the host! According to NY Mag, Ashton will continue to serve as executive producer of celebrity hidden-camera show via his Katalyst Entertainment production organization. The show went off the air in 2007. Are you freakin’ kidding me? They finally determine to bring this back again and so they put that little…egotistic prick in Ashton’s spot? Man, I hope that this ends up as some kind of prank itself, but it doesn’t seem like it is going to be.

  • http://hubpages.com/hub/computer-repair-online-support clean malware on mac

    Thanks for the post!

  • Pingback: Still sick… but need to catch up on some work… Screen Resolution Change on VM | Jason Van's Blog

  • http://www.studentgrantshelp.org student grants

    My cousin recommended this blog and she was totally right keep up the fantastic work!

  • Hhoo

    not complaining on help….. this vbox addition has been outhere for some years now, why do we still have to look/install it as if has been never heard of?
    This should be in package somewhere. Why hasn’t anyone done it already?

    Peace

  • Pingback: Virtual Box 4, Windows 7, and Fedora 14 « Tarn Aeluin

  • Savlosmcg

    WORKS GREAT! WOOOP WOOOP!

    THANKS!

  • Hihi9200

    hi evrey one i have a problem with the 3D in virtualbox 4.0
    tks

  • Pingback: Install Guest Additions on Ubuntu

  • kaa

    Sadly, I followed the guide exactly but absolutely nothing happens when I run sudo ./VBoxLinuxAdditions-x86.run … it just gives me a new terminal prompt without giving me any output.
    Host: OSX
    Guest: Ubuntu 9.04

  • Abc

    fang pi

  • Eeric570

    Seamless mode nor the 1024×768 works. any ideas why? Lastest centos and VB installed. did exactly as the guide said.

    • Eeric570

      Nevermind had to FULLY reboot the VM, can’t just do an OS restart with CENTOS

  • Joschmaker

    Thanks for this! Helps a lot!

  • mike

    This worked great.  My VM clock now syncs with the host.  Wonderful – thank you!

  • Pingback: Virtualbox – Tutorial for installing guest additions « Vinh Pham's Blog

  • http://digitizor.com The Digitizor

    Thank you!



How to install Virtualbox Guest Additions for a Linux Guest? was originally published on Digitizor.com on May 26, 2009 - 5:55 am (Indian Standard Time)