CentOS VirtualBox 게스트 추가 기능을 설치할 수 없습니다

CentOS VirtualBox 게스트 추가 기능을 설치할 수 없습니다

저는 Manjaro Linux를 사용하고 있으며 VirtualBox에 CentOS 7이 설치되어 있습니다. VirtualBox Guest Additions를 설치하려고 하면 다음 오류가 발생합니다.

Verifying archive integrity... All good.
Uncompressing VirtualBox 5.1.28 Guest Additions for Linux...........
VirtualBox Guest Additions installer
Removing installed version 5.1.28 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
vboxadd.sh: Starting the VirtualBox Guest Additions.
Failed to set up service vboxadd, please check the log file
/var/log/VBoxGuestAdditions.log for details.
Press Return to close this window...

내용은 /var/log/VBoxGuestAdditions.log다음과 같습니다.

vboxadd.sh: failed: Look at /var/log/vboxadd-install.log to find out what went wrong.
vboxadd.sh: failed: Look at /var/log/vboxadd-install.log to find out what went wrong.
vboxadd.sh: failed: modprobe vboxguest failed.

내용은 /var/log/vboxadd-install.log다음과 같습니다.

grep: /lib/modules/3.10.0-693.2.2.el7.x86_64/build/include/linux/version.h: No such file or directory
make KBUILD_VERBOSE=1 CONFIG_MODULE_SIG= -C /lib/modules/3.10.0-693.2.2.el7.x86_64/build SUBDIRS=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 -j2 modules
arch/x86/Makefile:96: stack-protector enabled but compiler support broken
Makefile:641: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
make[1]: gcc: Command not found
cat: write error: Broken pipe
make[1]: warning: -jN forced in submake: disabling jobserver mode.
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  -I./arch/x86/include -Iarch/x86/include/generated  -Iinclude -I./arch/x86/include/uapi -Iarch/x86/
  include/generated/uapi -I./include/uapi -Iinclude/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-
  strict-aliasing -fno-conmon -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -std=gnu89 -02 -m64 -mno-mmx -mno-sse -mno-red-
  zone -mcmodel=kernel -maccumulate-outgoing-args -Wframe-larger-than=2048 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -fstack-protector-strong -fno-omit-
  frame-pointer -fno-optimize-sibling-calls -g -pg -Wno-declaration-after-statement -include /tmp/vbox.0/include/VBox/VBoxGuestMangling-h -fno-pie -I/Lib/modules/
  3.10.0-693.2.2.el7.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/rOdrv/linux -D__KERNEL__ -DMODULE -DVBOX -DRT_OS_LINUX -DIN_RINGO -DIN_RT_RO -DIN_GUEST -DIN_GUEST_RO -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)" -c -o /tmp/vbox.0/.tmp_VBoxGuest-linux.o /tmp/vbox.0/VBoxGuest-linux.c
  gcc -Wp,-MD,/tmp/vbox.0/.VBoxGuest.o.d  -nostdinc -isystem  -I./arch/x86/include -Iarch/x86/include/generated  -Iinclude -I./arch/x86/include/uapi -Iarch/x86/include/
  generated/uapi -I./include/uapi -Iinclude/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 -fno-delete-null-pointer-checks -std=gnu89 -02 -m64 -mno-mmx -mno-sse -mno-red-zone -
  mcmodel=kernel -maccumulate-outgoing-args -Wframe-larger-than=2048 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -fstack-protector-strong -fno-omit-frame-
  pointer -fno-optimize-sibling-calls -g -pg -Wno-declaration-after-statement -include /tmp/vbox.0/include/VBox/VBoxGuestMangling.h -fno-pie -I/lib/modules/
  3.10.0-693.2.2.el7.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_RINGO -DIN_RT_RO -DIN_GUEST -DIN_GUEST_RO -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)"  -
  D"KBUTLD_MODNAME=KBUILD_STR(vboxguest)" -c -o /tmp/vbox.0/.tmp_VBoxGuest.o /tmp/vbox.0/VBoxGuest.c
/bin/sh: gcc: command not found
make[2]: *** [/tmp/vbox.0/VBoxGuest-linux.o] Error 127
make[2]: *** Waiting for unfinished jobs....
/bin/sh: gcc: command not found
make[2]: *** [/tmp/vbox.0/VBoxGuest.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.

도움이 필요하세요?

답변1

모두 감사합니다. 내 문제는 sudo yum update실행 하여 해결되었습니다.

sudo yum install -y gcc kernel-devel

답변2

manjaro에 호스트 모듈을 설치하고 vbox를 실행하는 manjaro 사용자를 그룹에 추가하는 것을 제외하고 모두 설명되었습니다.여기

VM의 CentOS에 개발 도구를 설치해야 할 것 같습니다. 스크린샷에 따르면 gcc아직 설치하지 않으셨습니다. 이렇게 하려면 다음을 실행하세요.

sudo yum groupinstall 'Development Tools'

이제 CentOS에서 게스트 플러그인을 컴파일할 수 있습니다.

관련 정보