VirtualBox Guset Additionsのログで下記のエラーが出た
/var/log/VBoxGuestAdditions.log
vboxadd.sh: failed: Look at /var/log/vboxadd-install.log to find out what went wrong.
vboxadd.sh: failed: Please check that you have gcc, make, the header files for your Linux kernel and possibly perl installed..
/opt/VBoxGuestAdditions-5.1.2/init/vboxadd: line 451: semanage: command not found
/var/log/vboxadd-install.log
make KBUILD_VERBOSE=1 CONFIG_MODULE_SIG= -C /lib/modules/2.6.32-642.3.1.el6.x86_64/build SUBDIRS=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 -j1 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/.VBoxGuest-linux.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include -Iinclude -I/usr/src/kernels/2.6.32-642.3.1.el6.x86_64/include/uapi -I/usr/src/kernels/2.6.32-642.3.1.el6.x86_64/arch/x86/include -Iarch/include/generated -Iinclude -include /usr/src/kernels/2.6.32-642.3.1.el6.x86_64/include/linux/kconfig.h -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 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -fstack-protector -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_AVX=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -Wframe-larger-than=2048 -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -pg -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fno-dwarf2-cfi-asm -fconserve-stack -Wno-declaration-after-statement -include /tmp/vbox.0/include/VBox/VBoxGuestMangling.h -fno-pie -I/lib/modules/2.6.32-642.3.1.el6.x86_64/build/include -I/tmp/vbox.0/ -I/tmp/vbox.0/include -I/tmp/vbox.0/r0drv/linux -I/tmp/vbox.0/vboxguest/ -I/tmp/vbox.0/vboxguest/include -I/tmp/vbox.0/vboxguest/r0drv/linux -D__KERNEL__ -DMODULE -DVBOX -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_GUEST -DIN_GUEST_R0 -DIN_MODULE -DRT_WITH_VBOX -DVBGL_VBOXGUEST -DVBOX_WITH_HGCM -DRT_ARCH_AMD64 -DVBOX_WITH_64_BITS_GUESTS -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(VBoxGuest_linux)" -D"KBUILD_MODNAME=KBUILD_STR(vboxguest)" -D"DEBUG_HASH=24" -D"DEBUG_HASH2=60" -c -o /tmp/vbox.0/.tmp_VBoxGuest-linux.o /tmp/vbox.0/VBoxGuest-linux.c
set -e ; perl /usr/src/kernels/2.6.32-642.3.1.el6.x86_64/scripts/recordmcount.pl "x86_64" "64" "objdump" "objcopy" "gcc" "ld" "nm" "" "" "1" "/tmp/vbox.0/VBoxGuest-linux.o";
/bin/sh: perl: command not found
make[2]: *** [/tmp/vbox.0/VBoxGuest-linux.o] Error 127
make[1]: *** [_module_/tmp/vbox.0] Error 2
make: *** [vboxguest] Error 2
Creating user for the Guest Additions.
Creating udev rule for the Guest Additions kernel module.
環境
VirtualBox 5.1.2
ゲストOS: CentOS-6.8-x86_64-minimal.iso を用いて最小構成でinstall
Guest Additionsをinstallする前に追加で入れたパッケージ
yum install gcc kernel-devel
semanageコマンドはどのパッケージにある?
yum provides /usr/sbin/semanage
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: www.ftp.ne.jp
* extras: www.ftp.ne.jp
* updates: www.ftp.ne.jp
policycoreutils-python-2.0.83-29.el6.x86_64 : SELinux policy core python
: utilities
Repo : base
Matched from:
Filename : /usr/sbin/semanage
結論: 更に追加でこれらを入れる
yum install perl policycoreutils-python
もちろんGuest Additionを再インストールすること。
参考