CentOS 6.2: VirtualBox Guest Additions -> Error: unable to find the sources ...

Issues related to applications and software problems
maui_muc
Posts: 3
Joined: 2012/05/18 10:37:04

CentOS 6.2: VirtualBox Guest Additions -> Error: unable to find the sources ...

Postby maui_muc » 2012/05/18 10:56:35

Hi there,

I am running CentOS 6.2 as guest OS on an Ubuntu 11.10 host using VirtualBox 4.1.2 from the Ubuntu repositories. I wanted to install the VB Guest Additions as described in the Wiki, http://wiki.centos.org/HowTos/Virtualiz ... entOSguest . Unfortunately, this does not work. The installation process fails and the log files are saying:

Code: Select all

tmp/vbox.0/Makefile.include.header:94: *** Error: unable to find the
sources of your current Linux kernel. Specify KERN_DIR=<directory> and
run Make again.  Stop.

Code: Select all

Starting the VirtualBox Guest Additions ^[[60G[^[[0;31mFAILED^[[0;39m]^M
(modprobe vboxguest failed) Starting VirtualBox Guest Addition service VirtualBox
Additions module not loaded!

However, the package kernel-devel - as described in the wiki - is installed properly.

Any suggestions what I did wrong?

Cheers, Stefan

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

CentOS 6.2: VirtualBox Guest Additions -> Error: unable to f

Postby gerald_clark » 2012/05/18 13:16:23

You probably need to upgrade your kernel to match the kernel-devel and reboot.

maui_muc
Posts: 3
Joined: 2012/05/18 10:37:04

Re: CentOS 6.2: VirtualBox Guest Additions -> Error: unable to find the sources ...

Postby maui_muc » 2012/05/18 17:11:04

I did a yum update and it installed a couple of new packages. Unfortunately, this does not help. at all. Installed is kernel-devel-2.6.32-220.17.1.el6.i686 and uname -r says 2.6.32-220.el6.i686 .

The log-file suggests defining $KERN_DIR. It is undefined. Where does it has to point at?

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: CentOS 6.2: VirtualBox Guest Additions -> Error: unable to find the sources ...

Postby gerald_clark » 2012/05/18 17:23:26

Your booted kernel and the kernel-devel are not the same version!

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: CentOS 6.2: VirtualBox Guest Additions -> Error: unable to find the sources ...

Postby pschaff » 2012/05/18 18:15:54

maui_muc wrote:
I did a yum update and it installed a couple of new packages. Unfortunately, this does not help. at all. Installed is kernel-devel-2.6.32-220.17.1.el6.i686 and uname -r says 2.6.32-220.el6.i686 .

The log-file suggests defining $KERN_DIR. It is undefined. Where does it has to point at?

That should not be necessary. Have you rebooted after the update?

If still having problems please show

Code: Select all

rpm -qa | grep kernel | sort

or better yet, provide more information about your system by running "./getinfo.sh package" and showing us the output file, and

Code: Select all

cat /boot/grub/grub.conf

maui_muc
Posts: 3
Joined: 2012/05/18 10:37:04

Re: CentOS 6.2: VirtualBox Guest Additions -> Error: unable to find the sources ...

Postby maui_muc » 2012/05/24 06:13:02

gerald_clark wrote:
Your booted kernel and the kernel-devel are not the same version!
Indeed, there are two different kernels present which are hard to distinguish. It is the same version just the ending is different. When selection the proper one in Grub everything works perfectly fine. Thanks you for your help!

TSU2
Posts: 3
Joined: 2013/12/30 21:20:59

Re: CentOS 6.2: VirtualBox Guest Additions -> Error: unable

Postby TSU2 » 2013/12/30 21:49:55

Hello,
I found this year old post but assume that it should still be relevant for CentOS 6.4 and 6.5 (I'm getting the same error on both).

Followed the steps described in this post, but am still getting the "unable to find sources" error.

The output for the above commands are as follows(excluding additional lines I know aren't relevant)

Code: Select all

rpm -qa | grep kernel | sort
abrt-addon-kernelloops-2.0.8.21.el6.centos.x86_64
Dracut-kernel-004-335.el6.centos.noarch
kernel-2.6.32-431.el6.x86_64
kerneldevel-26.32-431.1.2.8.1.3l6.x86_64

Code: Select all

cat /boot/grub/grub.conf
title CentOS (2.6.32-431.el6.x86_64
kernel /vmlinuz-2.6.32-431.el6.x86
initrd /initramfs-2.6.32-431.el6.x86_64.img

As you can see from the above, the "minor" kernel versions are different for the kernel and kernel source, the kernel-devel is slightly different than the running kernel but I don't know that should make a difference, but if it does make a difference, how to modify either the command to compile the VBox Guest Additions or make the kernel and source versions consistent? Of course, I'm sure the correct source has been installed (I understand that in CentOS, there isn't a source package that matches every kernel, you only need to install kernel-devel for the main CentOS version).

TIA,
TSU

User avatar
TrevorH
Forum Moderator
Posts: 21206
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: CentOS 6.2: VirtualBox Guest Additions -> Error: unable

Postby TrevorH » 2013/12/30 22:20:48

You need to have the exact same version numbers on both packages and you need to reboot into the kernel that has a version number that matches the one from kernel-devel. Running `yum update` should be enough to bring both to the same version numbers.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

TSU2
Posts: 3
Joined: 2013/12/30 21:20:59

CentOS 6.2: VirtualBox Guest Additions -> Error: unable to f

Postby TSU2 » 2013/12/31 16:26:12

Cool!
As you suggested, "yum update" aligned the source and the running kernel.

After getting over that hump, I encountered the OpenGL module build error which was addressed by
https://community.oracle.com/message/11282251

After that, the VBox Guest Additions was installed successfully.

Thx, again
TSU

horsebeef
Posts: 1
Joined: 2014/01/14 21:56:54

Re: CentOS 6.2: VirtualBox Guest Additions -> Error: unable

Postby horsebeef » 2014/01/14 21:59:44

Is it too late to contribute to this thread? I found that gcc and kernel-devel was not included with the generic desktop install so also needed to do

Code: Select all

yum install -y gcc kernel-devel
after running the updates and rebooting.