PDA

View Full Version : Unable to recompile virtualbox kernel module



cryptkpr
16th November 2008, 10:17 PM
Hi guys,

Got a problem with my VirtualBox. VirtualBox was running fine previously until one day I was no longer able to recompile the kernel module.

I'm using VirtualBox 1.6.2 on Fedora 9 i386.

=====
[root@localhost ~]# /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)

This is what the log says:
=====
tail: /var/log/vbox-install.log: file truncated
make KBUILD_VERBOSE=1 -C /lib/modules/2.6.27.5-37.fc9.i686/build SUBDIRS=/tmp/vbox.4 SRCROOT=/tmp/vbox.4 modules
make[1]: Entering directory `/usr/src/kernels/2.6.27.5-37.fc9.i686'
test -e include/linux/autoconf.h -a -e include/config/auto.conf || ( \
echo; \
echo " ERROR: Kernel configuration is invalid."; \
echo " include/linux/autoconf.h or include/config/auto.conf are missing."; \
echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; \
echo; \
/bin/false)
mkdir -p /tmp/vbox.4/.tmp_versions ; rm -f /tmp/vbox.4/.tmp_versions/*
make -f scripts/Makefile.build obj=/tmp/vbox.4
gcc -Wp,-MD,/tmp/vbox.4/linux/.SUPDrv-linux.o.d -nostdinc -isystem /usr/lib/gcc/i386-redhat-linux/4.3.0/include -D__KERNEL__ -Iinclude -I/usr/src/kernels/2.6.27.5-37.fc9.i686/arch/x86/include -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Os -m32 -msoft-float -mregparm=3 -freg-struct-return -mpreferred-stack-boundary=2 -march=i686 -mtune=generic -mtune=generic -ffreestanding -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -Iinclude/asm-x86/mach-generic -Iinclude/asm-x86/mach-default -fno-stack-protector -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -Wdeclaration-after-statement -Wno-pointer-sign -I/lib/modules/2.6.27.5-37.fc9.i686/build/include -I/tmp/vbox.4/ -I/tmp/vbox.4/include -I/tmp/vbox.4/r0drv/linux -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DCONFIG_VBOXDRV_AS_MISC -DRT_ARCH_X86 -DUSE_NEW_OS_INTERFACE_FOR_MM -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(SUPDrv_linux)" -D"KBUILD_MODNAME=KBUILD_STR(vboxdrv)" -c -o /tmp/vbox.4/linux/SUPDrv-linux.o /tmp/vbox.4/linux/SUPDrv-linux.c
In file included from /tmp/vbox.4/linux/SUPDrv-linux.c:35:
/tmp/vbox.4/SUPDRV.h:99:30: error: asm/semaphore.h: No such file or directory
/tmp/vbox.4/linux/SUPDrv-linux.c: In function ‘supdrvOSGipResume’:
/tmp/vbox.4/linux/SUPDrv-linux.c:1331: error: too many arguments to function ‘smp_call_function’
make[2]: *** [/tmp/vbox.4/linux/SUPDrv-linux.o] Error 1
make[1]: *** [_module_/tmp/vbox.4] Error 2
make[1]: Leaving directory `/usr/src/kernels/2.6.27.5-37.fc9.i686'
make: *** [vboxdrv] Error 2


I ran "make oldconfig && make prepare" in /usr/src/kernels/2.6.27.5-37.fc9.i686 and got the error below:
[root@localhost 2.6.27.5-37.fc9.i686]# make oldconfig && make prepare
scripts/kconfig/conf -o arch/x86/Kconfig
#
# configuration written to .config
#
scripts/kconfig/conf -s arch/x86/Kconfig
CHK include/linux/version.h
CHK include/linux/utsrelease.h
make[1]: *** No rule to make target `missing-syscalls'. Stop.
make: *** [prepare0] Error 2


Can anyone shed light on this? Any help would be much appreciated. Thanks a lot in advance! :)

scottro
16th November 2008, 10:32 PM
I think the easy way to do it would be something like
yum update kernel kernel-devel gcc gcc-c++

This will pull in all sorts of other things, such as kernel headers.
Unless you have a specific reason for wanting to compile the kernel itself, the packages above and their dependencies will give you the kernel sources.

To my chagrin, it's been so long since I've compiled a custom Fedora kernel (as I simply haven't had the need in months and months) I can't offer any help with that specific issue.

However, I do believe that doing the yum install that I mention, rebooting, as there will probably be a new kernel, and trying to do the /etc/init.d/vboxdrv setup again will work.

Dangermouse
16th November 2008, 10:44 PM
Hi you might be better off removing vbox and installing a more updated one, anyway the latest updates to selinux stops it from working/starting at the moment, you will need to disable selinux(unless you get a denial id leave selinux alone), hopefully this is only temporary, but it looks like your problem is you are missing the kernel-devel for your kernel.

su
yum -y install gcc kernel-devel-$(uname -r)

http://dnmouse.org/virtualbox.html

sideways
16th November 2008, 11:03 PM
You need VirtualBox 1.6.6 or newer for kernel 2.6.27-5.37.f9.i686, the kernel module won't compile in earlier versions.

Download the rpm and update using rpm -Uhv.

I would recommend updating to VirtualBox 2.0.4

http://www.virtualbox.org/wiki/Downloads

Vouters
16th November 2008, 11:30 PM
include/linux/autoconf.h missing => yum install kernel-devel
SUPDRV.h:99:30: error: asm/semaphore.h: No such file or directory => change to <linux/semaphore.h> (for kernel 2.6.27)

In /lib/modules/2.6.27.5-37.fc9.i686/build/include/linux/smp.h smp_call_function highlights the following prototype:
int smp_call_function(void(*func)(void *info), void *info, int wait);

In /lib/modules/2.6.26.6-79.fc9.i686/build/include/linux/smp.h (previous F9 kernel) smp_call_fonction had the following prototype:
int smp_call_function(void(*func)(void *info), void *info, int retry, int wait);

So to correctly compile the code, you should comment out with /* "text to comment out" */ the third argument of the smp_call_function. There may be other errors that the code to correctly build.

This is unless you find either a patch or an updated source code for the latest F9 kernel 2.6.27.5-37.

Philippe

cryptkpr
17th November 2008, 12:15 AM
You need VirtualBox 1.6.6 or newer for kernel 2.6.27-5.37.f9.i686, the kernel module won't compile in earlier versions.

Download the rpm and update using rpm -Uhv.

I would recommend updating to VirtualBox 2.0.4

http://www.virtualbox.org/wiki/Downloads

WORKED! i didn't know there was already a newer vbox version...

thanks a lot for the help! cheers! :D

cryptkpr
17th November 2008, 12:25 AM
thanks to everyone who gave their inputs. :)

marko
17th November 2008, 12:41 AM
WORKED! i didn't know there was already a newer vbox version...

thanks a lot for the help! cheers! :D

They have a built in "check for update" feature in one of the pull down menus (I think it's the right most one). It won't pull down the update, it just tells you one is there.

scottro
17th November 2008, 01:11 AM
I think that's recent. If he was using an older version, it was done manually.

At this point in time, however, it will automatically tell you there is a newer version available.