If Not True Then False

VirtualBox Guest Additions on Fedora 25/24, CentOS/RHEL 7.3/6.8/5.11 - Comment Page: 4

This is guide, howto install Oracle VirtualBox Guest Additions on Fedora, CentOS and Red Hat (RHEL). This guide should work with Fedora 25/24/23/22/21/20/19/18/17/16, CentOS 7.3/6.8/5.11, Red Hat (RHEL) 7.3/6.8/5.11. 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...
Categories:

235 Comments

Leave a Comment

Your email address will not be published. Required fields are marked *

Input your comment.
help

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Input your name.

Net@this

Here is the output:

[root@localhost ~]# ls -la /usr/src/kernels
total 12
drwxr-xr-x. 3 root root 4096 Nov 21 23:53 .
drwxr-xr-x. 4 root root 4096 Nov 22 00:45 ..
drwxr-xr-x. 22 root root 4096 Nov 22 00:45 2.6.32-279.14.1.el6.x86_64
[root@localhost ~]# rpm -qa kernel\* |sort
kernel-2.6.32-279.14.1.el6.x86_64
kernel-2.6.32-279.el6.x86_64
kernel-devel-2.6.32-279.14.1.el6.x86_64
kernel-firmware-2.6.32-279.14.1.el6.noarch
kernel-headers-2.6.32-279.14.1.el6.x86_64
[root@localhost ~]#

I’m not sure what I did but after getting the tools on CentOS 6.3 the files now show in the /user/src/kernels directory….
this only happen after logging in as “USER” and installing the tools under that account

The first time I ran this command “rpm -qa kernel\* |sort” before getting the tolls installed
it only showed a total of 8 and not 12…

this is day 3 of me “playing” with Linux so I’m a bit lost in all of this….

reply Reply
JR

Your output looks just normal now. It’s hard to say why you get different output now, but normally you should see all files as root user.

reply Reply
Sumi

Hi,

This is a nice guide, thank you!
But I am running into an issue at this step-

## Current running kernel on CentOS and Red Hat (RHEL) ##
KERN_DIR=/usr/src/kernels/`uname -r`-`uname -m`

I am trying to install Centos 6.3 on a Virtual Box.

When I run the above command, I get-

bash: -i686: command not found

I saw one of the earlier comments and tried the above command with a ‘-i686’ at the end, but that gave the exact same error as well.

I am stuck, and would really appreciate help!

Thank you much and regards!

reply Reply
JR

Hi Sumi,

Could you post output of following commands:


ls -la /usr/src/kernels/

uname -a
reply Reply
Sumi

Hi JR,

Thanks for your response. After my last post, I set KERN_DIR to point to 2.6.32-279.14.1.el6.i686 in usr/src/kernels. But I don’t know if that will cause any trouble. I haven’t used the virtualbox much since then. I am curious why it doesn’t like the path with the ” `uname” and stuff.

Here are the outputs of the commands you asked me to run-

[root@vmCentos sire]# ls -la /usr/src/kernels
total 16
drwxr-xr-x. 4 root root 4096 Dec 18 19:39 .
drwxr-xr-x. 4 root root 4096 Dec 18 20:31 ..
drwxr-xr-x. 22 root root 4096 Dec 18 20:31 2.6.32-279.14.1.el6.i686
drwxr-xr-x. 22 root root 4096 Dec 18 16:55 2.6.32-279.el6.i686
[root@vmCentos sire]# uname -a
Linux vmCentos 2.6.32-279.14.1.el6.i686 #1 SMP Tue Nov 6 21:05:14 UTC 2012 i686 i686 i386 GNU/Linux

Thanks and look forward to hearing from you!

reply Reply
JR

Hi again Sumi,

Yes you can use latest kernel path directly.

What you get if you try following commands:


echo /usr/src/kernels/`uname -r`

echo /usr/src/kernels/`uname -r`-`uname -m`
reply Reply
Kent Reynolds

Correction… requires dkms also… Tested on a minimal install. You should update your walkthrough.

Package requirements also include bzip2 and make

yum install gcc kernel-devel kernel-headers dkms make bzip2

reply Reply
JR

Hi Kent,

Thanks for this information! I updated this guide!

reply Reply
Barry

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?

reply Reply
JR

Hi Barry,

Did you run export KERN_DIR?


KERN_DIR=/usr/src/kernels/2.6.32-279.19.1.e16.x86_64
export KERN_DIR
reply Reply
ken

Make sure you reboot if you did the yum update kernel*.
I had the same issue until I did.

reply Reply
Steve

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

reply Reply
kcivi

Absolutely thanks, I have followed all the steps and worked. (Before this, the full screen option had not worked).

reply Reply
Morgan

For CentOS 6.3 KERN_DIR should be KERN_DIR=/usr/src/kernels/`uname -r`

uname -m is not needed.

reply Reply
JR

Hi Morgan,

And thank you for this note. I updated guide, now just CentOS 5 and RHEL 5 needs uname -m. :)

reply Reply
Murphy

Thanks for the article! I used to hate trying to install guest additions…

reply Reply
mohand

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

reply Reply
JR

Hi Mohand,

Could you post content of /var/log/vboxadd-install.log file?

And output of following commands:


rpm -qa kernel\* gcc dkms make bzip2

uname -a

lsb_release -a
reply Reply
mohand

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.

reply Reply
David Dyer-Bennet

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.

reply Reply