VirtualBox Guest Additions does not compile ok 2.6.18 kernel

Discussions about using Linux guests in VirtualBox.
Post Reply
KeremE
Posts: 16
Joined: 29. Oct 2007, 05:37

VirtualBox Guest Additions does not compile ok 2.6.18 kernel

Post by KeremE »

Hi,

I was using VirtualBox 1.5.4 recently upgraded to 1.5.6. There's no proplem running Guestt Additions on my Vista and XP guests. But when I wanted to compile guest additions on CentOS 5 kernel 2.6.18.-53.1.6.el5.centos.plus.VMware kernel I got a compilation error. and it points to this line in utils.c:

Building the shared folder support kernel module.

make KBUILD_VERBOSE=1 -C /lib/modules/2.6.18-53.1.6.el5.centos.plus.VMware/build SUBDIRS=/tmp/vbox.2 SRCROOT=/tmp/vbox.2 modules
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
grep: /tmp/vbox.2/include/linux/version.h: No such file or directory
gcc -m32 -Wp,-MD,/tmp/vbox.2/.vfsmod.o.d -nostdinc -isystem /usr/lib/gcc/i386-redhat-linux/4.1.2/include -D__KERNEL__ -Iinclude
In file included from /tmp/vbox.2/vfsmod.c:93:
/tmp/vbox.2/utils.c: In function ‘sf_init_inode’:
/tmp/vbox.2/utils.c:129: error: ‘struct inode’ has no member named ‘i_blksize’
/tmp/vbox.2/utils.c: In function ‘sf_inode_revalidate’:
/tmp/vbox.2/utils.c:191: error: ‘struct inode’ has no member named ‘u’
In file included from /tmp/vbox.2/vfsmod.c:94:
/tmp/vbox.2/dirops.c: In function ‘sf_dir_open’:
/tmp/vbox.2/dirops.c:26: error: ‘struct inode’ has no member named ‘u’
/tmp/vbox.2/dirops.c: In function ‘sf_dir_release’:
/tmp/vbox.2/dirops.c:95: error: ‘struct inode’ has no member named ‘u’
/tmp/vbox.2/dirops.c: In function ‘sf_lookup’:
/tmp/vbox.2/dirops.c:261: error: ‘struct inode’ has no member named ‘u’
/tmp/vbox.2/dirops.c:296: error: ‘struct inode’ has no member named ‘u’
/tmp/vbox.2/dirops.c: In function ‘sf_instantiate’:
/tmp/vbox.2/dirops.c:350: error: ‘struct inode’ has no member named ‘u’
/tmp/vbox.2/dirops.c: In function ‘sf_create_aux’:
/tmp/vbox.2/dirops.c:372: error: ‘struct inode’ has no member named ‘u’
/tmp/vbox.2/dirops.c: In function ‘sf_unlink_aux’:
/tmp/vbox.2/dirops.c:474: error: ‘struct inode’ has no member named ‘u’
/tmp/vbox.2/dirops.c: In function ‘sf_rename’:
/tmp/vbox.2/dirops.c:542: error: ‘struct inode’ has no member named ‘u’
/tmp/vbox.2/dirops.c:543: error: ‘struct inode’ has no member named ‘u’
/tmp/vbox.2/dirops.c:544: error: ‘struct inode’ has no member named ‘u’
In file included from /tmp/vbox.2/vfsmod.c:95:
/tmp/vbox.2/regops.c: In function ‘sf_reg_write’:
/tmp/vbox.2/regops.c:115: error: ‘struct inode’ has no member named ‘u’
/tmp/vbox.2/regops.c: In function ‘sf_reg_open’:
/tmp/vbox.2/regops.c:193: error: ‘struct inode’ has no member named ‘u’
/tmp/vbox.2/vfsmod.c: In function ‘sf_read_super_aux’:
/tmp/vbox.2/vfsmod.c:268: error: ‘struct inode’ has no member named ‘u’
/tmp/vbox.2/vfsmod.c: In function ‘sf_clear_inode’:
/tmp/vbox.2/vfsmod.c:317: error: ‘struct inode’ has no member named ‘u’
/tmp/vbox.2/vfsmod.c:325: error: ‘struct inode’ has no member named ‘u’
make[2]: *** [/tmp/vbox.2/vfsmod.o] Error 1
make[1]: *** [_module_/tmp/vbox.2] Error 2

I corrected the first error by changing the cirteria to 2.6.18 from 2.6.19 but can not correct the second error.
+---
Kerem ERSOY
CISSP, CISA
KeremE
Posts: 16
Joined: 29. Oct 2007, 05:37

Post by KeremE »

Guest Additions 1.5.4 compiles and works successfully. I am not sure if 1.5.6 Guest adiitions some better features though.
+---
Kerem ERSOY
CISSP, CISA
plug
Posts: 5
Joined: 5. Sep 2007, 16:46

small bug in makefile :-)

Post by plug »

after running the install script producing these errors, just go to /tmp/vbox.0 directory that the script left over.

Edit the Makefile and find where "-DKERNEL_FC6" is added to KFLAGS.
The detection routine is buggy, it should define this symbol and it does not.

change the Makefile like this:
--- vbox.0/Makefile 2008-02-20 20:22:07.000000000 +0100
+++ vbox.1/Makefile 2008-02-24 19:16:04.000000000 +0100
@@ -172,7 +172,7 @@
endif

# build defs
-EXTRA_CFLAGS += $(INCL) $(KFLAGS) $(KDEBUG)
+EXTRA_CFLAGS += $(INCL) $(KFLAGS) $(KDEBUG) -DKERNEL_FC6

all: $(MODULE)



and all should be fine.
in case you don't know patch format, you should change the EXTRA_CFLAGS line by adding -DKERNEL_FC6



then, just run "make" and "make install" in the directory.
KeremE
Posts: 16
Joined: 29. Oct 2007, 05:37

Post by KeremE »

Hi,

Thanks for the comment. I did as you suggest and now the guest additions compile successfully. I've installed it.

now that the problem is solved the tread can be closed.

As far as I understand the make file expects ".el5" or ".fc6" be the final prefix but for people like me using non standart kernels have other prefixes after that and this confuses the make script.

Best Regards,
+---
Kerem ERSOY
CISSP, CISA
frank
Oracle Corporation
Posts: 3362
Joined: 7. Jun 2007, 09:11
Primary OS: Debian Sid
VBox Version: PUEL
Guest OSses: Linux, Windows
Location: Dresden, Germany
Contact:

Post by frank »

Actually the problem is not solved. Still the question how to detect this kernel. Please could you post the content of /lib/modules/`uname -r`/build/include/linux/utsrelease.h?
Post Reply