VirtualBox安装增强插件到Centos7虚拟机内失败的解决办法

错误现象 (一)

错误现象

安装出现如下错误:

1
2
3
4
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.

查看/var/log/vboxadd-install.log后,找到最先出错的地方:

1
2
grep: /lib/modules/3.10.0-327.10.1.el7.x86_64/build/include/linux/version.h: No such file or direcotry
make KBUILD_VERBOSE=1

软件环境

  • VirtualBox:4.3.12
  • VirtualBox增强插件版本:4.3.20
  • 系统版本:Windows7
  • 虚拟机系统版本:CentOS7

错误原因

本来安装VirtualBox最新的5.0.6版本,但是Windows7操作系统出现无法启动Session的错误,
搜索后,在Stackoverflow上找到了答案,因为使用的VirtualBox版本太新,然后就退到使用当前的4.3.12
结果就出现增强插件版本安装不上。

解决办法

使用稍微新一点的增强插件即可解决这个问题,但是不要太新,
所以就选择了4.3.20,作为目标版本。
问题顺利解决。


错误现象 (二)

错误现象

安装出现如下错误:

1
2
Building the OpenGL support module                         [FAILED]
(Look at /var/log/vboxadd-install.log to find out what went wrong)

导致无法使用自动调整窗口大小(Auto-resize Guest Display)的功能,只能使用小窗口

解决办法

再次提高插件的版本到VirtualBox-4.3.36-105129-Win
直接解决。


错误现象 (三)

错误现象

1
Warning: unknown version of the X Window System installed.  Not installingX Window System drivers.

错误原因

VirtualBox的版本太低,不支持X Windows 1.11
更新版本就可以了。
将插件更新到VirtualBox-4.3.36-105129-Win就可以了。

其他一些问题的解决办法

另外还搜索到其他一些依赖的包没有安装上的原因,直接安装上就好了:

  • yum -y install kernel
  • yum -y install kernal-devel
  • yum -y install kernal-headers
  • yum -y install gcc*
  • yum -y install make