Java自学者论坛

 找回密码
 立即注册

手机号码,快捷登录

恭喜Java自学者论坛(https://www.javazxz.com)已经为数万Java学习者服务超过8年了!积累会员资料超过10000G+
成为本站VIP会员,下载本站10000G+会员资源,会员资料板块,购买链接:点击进入购买VIP会员

JAVA高级面试进阶训练营视频教程

Java架构师系统进阶VIP课程

分布式高可用全栈开发微服务教程Go语言视频零基础入门到精通Java架构师3期(课件+源码)
Java开发全终端实战租房项目视频教程SpringBoot2.X入门到高级使用教程大数据培训第六期全套视频教程深度学习(CNN RNN GAN)算法原理Java亿级流量电商系统视频教程
互联网架构师视频教程年薪50万Spark2.0从入门到精通年薪50万!人工智能学习路线教程年薪50万大数据入门到精通学习路线年薪50万机器学习入门到精通教程
仿小米商城类app和小程序视频教程深度学习数据分析基础到实战最新黑马javaEE2.1就业课程从 0到JVM实战高手教程MySQL入门到精通教程
查看: 409|回复: 0

VirtualBoX虚拟机里安装linux系统,在虚拟系统里安装增强功能报错解决方法

[复制链接]
  • TA的每日心情
    奋斗
    昨天 22:10
  • 签到天数: 756 天

    [LV.10]以坛为家III

    2034

    主题

    2092

    帖子

    70万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    707560
    发表于 2021-8-29 14:44:24 | 显示全部楼层 |阅读模式

    http://www.cnblogs.com/MoShin/archive/2012/04/25/2469156.html

    当我们在虚拟机里安装lixunx系统,避免不了的要安装增强功能,无论是视觉效果还是物理机与虚拟机共享文件都是需要安装增强功能的。当我们在进入虚拟系统安装增强程序时可能会出现如下状态:


    [root@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=<directory> and run Make again。 停止。
    Creating user for the Guest Additions.
    Creating udev rule for the Guest Additions kernel module.
    从上面的结果我们可以很清楚的看出来出现了一处错误,根据提示查看/var/log/vboxadd-install.log文件会有下面的错误:
    [root@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=<directory> 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 : 用来构建与内核匹配的内核模块的开发软件包。
    程序安装
    [root@localhost VBOXADDITIONS_4.1.12_77245]#yum instal gcc.i686 kernel.i686 kernel-devel.i686
    (用yum安装时最好先用yum search 搜索下相应的程序,不同的版本可能会有不一样的后缀如有的可能是.i386)
    二;重新启动电脑,启动时系统会自动从新的内核文件选项启动不要改回到原来的选项默认就好了(回到原来的选项还会出现上面的错误)。从新安装增强程序问题可以解决。
    哎...今天够累的,签到来了1...
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    QQ|手机版|小黑屋|Java自学者论坛 ( 声明:本站文章及资料整理自互联网,用于Java自学者交流学习使用,对资料版权不负任何法律责任,若有侵权请及时联系客服屏蔽删除 )

    GMT+8, 2024-6-28 17:31 , Processed in 0.063363 second(s), 29 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2021, Tencent Cloud.

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