VirtualBox Guest Additions on Fedora 18/17, CentOS/RHEL 6.4/5.9
This is guide, howto install Oracle VirtualBox Guest Additions on Fedora, CentOS and Red Hat (RHEL). This guide should work with Fedora 18/17/16/15/14/13/12, CentOS 6.4/6.3/6.2/6.1/6.0/5.9, Red Hat (RHEL) 6.4/6.3/6.2/6.1/6/5.9.
VirtualBox Guest Additions is special software that can be installed inside Linux virtual machines to improve performance and make integration much more seamless. Among the features provided by these VirtualBox Guest Additions are mouse pointer integration and arbitrary screen solutions (e.g. by resizing the guest window).
Install VirtualBox Guest Additions on Fedora, CentOS and Red Hat (RHEL)
1. Change root user
su - ## OR ## sudo -i |
2. Mount VirtualBox Guest Additions
Click Devices > Install Guest Additions… on VirtualBox
Mount VirtualBox Guest Additions device
mkdir /media/VirtualBoxGuestAdditions mount -r /dev/cdrom /media/VirtualBoxGuestAdditions |
3. Make sure that you are running latest kernel
Update virtual machine kernel and reboot
yum update kernel* reboot |
4. Install following packages
yum install gcc kernel-devel kernel-headers dkms make bzip2 |
5. Add KERN_DIR environment variable
## Current running kernel on Fedora, CentOS 6 and Red Hat (RHEL) 6 ## KERN_DIR=/usr/src/kernels/`uname -r` ## Current running kernel on CentOS 5 and Red Hat (RHEL) 5 ## KERN_DIR=/usr/src/kernels/`uname -r`-`uname -m` ## Fedora example ## KERN_DIR=/usr/src/kernels/2.6.33.5-124.fc13.i686 ## CentOS and Red Hat (RHEL) example ## KERN_DIR=/usr/src/kernels/2.6.18-194.11.1.el5-x86_64 ## Export KERN_DIR ## export KERN_DIR |
6. Install Guest Additions
cd /media/VirtualBoxGuestAdditions # 32-bit and 64-bit systems run following ./VBoxLinuxAdditions.run |
Output looks like following:
[root@fedora VBoxGuestAdditions]# ./VBoxLinuxAdditions.run Verifying archive integrity... All good. Uncompressing VirtualBox 4.1.6 Guest Additions for Linux......... VirtualBox Guest Additions installer Removing installed version 4.1.6 of VirtualBox Guest Additions... Removing existing VirtualBox DKMS kernel modules [ OK ] Removing existing VirtualBox non-DKMS kernel modules [ OK ] Building the VirtualBox Guest Additions kernel modules Building the main Guest Additions module [ OK ] Building the shared folder support module [ OK ] Building the OpenGL support module [ OK ] Doing non-kernel setup of the Guest Additions [ OK ] You should restart your guest to make sure the new modules are actually used Installing the Window System drivers Installing X.Org Server 1.11 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 ]
7. Reboot guest system
reboot |
Then VirtualBox Guest Additions install is ready.
Check also:
Install VirtualBox (with yum) on Fedora, CentOS, Red Hat (RHEL)
98 Comments
Leave a Comment
Trackbacks/Pingbacks
- Install VirtualBox 3.2.8 on Fedora 13, CentOS 5.5, Red Hat (RHEL) 6 | If Not True Then False - [...] Groupusermod -a -G vboxusers user_nameStart VirtualBoxUse launcher or simply:VirtualBoxCheck also:Install VirtualBox Guest Additions on Fedora 13, CentOS 5.5, Red ...
- Инсталяция virtualbox 4 guest additions на centos 5. | Якши Гора - [...] Вот классная ссылка на статью о том как устанавливать virtualbox guest additions на centos 5: Install VirtualBox Guest Additions ...
- Install VirtualBox Guest Additions on Fedora 16/15, CentOS/RHEL 6/5.7 « Micro Tech Bytes - [...] http://www.if-not-true-then-false.com/2010/install-virtualbox-guest-additions-on-fedora-centos-red-h... Share this:TwitterFacebookLike this:LikeBe the first to like this post. [...]
- failed to install vbox addon on Fedora 17 - [...] guys, I'm trying to install virtualbox addon tools on Fedora 17. I'm using this guide http://www.if-not-true-then-false.co...-red-hat-rhel/ ...
- I am new in Linux OS, NEED HELP IN RED HAT 9 INTERNET CONNECTION WITH VMWARE 9 - [...] Since you also asked about virtualbox-guest-additions, follow this guide: http://www.if-not-true-then-false.co...-red-hat-rhel/ [...]
This is guide, howto install Oracle VirtualBox Guest Additions on Fedora, CentOS and Red Hat (RHEL). This guide should work with Fedora 18/17/16/15/14/13/12, CentOS 6.4/6.3/6.2/6.1/6.0/5.9, Red Hat (RHEL) 6.4/6.3/6.2/6.1/6/5.9.
I am trying to install guest additions on CentoOS 6.3 running in VirtualBox on a Windows 7 64 bit host.
Followed all the steps but get the following message in vboxadd-install.log after attempting to run sh ./VBoxLinuxAdditions.run. The only part that failed was the “Building the main Guest Additions module”.
*** Error: KERN_DIR does not point to a directory.
I have tried setting KERN_DIR to each of the following without success
KERN_DIR=/usr/src/kernels/`uname -r`
KERN_DIR=/usr/src/kernels/2.6.32-279.19.1.e16.x86_64
KERN_DIR=/usr/src/kernels
The /usr/src/kernels/2.6.32-279.19.1.e16.x86_64 does exist and has stuff in it. There is only the one directory in /usr/src/kernels
Any suggestions?
Hi Barry,
Did you run export KERN_DIR?
Make sure you reboot if you did the yum update kernel*.
I had the same issue until I did.
Yes. and I had also run source on the .bashrc file.
I found this site useful to get dkms installed
http://saadbinakhlaq.wordpress.com/tag/install-guest-additions/
Even though I still don’t seem to have guest additions installed properly, I am now able to resize to 1600×1200 resolution.
Thanks so much. I was totally stuck on how to get a Centos minimal vm to install the guest additions from bash and your instructions saved the day.
Thanks!
S
Absolutely thanks, I have followed all the steps and worked. (Before this, the full screen option had not worked).
For CentOS 6.3 KERN_DIR should be KERN_DIR=/usr/src/kernels/`uname -r`
uname -m is not needed.
Hi Morgan,
And thank you for this note. I updated guide, now just CentOS 5 and RHEL 5 needs uname -m. :)
Thanks for the article! I used to hate trying to install guest additions…
The output from terminal after having followed your howto to the letter:
[root@mohand VBOXADDITIONS_4.2.6_82870]# ./VBoxLinuxAdditions.run
Verifying archive integrity… All good.
Uncompressing VirtualBox 4.2.6 Guest Additions for Linux……….
VirtualBox Guest Additions installer
Removing existing VirtualBox DKMS kernel modules [ OK ]
Removing existing VirtualBox non-DKMS kernel modules [ OK ]
Building the VirtualBox Guest Additions kernel modules
Building the main Guest Additions module [ÉCHOUÉ]
(Look at /var/log/vboxadd-install.log to find out what went wrong)
Doing non-kernel setup of the Guest Additions [ OK ]
Installing the Window System drivers
Installing X.Org Server 1.13 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 ]
Is there a workaround?
Thanks for your contribution.
Mohand
Hi Mohand,
Could you post content of /var/log/vboxadd-install.log file?
And output of following commands:
Hi JR (Stetson and big smile?)
Thanks anyway, I managed to solve the issue by updating dkms and everything is OK now with the guest additions.
Fails on Centos 6.3 (running in VirtualBox on Windows 7). The mount command responds “you must specify the filesystem type”. (Specifying “-t autofs” or “-t iso9660″ give various other failures).
Devices / Install Guest Additions may not be working right for some reason. It does un-grey the CD icon in the bottom of the window, though (whereas Devices / CD / Remove disk greys it out).
This is not an initial installation, I’m attempting to upgrade what’s inside the virtual machine in case it matters, after upgrading to 4.2.10 externally.
Very useful.. thanks for writing up!
Thanks, needed to figure out what t was needed to get the virtualbox update on openSuse 12.3 so your part on:
yum install gcc kernel-devel kernel-headers dkms make bzip2
solved it
used yast instead ( kernel-headers not needed)
thanks