Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am trying to get virtualbox to install on a very touchy box. It keeps complaining.

/etc/init.d/vboxdrv setup KERN_DIR=/root/linux-2.6.18.5

That runs and gives this error:

Attempting to install using DKMS

Creating symlink /var/lib/dkms/vboxhost/4.1.0/source ->
                 /usr/src/vboxhost-4.1.0

DKMS: add Completed.
You can use the --kernelsourcedir option to tell DKMS where it's located.
Failed to install using DKMS, attempting to install without
make KBUILD_VERBOSE=1 SUBDIRS=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 -C /root/linux-2.6.18.5 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)

  ERROR: Kernel configuration is invalid.
         include/linux/autoconf.h or include/config/auto.conf are missing.
         Run 'make oldconfig && make prepare' on kernel src to fix it.

mkdir -p /tmp/vbox.0/.tmp_versions
rm -f /tmp/vbox.0/.tmp_versions/*

  WARNING: Symbol version dump /root/linux-2.6.18.5/Module.symvers
           is missing; modules will have no dependencies and modversions.

make -f scripts/Makefile.build obj=/tmp/vbox.0
  gcc -m32 -Wp,-MD,/tmp/vbox.0/linux/.SUPDrv-linux.o.d  -nostdinc -isystem /usr/lib/gcc/i386-redhat-linux/4.1.2/include -D__KERNEL__ -Iinclude  -include include/linux/
autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -O2 -pipe -msoft-float -mpreferred-stack-boundary=2  -ffreestanding -Iincl
ude/asm-i386/mach-default -fomit-frame-pointer  -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -include /tmp/vbox.0/include/VBox/SUPDrvMangling.h
 -I/root/linux-2.6.18.5/include -I/tmp/vbox.0/ -I/tmp/vbox.0/include -I/tmp/vbox.0/r0drv/linux -I/tmp/vbox.0/vboxdrv/ -I/tmp/vbox.0/vboxdrv/include -I/tmp/vbox.0/vboxd
rv/r0drv/linux -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING -DCONFIG_VBOXDRV_AS_MISC -DRT_ARCH_X86
 -DVBOX_WITH_64_BITS_GUESTS   -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(SUPDrv_linux)"  -D"KBUILD_MODNAME=KBUILD_STR(vboxdrv)" -c -o /tmp/vbox.0/linu
x/SUPDrv-linux.o /tmp/vbox.0/linux/SUPDrv-linux.c
cc1: error: include/linux/autoconf.h: No such file or directory

Is there anyone with experience compiling linux kernels (and hopefully virtualbox) that could help me with this?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

Did you compile your own kernel? It looks like you're passing a kernel source tree (in /root/linux-2.6.18.5) to the module compilation system. But that's not what you need at this stage. To compile external modules, you need a bunch of files; some of these files come directly from the kernel source, and others are generated during the compilation of the kernel. Most of these files are C headers (.h files such as include/linux/autoconf.h), but there are a few others such as Module.symvers.

If you're running a kernel that you compiled, you need to keep part of the compilation tree. It's easiest to just not delete anything, but if you're tight on space or something, you must keep at least every file called *.h or Kbuild or Makefile, plus some files at the root of the kernel source tree: .config, .kernelvariables, and Module.symvers.

If you're running a kernel provided by your distribution, just install the package containing the corresponding kernel headers (On CentOS, I think it's kernel-devel). And don't pass any KERNEL_DIR value to the setup program, it should be able to find it in the default location.

share|improve this answer
    
thank you for your answer, I am currently compiling the kernel source. Once it finishes, i'll get back to you. Btw, I'm using PAE so there have been complications. I think you are right though. gimme 20 and i'll see. –  Arian Jul 23 '11 at 21:06
    
that is, i was running this with out having done make... i bet that's the problem. –  Arian Jul 23 '11 at 21:07
    
Please edit your answer to include that i forgot to make my source. You don't have to do that if you download or yum it. –  Arian Jul 23 '11 at 21:11

I have been trying to get VB Guest Additions installed on CentOS 6.3 and getting the same error "Kernel configuration is invalid". I found a solution that worked for me. I did not need to create a sym link as shown above. On top of yum install gcc kernel-devel kernel-headers dkms, run yum groupinstall "Development Tools"
This solved the problem for me. Guest Additions won't install without it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.