virtualbox安装增强工具失败解决方法

时间:2021-06-26 18:36:44
在virtualbox中安装centos7后,再安装增强工具失败。

安装出现如下错误:
Building the VirtualBox Guest Additions kernel modules [FAILED] 
Your system does not seem to be set up to build kernel modules. 
Look at /var/log/vboxadd-install.log to find out what went wrong. 
Once you have corrected it, you can run /etc/init.d/vboxadd setup to build them. 
查看错误日志:
/tmp/vbox.o/Makefile.include.header:97: *** 
Error: unable to find the source of your current Linux kernel.Specify KERN_DIR=
 and run make again. Stop.

解决:
#yum install kernel-headers
#yum install kernel-devel
#yum install gcc* 
#yum install make

重启,
再次安装,ok