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

Post by 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/Virtualization/VirtualBox/CentOSguest . Unfortunately, this does not work. The installation process fails and the log files are saying:
[code]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]
[code]Starting the VirtualBox Guest Additions ^[[60G[^[[0;31mFAILED^[[0;39m]^M
(modprobe vboxguest failed) Starting VirtualBox Guest Addition service VirtualBox
Additions module not loaded![/code]
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

Post by 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 ...

Post by 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 ...

Post by 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 ...

Post by pschaff » 2012/05/18 18:15:54

[quote]
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?[/quote]
That should not be necessary. Have you rebooted after the update?

If still having problems please show
[code]rpm -qa | grep kernel | sort[/code]
or better yet, [url=http://www.centos.org/modules/newbb/viewtopic.php?topic_id=28723&forum=54]provide more information about your system[/url] by running "./getinfo.sh package" and showing us the output file, and
[code]cat /boot/grub/grub.conf[/code]

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

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

Post by maui_muc » 2012/05/24 06:13:02

[quote]
gerald_clark wrote:
Your booted kernel and the kernel-devel are not the same version![/quote] 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

Post by 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
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

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

Post by 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.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

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

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

Post by 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: 3
Joined: 2014/01/14 21:56:54

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

Post by 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.

Locked