我试图让virtualbox安装在一个非常敏感的盒子上。一直在抱怨。
/etc/init.d/vboxdrv安装KERN_DIR=/root/linux-2.6.18.5
它将运行并给出以下错误:
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有谁有编译linux内核(希望是virtualbox)的经验,可以帮我做这件事吗?
发布于 2011-07-23 21:04:19
您编译了自己的内核吗?看起来,您正在将内核源代码树(在/root/linux-2.6.18.5中)传递给模块编译系统。但这不是你现在需要的。要编译外部模块,您需要一堆文件;其中一些文件直接来自内核源代码,另一些文件是在编译内核期间生成的。这些文件大多是C头文件(.h文件,如include/linux/autoconf.h),但还有其他一些文件,如Module.symvers。
如果您正在运行您编译的内核,则需要保留编译树的一部分。不删除任何东西是最简单的,但是如果空间很紧,那么至少必须保留每个名为*.h、Kbuild或Makefile的文件,以及内核源代码树根部的一些文件:.config、.kernelvariables和Module.symvers。
如果运行发行版提供的内核,只需安装包含相应内核头的包(在CentOS上,我认为是kernel-devel)。不要将任何KERNEL_DIR值传递给安装程序,它应该能够在默认位置找到它。
发布于 2013-01-25 22:01:55
我一直试图在CentOS 6.3上安装VB,并得到相同的错误“内核配置无效”。我找到了一个对我有用的解决方案。如上面所示,我不需要创建sym链接。在yum安装gcc内核-devel内核-headers dkms的顶部,运行yum Tools安装“开发工具”。
这为我解决了这个问题。客户添加将不会安装没有它。
https://unix.stackexchange.com/questions/17287
复制相似问题