Page 1 of 1

guest additions not set up to build kernel

Posted: 13. Feb 2010, 13:36
by rainbow3
I had virtualbox guest additions working fine in ubuntu64 on windows 7 host. Then one day it just was not workin. I cannot get it to reinstall. It says your system does not seem to be set up to build kernel modules. I have googled this and installed everything suggested. I have downloaded the correct headers for the kernel version. BUt still the same message. The log file has masses of errors in so I guess there is some problem with the headers but how do I fix? The log is attached.

Code: Select all

make KBUILD_VERBOSE=1 -C /lib/modules/2.6.31-19-generic/build SUBDIRS=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 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.0/.tmp_versions ; rm -f /tmp/vbox.0/.tmp_versions/*
make -f scripts/Makefile.build obj=/tmp/vbox.0
  gcc -Wp,-MD,/tmp/vbox.0/.test.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/4.4.1/include  -Iinclude  -I/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include -include include/linux/autoconf.h -Iubuntu/include  -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m64 -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-stack-protector -fomit-frame-pointer -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fno-dwarf2-cfi-asm -I/lib/modules/2.6.31-19-generic/build/include -I/tmp/vbox.0/ -I/tmp/vbox.0/include -I/tmp/vbox.0/r0drv/linux -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -D_X86_ -DIN_RT_R0 -DIN_SUP_R0 -DVBGL_VBOXGUEST -DVBGL_HGCM -DVBOX_WITH_HGCM  -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(test)"  -D"KBUILD_MODNAME=KBUILD_STR(vboxadd_test)"  -c -o /tmp/vbox.0/test.o /tmp/vbox.0/test.c
In file included from include/linux/prefetch.h:14,
                 from include/linux/list.h:6,
                 from include/linux/module.h:9,
                 from /tmp/vbox.0/test.c:11:
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/processor.h:115: error: ‘CONFIG_X86_L1_CACHE_SHIFT’ undeclared here (not in a function)
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/processor.h:115: error: requested alignment is not a constant
In file included from include/linux/prefetch.h:14,
                 from include/linux/list.h:6,
                 from include/linux/module.h:9,
                 from /tmp/vbox.0/test.c:11:
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/processor.h:161:1: warning: "cache_line_size" redefined
In file included from /usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/processor.h:28,
                 from include/linux/prefetch.h:14,
                 from include/linux/list.h:6,
                 from include/linux/module.h:9,
                 from /tmp/vbox.0/test.c:11:
include/linux/cache.h:64:1: warning: this is the location of the previous definition
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/processor.h: In function ‘load_cr3’:
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/processor.h:192: error: ‘CONFIG_PAGE_OFFSETUL’ undeclared (first use in this function)
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/processor.h:192: error: (Each undeclared identifier is reported only once
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/processor.h:192: error: for each function it appears in.)
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/processor.h: At top level:
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/processor.h:241: error: requested alignment is not a constant
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/processor.h:272: error: requested alignment is not a constant
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/processor.h: In function ‘wbinvd_halt’:
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/processor.h:777: error: implicit declaration of function ‘halt’
In file included from /usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic.h:4,
                 from /usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/thread_info.h:24,
                 from include/linux/thread_info.h:56,
                 from include/linux/preempt.h:9,
                 from include/linux/spinlock.h:50,
                 from include/linux/seqlock.h:29,
                 from include/linux/time.h:8,
                 from include/linux/stat.h:60,
                 from include/linux/module.h:10,
                 from /tmp/vbox.0/test.c:11:
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h: At top level:
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h:201: warning: type defaults to ‘int’ in declaration of ‘atomic64_t’
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h:201: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h:213: error: expected ‘)’ before ‘*’ token
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h:225: error: expected declaration specifiers or ‘...’ before ‘atomic64_t’
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h: In function ‘atomic64_add’:
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h:228: error: ‘v’ undeclared (first use in this function)
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h:227: error: invalid lvalue in asm output 0
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h:227: error: memory input 2 is not directly addressable
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h: At top level:
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h:239: error: expected declaration specifiers or ‘...’ before ‘atomic64_t’
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h: In function ‘atomic64_sub’:
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h:242: error: ‘v’ undeclared (first use in this function)
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h:241: error: invalid lvalue in asm output 0
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h:241: error: memory input 2 is not directly addressable
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h: At top level:
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h:255: error: expected declaration specifiers or ‘...’ before ‘atomic64_t’
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h: In function ‘atomic64_sub_and_test’:
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h:260: error: ‘v’ undeclared (first use in this function)
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h:259: error: invalid lvalue in asm output 0
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h:259: error: memory input 3 is not directly addressable
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h: At top level:
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h:271: error: expected ‘)’ before ‘*’ token
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h:284: error: expected ‘)’ before ‘*’ token
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h:299: error: expected ‘)’ before ‘*’ token
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h:317: error: expected ‘)’ before ‘*’ token
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h:336: error: expected declaration specifiers or ‘...’ before ‘atomic64_t’
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h: In function ‘atomic64_add_negative’:
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h:341: error: ‘v’ undeclared (first use in this function)
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h:340: error: invalid lvalue in asm output 0
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h:340: error: memory input 3 is not directly addressable
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h: At top level:
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h:353: error: expected declaration specifiers or ‘...’ before ‘atomic64_t’
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h: In function ‘atomic64_add_return’:
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h:357: error: ‘v’ undeclared (first use in this function)
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h:356: error: invalid lvalue in asm output 1
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h:356: error: memory input 3 is not directly addressable
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h: At top level:
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h:362: error: expected declaration specifiers or ‘...’ before ‘atomic64_t’
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h: In function ‘atomic64_sub_return’:
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h:364: error: ‘v’ undeclared (first use in this function)
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h:364: error: too many arguments to function ‘atomic64_add_return’
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h: At top level:
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h:370: error: expected ‘)’ before ‘*’ token
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h:375: error: expected ‘)’ before ‘*’ token
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/atomic_64.h:425: error: expected ‘)’ before ‘*’ token
In file included from include/linux/mmzone.h:16,
                 from include/linux/gfp.h:4,
                 from include/linux/kmod.h:22,
                 from include/linux/module.h:13,
                 from /tmp/vbox.0/test.c:11:
include/linux/nodemask.h: In function ‘__first_node’:
include/linux/nodemask.h:239: error: implicit declaration of function ‘find_first_bit’
include/linux/nodemask.h: In function ‘__next_node’:
include/linux/nodemask.h:245: error: implicit declaration of function ‘find_next_bit’
include/linux/nodemask.h: In function ‘__first_unset_node’:
include/linux/nodemask.h:263: error: implicit declaration of function ‘find_first_zero_bit’
In file included from include/linux/gfp.h:4,
                 from include/linux/kmod.h:22,
                 from include/linux/module.h:13,
                 from /tmp/vbox.0/test.c:11:
include/linux/mmzone.h:251:5: warning: "MAX_NR_ZONES" is not defined
include/linux/mmzone.h:253:7: warning: "MAX_NR_ZONES" is not defined
include/linux/mmzone.h:255:7: warning: "MAX_NR_ZONES" is not defined
In file included from include/linux/gfp.h:4,
                 from include/linux/kmod.h:22,
                 from include/linux/module.h:13,
                 from /tmp/vbox.0/test.c:11:
include/linux/mmzone.h: At top level:
include/linux/mmzone.h:288: error: ‘MAX_NR_ZONES’ undeclared here (not in a function)
In file included from include/linux/elf.h:7,
                 from include/linux/module.h:14,
                 from /tmp/vbox.0/test.c:11:
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/elf.h: In function ‘start_ia32_thread’:
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/elf.h:165: error: implicit declaration of function ‘load_gs_index’
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/elf.h: In function ‘elf_common_init’:
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/elf.h:180: error: ‘struct thread_struct’ has no member named ‘fs’
In file included from include/linux/tracepoint.h:18,
                 from include/linux/module.h:19,
                 from /tmp/vbox.0/test.c:11:
include/linux/rcupdate.h:64:2: error: #error "Unknown RCU implementation specified to kernel configuration"
In file included from include/linux/module.h:19,
                 from /tmp/vbox.0/test.c:11:
include/linux/tracepoint.h: In function ‘tracepoint_synchronize_unregister’:
include/linux/tracepoint.h:156: error: implicit declaration of function ‘__synchronize_sched’
In file included from include/linux/slab_def.h:144,
                 from include/linux/slab.h:166,
                 from include/linux/percpu.h:5,
                 from /usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/local.h:4,
                 from include/linux/module.h:20,
                 from /tmp/vbox.0/test.c:11:
include/linux/kmalloc_sizes.h:5:5: warning: "CONFIG_X86_L1_CACHE_SHIFT" is not defined
include/linux/kmalloc_sizes.h:9:5: warning: "CONFIG_X86_L1_CACHE_SHIFT" is not defined
In file included from include/linux/module.h:22,
                 from /tmp/vbox.0/test.c:11:
/usr/src/linux-headers-2.6.31-19-generic/arch/x86/include/asm/module.h:68:2: error: #error unknown processor family
make[2]: *** [/tmp/vbox.0/test.o] Error 1
make[1]: *** [_module_/tmp/vbox.0] Error 2
make: *** [vboxadd_test] Error 2
MOD Edit: Please use code blocks for long or log files

Re: guest additions not set up to build kernel

Posted: 13. Feb 2010, 16:17
by Perryg
What version of Ubuntu are you using?
Do you really have the OSE version of VirtualBox installed and what version are you using?
Post the guests log file (as an attachment)

Re: guest additions not set up to build kernel

Posted: 13. Feb 2010, 17:01
by rainbow3
Version 9.10
I don;t know what the OSE version is (it was a mandatory question to register on the forum and I did not know the answer so I picked one!). I have virtualbox 3.1.4. I have since installed another virtual machine that is working fine with the same linux distro and guest additions.

Re: guest additions not set up to build kernel

Posted: 13. Feb 2010, 18:37
by Perryg
Ok the guests log file is located in the main VBox program. Click once on the guest then at the top click machine show log then click save.
Post as an attachment.

I am also seeing corruption in the files you sent. weird characters. Are you seeing these as well?
Any way that the OS could have become corrupt?

Re: guest additions not set up to build kernel

Posted: 13. Feb 2010, 18:46
by rainbow3
I dont see any weird characters.

Re: guest additions not set up to build kernel

Posted: 13. Feb 2010, 18:56
by Perryg
I am guessing that you did not have dkms installed to begin with.
have you installed the headers for the new kernel?
The guest additions are not happy at all for some reason.
Also I have read that some people had problems when updating to the newer versions of VirtualBox and they had to update their PCs bios to get it to play nicely.

Re: guest additions not set up to build kernel

Posted: 13. Feb 2010, 19:23
by rainbow3
Well it was working fine for a few weeks until it stopped working so it was presumably installed correctly the first time. Installed the headers with apt-get install linux-headers-$(uname-r) so it must have the right version. I only upgraded to the new vbox version after this stopped working so it is nothing to do with the new vbox version. Also I have another virtual machine working fine on the same vbox and same ubuntu version that I have created since. So this linux has got confused somehow. Perhaps something is corrupt but is there a way of forcing it to repair itself?

Re: guest additions not set up to build kernel

Posted: 13. Feb 2010, 19:42
by Perryg
Probably, but my guess is that Ubuntu updated something that caused the GAs to stop working. Usually this is just after a kernel update. Which would cause a mismatch in the headers. Normally I install dkms to keep this from happening. since it will recompile the kernel mode drivers for you.
Can you verify that the kernel that you are using and the headers actually match?
Also unless this is the server version of Ubuntu the generic headers will work and should keep them up to date when you install a new kernel.

Re: guest additions not set up to build kernel

Posted: 13. Feb 2010, 20:32
by rainbow3
uname -r shows 2.6.31.19
synaptic package manage shows linux-headers-2.6.31-19 and linux-headers-2.6.31-19-generic. However there are also headers installed for previous versions as well. Should I uninstall these?

Re: guest additions not set up to build kernel

Posted: 13. Feb 2010, 21:05
by Perryg
You should not need to but it will not hurt anything to clean them up.
Just to be clear, you can run the guest but the guest additions fail to install? And this was working in the previous version with the GAs installed. Which VirtualBox version was the original?
  • You may need to post this to bugtracker. You will need to setup an account there as it is on a different system.
    It would also help if you can post the ticket number here so other can see the progress, add information, or see the final results.
I can't think of anything else to ask you. There must be something but I am missing it.

Re: guest additions not set up to build kernel

Posted: 13. Feb 2010, 21:13
by rainbow3
Yes I can run the guest but the guest additions fail to install. It was working in 3.1.2 with the GAs installed. Then one day I booted up and the guest additions did not work any more. Thanks for trying.

Re: guest additions not set up to build kernel

Posted: 13. Feb 2010, 21:29
by rainbow3
logged on bugreport 6184

Re: guest additions not set up to build kernel

Posted: 20. Feb 2010, 12:42
by rainbow3
I have solved this. Must have been some corruption of the kernel headers so it thought they were installed when there was a file missing or something. Have added a note to the bug report.

apt-get remove kernel-headers-$(uname -r)
apt-get install kernel-headers-$(uname-r)

Re: guest additions not set up to build kernel

Posted: 10. Mar 2010, 11:23
by rainbow3
Sorry that should be:

apt-get remove linux-headers-$(uname -r)
apt-get install linux-headers-$(uname-r)

Re: guest additions not set up to build kernel

Posted: 7. Nov 2010, 23:41
by daocampo
For those of you running Fedora, do the following to resolve this issue:
login as superuser in terminal, at the $ prompt, type: su -
you will be prompted to enter your [root] password
at the # prompt, type: yum install binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel
enter y to install the package (and again if prompted to install additional packages)
when completed, you will see the message in terminal: Complete!
This will resolve the issue "Your system does not seem to be set up to build kernel modules."
Now restart the VM before installing VBOXADDITIONS
Then go to Oracle VM VirtualBox and mount VBoxGuestAdditions.iso as IDE Primary Master (CD/DVD) located under the Details tab for Storage
once mounted, login as superuser (see above) and at the # prompt, type: cd /media/VBOXADDITIONS_3.2.4_62467 <==be sure to replace this text with the version you have installed!
You should now be mounted to VBOXADDITIONS_3.2.4_62467 in Primary Master (CD/DVD) storage, if so, then type: sh VBoxLinuxAdditions-amd64.run <==be sure to replace this text with the version of linux guest additions you're running 32-bit versus 64-bit! (mine is linux 64-bit kernel)
You should see [OK] to all components in VBoxGuestAdditions, if so, it is successfully installed.