How to install VirtualBox Guest Additions in CentOS 6(在CentOS中安装VirtualBox增强功能)

Q:The headers for the current running kernel were not found.

error in /var/log/vboxadd-install.log

/tmp/vbox.0/Makefile.include.header:97: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again

A:

安装缺少的包,并创建一个符号链接就可以了。

yum install kernel-devel gcc make
ls /usr/src/kernels/
2.6.32-71.29.1.el6.i686
ln -s /usr/src/kernels/2.6.32-71.29.1.el6.i686/ /usr/src/linux
sh VBoxLinuxAdditions.run

Other way:

rpm -qa kernel\* | sort
#keep you are running latest kernel yum update kernel* reboot
yum install gcc kernel-devel kernel-headers dkms make bzip2 perl .
/VBoxLinuxAdditions.run

some other solution:

[via1:http://www.if-not-true-then-false.com/2010/install-virtualbox-guest-additions-on-fedora-centos-red-hat-rhel/]

[via2:http://wiki.centos.org/HowTos/Virtualization/VirtualBox/CentOSguest]

[via3:https://www.centos.org/forums/viewtopic.php?t=3811]

原文地址:https://www.cnblogs.com/eshizhan/p/2269367.html