LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (http://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Latest Version of VirtualBox Kernel Errors on CentOS 5, i386 (http://www.linuxquestions.org/questions/linux-desktop-74/latest-version-of-virtualbox-kernel-errors-on-centos-5-i386-645991/)

Doctorzongo 05-30-2008 11:55 PM

Latest Version of VirtualBox Kernel Errors on CentOS 5, i386
 
Hello everyone. I installed VirtualBox on my CentOS system as an alternative to Xen.

However, when I tried to run it from the .run file it got an error. I got the .rpm file, thinking maybe there was an error with the .run file on my system. The RPM installed fine. I made a 10 GB Virtual Hard Drive and targeted my image: ~/iso/dfly-1.8.1.iso

When I tried to run the machine, however, I got a message that the VirtualBox Kernel had not been setup.

I ran:
Code:

/etc/init.d/vboxdrv setup
It failed, saying that kernel files were not found.
Code:

Stopping VirtualBox kernel module                          [  OK  ]
Recompiling VirtualBox kernel module                      [FAILED]
  (Look at /var/log/vbox-install.log to find out what went wrong)

The logfile printed out the following:
Code:

which: no dkms in (/sbin:/usr/sbin:/bin:/usr/bin)
Makefile:127: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.  Stop.

I am not sure how to fix this.

unSpawn 06-01-2008 06:33 AM

Install the kernel-devel package for your currently running kernel?

syg00 06-01-2008 07:34 AM

Maybe read the user manual that came with the package ???.
Particularly chapter 2, Installation - covers what unSpawn mentioned, plus more.

archtoad6 06-04-2008 11:42 AM

In the Debian/Ubuntu/MEPIS repos, there is a pkg. called "linux-headers-<kernel_name>".
Don't know if RH/FC/CentOS pkgs. are named the same way.

kdingo 06-14-2008 01:53 PM

Getting CentOS kernel sources to build VirtualBox kernel module
 
Hi. You're in luck because I'm doing the same exact thing (except my server is x86_64.)

You will need the kernel sources. Downloading kernel-devel or kernel-headers does not work. CentOS kernel sources aren't available through yum, so I used these steps from the CentOS wiki. http://wiki.centos.org/HowTos/I_need_the_Kernel_Source

Getting CentOS kernel sources to build VirtualBox kernel module
of course, you may not run some of these commands if you already have the packages installed.

as root:
Code:

# yum groupinstall "Development Tools"
# yum groupinstall "Development Libraries"
# yum install unifdef rpm-build

as non-root:
Code:

# su local
$ cd
$ mkdir -p rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
$ echo "%_topdir %(echo $HOME)/rpmbuild" > .rpmmacros
$ rpm -i http://mirror.centos.org/centos/5/os/SRPMS/kernel-2.6.18-53.el5.src.rpm
$ cd ~/rpmbuild/SPECS
$ rpmbuild -bp --target=`uname -m` kernel-2.6.spec

Now to make old config and modules because vboxdrv complains about it

Code:

$ cd ~/rpmbuild/BUILD/kernel-2.6.18/linux-2.6.18.x86_64
$ make oldconfig
$ make prepare
$ make

vboxdrv failed during module compilation, so I decided to build the entire kernel just to make sure. Do not run 'make install' since we don't need it.

as root:
Code:

# export KERN_DIR=/home/local/rpmbuild/BUILD/kernel-2.6.18/linux-2.6.18.x86_64/
# /etc/init.d/vboxdrv setup
Stopping VirtualBox kernel module                          [  OK  ]
Recompiling VirtualBox kernel module                      [  OK  ]
Starting VirtualBox kernel module                          [  OK  ]

You should now be able to start VirtualBox. Hopefully I didn't forget anything; it took me the whole morning to sort this out.

YouNix 06-11-2009 04:46 AM

Centos 5.3 Xen and PAE Kernels
 
Hi,
A few notes that may save someone somewhere a little bit of time.
I could not get VirtualBox to run on a Xen kernel which I had installed on a clean Poweredge 1900, 4Gb RAM, 2xQuad core Xeon. The final straw was my inability to get the actual Xen headers. Any builds I did complete complained about structs.
There were several people on different forums having lots of difficulty trying to get that configuration to work. Then I researched and found that there were issues over the future of Xen anyway so I made an executive decision to abandon it. (yes I got lazy and fustrated) So after hours of fustration I installed a PAE kernel.

YouNix 06-11-2009 04:50 AM

Installing VirtualBox on Centos 5.3 PAE Kernel
 
So here is how I installed VirtualBox on a PAE kernel

uname-a
Linux xxxxxx 2.6.18-128.el5PAE #1 SMP Wed Jan 21 11:19:46 EST 2009 i686 i686 i386 GNU/Linux


On initial install of Virtual Box I had the following error:

VirtualBox-2.2.4_47978_rhel5-1.i386

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.


After hours messing with Xen kernel I was expecting as much!
So as recommended I carried out the setup

/etc/init.d/vboxdrv setup
Stopping VirtualBox kernel module [ OK ]
Recompiling VirtualBox kernel module [FAILED]
(Look at /var/log/vbox-install.log to find out what went wrong)



Darn, here we go again..
So I updated headers for PAE kernel.

yum install kernel-PAE-devel
export KERN_DIR=/usr/src/kernels/2.6.18-128.1.10.el5-PAE-i686/


Tried the setup again but forgot that I had a clean install of centos so had to install gcc!

yum install gcc

and redid the setup

I still had errors as the compilers could not find the headers.

** Compiling vboxdrv
Makefile:145: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again. Stop.


The following declaration stating where the correct headers were did the trick.
(Note that this directory depends on the kernel version!)

export KERN_DIR=/usr/src/kernels/2.6.18-128.1.10.el5-PAE-i686/
/etc/init.d/vboxdrv setup
Stopping VirtualBox kernel module [ OK ]
Recompiling VirtualBox kernel module [ OK ]
Starting VirtualBox kernel module [ OK ]


Yay.#
Tony

ThinkFree 06-27-2009 11:20 AM

Quote:

Originally Posted by YouNix (Post 3570212)
So here is how I installed VirtualBox on a PAE kernel

uname-a
Linux xxxxxx 2.6.18-128.el5PAE #1 SMP Wed Jan 21 11:19:46 EST 2009 i686 i686 i386 GNU/Linux


On initial install of Virtual Box I had the following error:

VirtualBox-2.2.4_47978_rhel5-1.i386

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.


After hours messing with Xen kernel I was expecting as much!
So as recommended I carried out the setup

/etc/init.d/vboxdrv setup
Stopping VirtualBox kernel module [ OK ]
Recompiling VirtualBox kernel module [FAILED]
(Look at /var/log/vbox-install.log to find out what went wrong)



Darn, here we go again..
So I updated headers for PAE kernel.

yum install kernel-PAE-devel
export KERN_DIR=/usr/src/kernels/2.6.18-128.1.10.el5-PAE-i686/


Tried the setup again but forgot that I had a clean install of centos so had to install gcc!

yum install gcc

and redid the setup

I still had errors as the compilers could not find the headers.

** Compiling vboxdrv
Makefile:145: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again. Stop.


The following declaration stating where the correct headers were did the trick.
(Note that this directory depends on the kernel version!)

export KERN_DIR=/usr/src/kernels/2.6.18-128.1.10.el5-PAE-i686/
/etc/init.d/vboxdrv setup
Stopping VirtualBox kernel module [ OK ]
Recompiling VirtualBox kernel module [ OK ]
Starting VirtualBox kernel module [ OK ]


Yay.#
Tony


After doing this I see the following message
Quote:

/etc/init.d/vboxdrv setup
Stopping VirtualBox kernel module [ OK ]
Removing old VirtualBox netflt kernel module [ OK ]
Removing old VirtualBox kernel module [ OK ]
Recompiling VirtualBox kernel module [ OK ]
Starting VirtualBox kernel module [FAILED]
(modprobe vboxdrv failed. Please use 'dmesg' to find out why)
Quote:

vboxdrv: version magic '2.6.29.5-191.fc11.i686.PAE SMP mod_unload 686 ' should be '2.6.29.4-167.fc11.i586 SMP mod_unload 586 '

your_shadow03 10-20-2009 02:04 AM

I am facing same issue?

ThinkFree 10-21-2009 06:25 AM

^Give details about your system(OS, VBox version etc)

YouNix 10-22-2009 04:23 AM

Latest rev of VirtualBox
 
Hi,
I freshly installed and updated my centos 5 2.6.18-164.elPAE (uname -r) with yum upgrade.
As a precaution I installed the kernel development headers in advance of previous issues but it was not needed.
I installed VirtualBox 3.0.8 r53138 and there has been no installation, configuration or running issues so far. (Why cant everything be like this?)
Happy days,
T

kirukan 10-22-2009 04:54 AM

Did you install virtualbox using rpm?

Quote:

I installed VirtualBox 3.0.8 r53138 and there has been no installation, configuration or running issues so far.
how did you confirm that there are no installation?
check the following
Quote:

1. startup script
etc/init.d/vboxdrv
2. commands
VBox
VBoxHeadless
VBoxManage
VBoxSDL
VBoxTunctl
VBoxVRDP
VirtualBox
if all these exist just start the service

sumasage 12-14-2009 12:00 PM

Quote:

Originally Posted by kdingo (Post 3184778)

as root:
Code:

# export KERN_DIR=/home/local/rpmbuild/BUILD/kernel-2.6.18/linux-2.6.18.x86_64/
# /etc/init.d/vboxdrv setup
Stopping VirtualBox kernel module                          [  OK  ]
Recompiling VirtualBox kernel module                      [  OK  ]
Starting VirtualBox kernel module                          [  OK  ]

You should now be able to start VirtualBox. Hopefully I didn't forget anything; it took me the whole morning to sort this out.

My machine was compiling the kernel and my machine crashed. My computer just restart. Now when boot up it get to where it said starting Virtual Box kernel module (something like that, i dont remember the message correctly) then the machine just restart again.

How do i fix it? Anyway to restore the previous kernel?

Thanks for any helps.

bigstack 10-30-2010 03:04 PM

I get this when i run

Code:

/etc/init.d/vboxdrv setup
this come up

Code:

[root@191474 yum.repos.d]# /etc/init.d/vboxdrv setup
Stopping VirtualBox kernel modules                        [  OK  ]
Uninstalling old VirtualBox DKMS kernel modules            [  OK  ]
Trying to register the VirtualBox kernel modules using DKMS
Error! Your kernel headers for kernel 2.6.35.4-grsec-hostnoc-4.3.0-x86_64-libata cannot be found at
/lib/modules/2.6.35.4-grsec-hostnoc-4.3.0-x86_64-libata/build or /lib/modules/2.6.35.4-grsec-hostnoc-4.3.0-x86_64-libata/source.
                                                          [FAILED]
  (Failed, trying without DKMS)
Recompiling VirtualBox kernel modules                      [FAILED]
  (Look at /var/log/vbox-install.log to find out what went wrong)
[root@191474 yum.repos.d]#
[root@191474 yum.repos.d]#          You will not be able to start VMs until this problem is fixed.

I have searched all over the place i have tried everything that people have posted. I think there might be something wrong with my Kernel i am new to Linux idk how to update that and also i notice that my repos are looking at my data-center idk how to make them look at the CentOS ones or how to tell it to look there first. I played around with Priority for a bit and fixed a few problems.

Please Help
AIM: Bigstack14
Skype: Bigstack14

kbensch 01-18-2011 07:04 AM

This fixed it for me:

sudo yum -y install kernel-PAE-devel.i686

Kobus


All times are GMT -5. The time now is 08:45 PM.