virturlbox CENTOS6安装增强功能

1、安装virtualbox增强功能需要先安装gcc和kernel-devel包才行,照往常一样,按照正常方法安装了这两个包。

yum -y install gcc

yum -y install kernel

安装都成功。

2、安装增强功能

Verifying archive integrity... All good.
Uncompressing VirtualBox 5.1.30 Guest Additions for Linux...........
VirtualBox Guest Additions installer
Removing installed version 5.1.30 of VirtualBox Guest Additions...
vboxadd.sh: Stopping VirtualBox Additions.
Copying additional installer modules ...
Installing additional modules ...
vboxadd.sh: Starting the VirtualBox Guest Additions.
Failed to set up service vboxadd, please check the log file
/var/log/VBoxGuestAdditions.log for details.
Press Return to close this window...
报错。看日志文件:

[root@rac1 ~]# cat /var/log/VBoxGuestAdditions.log

vboxadd.sh: failed: Look at /var/log/vboxadd-install.log to find out what went wrong.
vboxadd.sh: failed: Look at /var/log/vboxadd-install.log to find out what went wrong.
vboxadd.sh: failed: modprobe vboxguest failed.

继续看日志

[root@rac1 ~]# cat /var/log/vboxadd-install.log
/tmp/vbox.0/Makefile.include.header:112: *** 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.

3、查看kernel-devel包是否跟内核一致:

[root@rac1 ~]# uname -r
2.6.32-696.16.1.el6.x86_64
[root@rac1 ~]# yum info kernel-devel
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
Available Packages
Name        : kernel-devel
Arch        : x86_64
Version     : 2.6.32
Release     : 696.16.1.el6
Size        : 11 M
Repo        : updates
Summary     : Development package for building kernel modules to match the
            : kernel
URL         : http://www.kernel.org/
License     : GPLv2
Description : This package provides kernel headers and makefiles sufficient to
            : build modules against the kernel package.
发现一致。

4、直接安装:

[root@rac1 VBOXADDITIONS_5.1.30_118389]# yum install -y "kernel-devel-uname-r == $(uname -r)"
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package kernel-devel.x86_64 0:2.6.32-696.16.1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package            Arch         Version                    Repository     Size
================================================================================
Installing:
 kernel-devel       x86_64       2.6.32-696.16.1.el6        updates        11 M

Transaction Summary
================================================================================
Install       1 Package(s)

Total download size: 11 M
Installed size: 26 M
Downloading Packages:
kernel-devel-2.6.32-696.16.1.el6.x86_64.rpm              |  11 MB     00:01     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : kernel-devel-2.6.32-696.16.1.el6.x86_64                      1/1 
  Verifying  : kernel-devel-2.6.32-696.16.1.el6.x86_64                      1/1 

Installed:
  kernel-devel.x86_64 0:2.6.32-696.16.1.el6                                     

Complete!

5、完了直接安装增强功能:

[root@rac1 VBOXADDITIONS_5.1.30_118389]# ls
32Bit        cert                    VBoxSolarisAdditions.pkg
64Bit        OS2                     VBoxWindowsAdditions-amd64.exe
AUTORUN.INF  runasroot.sh            VBoxWindowsAdditions.exe
autorun.sh   VBoxLinuxAdditions.run  VBoxWindowsAdditions-x86.exe
[root@rac1 VBOXADDITIONS_5.1.30_118389]# ./VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 5.1.30 Guest Additions for Linux...........
VirtualBox Guest Additions installer
Removing installed version 5.1.30 of VirtualBox Guest Additions...
vboxadd.sh: Stopping VirtualBox Additions.
Copying additional installer modules ...
Installing additional modules ...
vboxadd.sh: Starting the VirtualBox Guest Additions.

You may need to restart the Window System (or just restart the guest system)
to enable the Guest Additions.

[root@rac1 VBOXADDITIONS_5.1.30_118389]# 


6、成功!写在最后,安装报上面的错,要么是kernel-dev包的版本跟内核版本不一致,要么就是kernel-dev包没装。安装kernel-dev包可以参照我上面的命令,保证两者版本一致。








  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值