尝试在 Fedora 24 中安装 Guest Additions

尝试在 Fedora 24 中安装 Guest Additions

我试图安装来宾添加,来宾 SO 是 Fedora 24,主机 SO 是 Windows 7。

我这样做是为了修复 Fedora 中的屏幕分辨率,因为我可以获得的最大分辨率是 1024x768,而在 Windows 中我有 1366x768。

问题是,当我尝试安装 Guest Additions 时,我得到了这个

Verifying archive integrity... All good.
Uncompressing VirtualBox 5.0.26 Guest Additions for Linux............
VirtualBox Guest Additions installer
Removing installed version 5.0.26 of VirtualBox Guest Additions...
Removing existing VirtualBox DKMS kernel modules[  OK  ]
Removing existing VirtualBox non-DKMS kernel modules[  OK  ]
Copying additional installer modules ...
Installing additional modules ...
Removing existing VirtualBox DKMS kernel modules[  OK  ]
Removing existing VirtualBox non-DKMS kernel modules[  OK  ]
Building the VirtualBox Guest Additions kernel modules
Building the main Guest Additions module[FALLÓ]
(Look at /var/log/vboxadd-install.log to find out what went wrong)
Doing non-kernel setup of the Guest Additions[  OK  ]
Press Return to close this window...

所以除了构建主来宾添加模块之外一切都很好

这是在/var/log/vboxadd-install.log

Uninstalling modules from DKMS
Attempting to install using DKMS

Creating symlink /var/lib/dkms/vboxguest/5.0.26/source ->
                 /usr/src/vboxguest-5.0.26

DKMS: add completed.

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
make -j2 KERNELRELEASE=4.8.4-200.fc24.x86_64 -C /lib/modules/4.8.4-200.fc24.x86_64/build M=/var/lib/dkms/vboxguest/5.0.26/build......(bad exit status: 2)
Error! Bad return status for module build on kernel: 4.8.4-200.fc24.x86_64 (x86_64)
Consult /var/lib/dkms/vboxguest/5.0.26/build/make.log for more information.
Failed to install using DKMS, attempting to install without
grep: /lib/modules/4.8.4-200.fc24.x86_64/build/include/linux/version.h: No such file or directory
make KBUILD_VERBOSE=1 CONFIG_MODULE_SIG= -C /lib/modules/4.8.4-200.fc24.x86_64/build SUBDIRS=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 modules
test -e include/generated/autoconf.h -a -e include/config/auto.conf || (                \
echo >&2;                                                       \
echo >&2 "  ERROR: Kernel configuration is invalid.";           \
echo >&2 "         include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it.";      \
echo >&2 ;                                                      \
/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/.VBoxGuest-linux.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/6.1.1/include -I./arch/x86/include -I./arch/x86/include/generated/uapi -I./arch/x86/include/generated  -I./include -I./arch/x86/include/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_SSSE3=1 -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -DCONFIG_AS_SHA1_NI=1 -DCONFIG_AS_SHA256_NI=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -fno-delete-null-pointer-checks -Wno-maybe-uninitialized -O2 --param=allow-store-data-races=0 -Wframe-larger-than=2048 -fstack-protector-strong -Wno-unused-but-set-variable -Wno-unused-const-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fvar-tracking-assignments -g -pg -mfentry -DCC_USING_FENTRY -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -Werror=incompatible-pointer-types -DCC_HAVE_ASM_GOTO -Wno-declaration-after-statement -include /tmp/vbox.0/include/VBox/VBoxGuestMangli

所以我猜它找不到include/generated/autoconf.hinclude/config/auto.conf文件,我该怎么办?

我已经做了:

yum install dkms binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel

我还可以做些什么?

答案1

以 Windows 10 作为主机系统的最新版本 VirtualBox (5.1.8) 也会发生同样的情况。与OP有同样的错误,我没能让它在4.8.6内核上工作,但是当我回到旧的4.5.5内核时,安装很顺利,一切都按预期工作(测试了调整窗口大小和共享剪贴板)。目前,我坚持使用旧内核。

答案2

我刚刚遇到了类似的问题,Fedora 24 内核为 4.8.7,Virtual Box 5.0.28 来自 Windows 8.1 主机。

我通过以下方式让它工作:

  • 删除当前的来宾添加项(VBoxLinuxAdditions.run uninstall在 CD 目录中)
  • 安装虚拟盒 5.1.8
  • 检查是否dkms, gcc, kernel-devel, kernel-header是最新版本
  • 然后最后从 VirtualBox 附带的 ISO 安装来宾添加 5.1.8

答案3

卸载 VirtualBox-5.0 并安装 VirtualBox-5.1

相关内容