设为首页 收藏本站
查看: 1087|回复: 0

[经验分享] VirtualBoX虚拟机里安装linux系统,在虚拟系统里安装增强功能报错解决方法

[复制链接]

尚未签到

发表于 2015-4-14 07:39:23 | 显示全部楼层 |阅读模式
  当我们在虚拟机里安装lixunx系统,避免不了的要安装增强功能,无论是视觉效果还是物理机与虚拟机共享文件都是需要安装增强功能的。当我们在进入虚拟系统安装增强程序时可能会出现如下状态:




[iyunv@localhost VBOXADDITIONS_4.1.12_77245]# sh ./VBoxLinuxAdditions.run(增强程序)
VirtualBox Guest Additions installer

Removing installed version 4.1.10 of VirtualBox Guest Additions...
Removing existing VirtualBox DKMS kernel modules           [确定]
Removing existing VirtualBox non-DKMS kernel modules       [确定]
Building the VirtualBox Guest Additions kernel modules
The headers for the current running kernel were not found. If the following
module compilation fails then this could be the reason.
The missing package can be probably installed with
yum install kernel-devel-2.6.18-238.el5

Not building the VirtualBox advanced graphics driver as this Linux version is
too old to use it.
Building the main Guest Additions module                   [失败]
(Look at /var/log/vboxadd-install.log to find out what went wrong)
Doing non-kernel setup of the Guest Additions              [确定]
Installing the Window System drivers
Installing X.Org 7.1 modules                               [确定]
Setting up the Window System to use the Guest Additions    [确定]
You may need to restart the hal service and the Window System (or just restart
the guest system) to enable the Guest Additions.

Installing graphics libraries and desktop services componen[确定]

/tmp/vbox.0/Makefile.include.header:97:  *** Error: unable to find the sources of your current Linux kernel.  Specify KERN_DIR= and run Make again。 停止。
Creating user for the Guest Additions.
Creating udev rule for the Guest Additions kernel module.

从上面的结果我们可以很清楚的看出来出现了一处错误,根据提示查看/var/log/vboxadd-install.log文件会有下面的错误:
[iyunv@localhost VBOXADDITIONS_4.1.12_77245]# cat /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= and run Make again。 停止。
Creating user for the Guest Additions.
Creating udev rule for the Guest Additions kernel module.
通过上面的提示我们可以知道错误的原因是没有内核原文件
解决方法如下:(下面的操作都是在虚拟电脑里进行的不要理解成在物理机里)

一;先安装下面的程序; gcc   kernel   kernel-devel
程序说明
gcc.i686 : 各类编译器(C、C++、Objective-C、Java, ...)
kernel.i686 : Linux 内核(Linux 操作系统的核心)
kernel-devel.i686 : 用来构建与内核匹配的内核模块的开发软件包。

程序安装
[iyunv@localhost VBOXADDITIONS_4.1.12_77245]#yum instal gcc.i686 kernel.i686 kernel-devel.i686
(用yum安装时最好先用yum search 搜索下相应的程序,不同的版本可能会有不一样的后缀如有的可能是.i386)

二;重新启动电脑,启动时系统会自动从新的内核文件选项启动不要改回到原来的选项默认就好了(回到原来的选项还会出现上面的错误)。从新安装增强程序问题可以解决。

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-56875-1-1.html 上篇帖子: virtualbox 虚拟机镜像在不同机器间迁移共享 下篇帖子: InnoTek VirtualBox – 很有潜力的OS模拟器
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表