Page 1 of 1

Virtual Box Module Fails to Compile on Latest Kernel

Posted: 28. Aug 2008, 17:33
by Tripinva
Hello:

I'm a user of Kubuntu Intrepid, and last night, an update came down which moved from the 2.6.26 kernel to 2.6.27. Now, I cannot get the VBox module to compile. Here's what the log shows:

Code: Select all

trip@trip-laptop:~/a-re$ sudo /etc/init.d/vboxdrv setup                        
 * Stopping VirtualBox kernel module                                            *  done.                                                                      
 * Recompiling VirtualBox kernel module                                        
 * Look at /var/log/vbox-install.log to find out what went wrong               
trip@trip-laptop:~/a-re$ cat /var/log/vbox-install.log                         
make KBUILD_VERBOSE=1 -C /lib/modules/2.6.27-1-generic/build SUBDIRS=/tmp/vbox.2 SRCROOT=/tmp/vbox.2 modules                                                  
make[1]: Entering directory `/usr/src/linux-headers-2.6.27-1-generic'          
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.2/.tmp_versions ; rm -f /tmp/vbox.2/.tmp_versions/*
make -f scripts/Makefile.build obj=/tmp/vbox.2
  gcc -Wp,-MD,/tmp/vbox.2/linux/.SUPDrv-linux.o.d  -nostdinc -isystem /usr/lib/gcc/i486-linux-gnu/4.3.2/include -D__KERNEL__  -Iinclude  -I/usr/src/linux-headers-2.6.27-1-generic/arch/x86/include -include include/linux/autoconf.h -Iubuntu/include  -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -O2 -m32 -msoft-float -mregparm=3 -freg-struct-return -mpreferred-stack-boundary=2 -march=i586 -mtune=generic -ffreestanding -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -Iinclude/asm-x86/mach-default -fno-stack-protector -fno-omit-frame-pointer -fno-optimize-sibling-calls -pg -Wdeclaration-after-statement -Wno-pointer-sign -I/lib/modules/2.6.27-1-generic/build/include-I/tmp/vbox.2/ -I/tmp/vbox.2/include -I/tmp/vbox.2/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.2/linux/.tmp_SUPDrv-linux.o /tmp/vbox.2/linux/SUPDrv-linux.c
In file included from /tmp/vbox.2/linux/SUPDrv-linux.c:35:
/tmp/vbox.2/SUPDRV.h:104:30: error: asm/semaphore.h: No such file or directory
/tmp/vbox.2/linux/SUPDrv-linux.c: In function ‘supdrvOSGipResume’:
/tmp/vbox.2/linux/SUPDrv-linux.c:1331: error: too many arguments to function ‘smp_call_function’
make[2]: *** [/tmp/vbox.2/linux/SUPDrv-linux.o] Error 1
make[1]: *** [_module_/tmp/vbox.2] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.27-1-generic'
make: *** [vboxdrv] Error 2
Attempting to follow the steps and run make oldconfig && make prepare gives me this:

Code: Select all

trip@trip-laptop:/usr/src/linux-headers-2.6.27-1$ make oldconfig && make prepare                                                                              
  HOSTCC  scripts/basic/fixdep                                                 
scripts/basic/fixdep.c:399: fatal error: opening dependency file scripts/basic/.fixdep.d: Permission denied                                                   
compilation terminated.                                                        
make[1]: *** [scripts/basic/fixdep] Error 1                                    
make: *** [scripts_basic] Error 2                                              
trip@trip-laptop:/usr/src/linux-headers-2.6.27-1$ sudo make oldconfig && make prepare                                                                         
[sudo] password for trip:                                                      
  HOSTCC  scripts/basic/fixdep                                                 
  HOSTCC  scripts/basic/docproc                                                
  HOSTCC  scripts/kconfig/conf.o                                               
scripts/kconfig/conf.c: In function ‘conf_askvalue’:                           
scripts/kconfig/conf.c:103: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result                                             
scripts/kconfig/conf.c: In function ‘conf_choice’:                             
scripts/kconfig/conf.c:305: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result                                             
  HOSTCC  scripts/kconfig/kxgettext.o                                          
  SHIPPED scripts/kconfig/zconf.tab.c                                          
  SHIPPED scripts/kconfig/lex.zconf.c                                          
  SHIPPED scripts/kconfig/zconf.hash.c                                         
  HOSTCC  scripts/kconfig/zconf.tab.o                                          
In file included from scripts/kconfig/zconf.tab.c:2486:                        
scripts/kconfig/confdata.c: In function ‘conf_write’:                          
scripts/kconfig/confdata.c:497: warning: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result
scripts/kconfig/confdata.c: In function ‘conf_write_autoconf’:
scripts/kconfig/confdata.c:735: warning: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result
scripts/kconfig/confdata.c:736: warning: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result
In file included from scripts/kconfig/zconf.tab.c:2487:
scripts/kconfig/expr.c: In function ‘expr_print_file_helper’:
scripts/kconfig/expr.c:1090: warning: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf -o arch/x86/Kconfig
#
# using defaults found in /boot/config-2.6.27-1-generic
#
#
# configuration written to .config
#
scripts/kconfig/conf -s arch/x86/Kconfig

*** Error during writing of the kernel configuration.

make[2]: *** [silentoldconfig] Error 1
make[1]: *** [silentoldconfig] Error 2
make: *** No rule to make target `include/config/auto.conf', needed by `include/config/kernel.release'.  Stop.
I upgraded from 1.62 to 1.64 in the hopes that it would help, but so far I've had no success.

Are there any suggestions? Should I file a bug report? If so, could someone help me figure out how to do so?

Thanks.

- Trip

Posted: 28. Aug 2008, 17:38
by Sasquatch
There has been a report of the 2.6.27 kernel before, but that was with Suse if I recall correctly. One of the devvers said it's still not supported. Wait for the new 1.6.6 release and see if it mentions this kernel in the changelog.

Strange btw, that Ubuntu is using an odd numbered kernel.

Posted: 28. Aug 2008, 17:42
by Tripinva
Sasquatch wrote:Strange btw, that Ubuntu is using an odd numbered kernel.
The kernel no longer follows that old rule about odd numbers being development releases. Each release is stable.

- Trip

Posted: 28. Aug 2008, 19:57
by portis
this problem can be solved by following:

1. delete the 104th line of /usr/src/vbox/SUPDRV.h
include <asm/semaphore.h>
2. modify the 1331 line of /usr/src/vbox/linux/SUPDrv-linux.h
smp_call_function(VBoxDrvLinuxGipResumePerCpu, pDevExt, 1);

recompile by "sudo /etc/init.d/vboxdrv setup".
Voila!

Did it work for anyone else

Posted: 29. Aug 2008, 21:40
by vikrant82
That didnt do it on 2.6.27.2

Posted: 29. Aug 2008, 23:19
by vikrant82
But this did : http://ubuntuforums.org/showthread.php?t=902105

Just that, modify /usr/share.. files instead of /usr/src..

Posted: 30. Aug 2008, 07:21
by scottro
This worked for me as well on Fedora Rawhide--today's kernel is 2.6.27-0.207.rc4.git7.fc10.x86_64 but with Rawhide, that tends to change rather quickly.

I had an older post about this, which was locked (as it almost duplicated another post that I'd missed while searching). At the time, the answer was that 2.6.27 support isn't fully implemented. I imagine that's still the case, but editing the two files as suggested in the Ubuntu thread fixed it for me.

Posted: 30. Aug 2008, 21:56
by Tripinva
Thanks! It compiled and works now!

- Trip

Posted: 10. Sep 2008, 21:51
by maxolasersquad
I am doing a new install in VirtualBox of Ubuntu 8.10. The error log indicated the problem is with /tmp/vbox.0/r0drv/linus/the-linux-kernel.h
I can edit the file to read linux/semaphore.h, but it doesn't help because the next time I run sudo /media/cdrom/VBoxLinuxAdditions.run, it extracts everything anew to /tmp/vbox.1/
How can I get it to work if installing off the CD ISO?

Posted: 10. Sep 2008, 22:49
by dsmithhfx

Posted: 11. Sep 2008, 13:54
by maxolasersquad
dsmithhfx wrote:(as posted elsewhere)

http://www.ubuntu.com/testing/intrepid/ ... n%20Issues
I had the problem listed there and was able to fix it by changing a setting in my BIOS.
The problem listed there is not my current problem. My current problem is as what's listed in this thread, I cannot install the guest additions from ISO.

Posted: 11. Sep 2008, 21:12
by Sasquatch
Max, you're hijacking this topic with a different issue. The TS has problems getting the kernel module working for his HOST. You on the other hand are having problems installing the GA in a not yet supported OS as GUEST. Please open a new topic, or wait for the OS to be final (or more developped at least).

Posted: 16. Sep 2008, 20:33
by maxolasersquad
Sasquatch wrote:Max, you're hijacking this topic with a different issue. The TS has problems getting the kernel module working for his HOST. You on the other hand are having problems installing the GA in a not yet supported OS as GUEST. Please open a new topic, or wait for the OS to be final (or more developped at least).
I misunderstood the OPs problem. I thought it was the modules for the Guest. I will start a new thread.