当在 Virtual Box 中安装完 CentOS (或者其他,比如win7 or ubuntu)后,屏幕的分辨率只能是4:3的,这样如果自己的屏幕不是4:3的话,看起来非常不方便。这个时候就需要安装VBoxGuestAdditions_x.x.x.iso 这个增强功能了。
但在安装过程中产生了错误:
Building the main guest addition 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)
Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.. Stop.
测试环境:Mac OS 10.9.4, Virtual Box-4.3.14-95030, CentOS-7.0-1406-x86_64-GnomeLive
首先,检查自己的内核版本:(我的版本号是3.10.0-123.el7.x86_64)
rpm -q kernel-devel
yum install kernel-devel
如果二者不一致,需要对kernel进行更新:
yum install gcc
./VBoxLinuxGuestAddition.run