码迷,mamicode.com
首页 > 其他好文 > 详细

Fedora21安装VirtualBox

时间:2015-04-03 10:51:59      阅读:187      评论:0      收藏:0      [点我收藏+]

标签:

dkms,kernel-devel,makecache:

yum install dkms
yum install kernel-devel
yum makecache

下载VirtualBox    https://www.virtualbox.org/wiki/Linux_Downloads  并安装:

yum localinstall VirtualBox-4.3-4.3.8_92456_fedora18-1.x86_64.rpm -y

安装完成,创建虚拟机并启动时遇到错误:

The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Please reinstall the kernel module by executing

/etc/init.d/vboxdrv setup

as root. If it is available in your distribution, you should install the DKMS package first. This package keeps track of Linux kernel changes and recompiles the vboxdrv kernel module if necessary.

于是编译 VirtualBox 内核:

  [root@dev-zhanghua zhanghua]# /etc/init.d/vboxdrv setup
  Stopping VirtualBox kernel modules [ OK ]
  Uninstalling old VirtualBox DKMS kernel modules [ OK ]
  Trying to register the VirtualBox kernel modules using DKMS[ OK ]
  Starting VirtualBox kernel modules [ OK ]

 如果出现以下错误, 是找不到内核对应的 kernel headers或内核版本不一致:

Stopping VirtualBox kernel modules                         [  OK  ]  
Uninstalling old VirtualBox DKMS kernel modules            [  OK  ]  
Trying to register the VirtualBox kernel modules using DKMSError! echo  
Your kernel headers for kernel 3.18.7-200.fc21.x86_64 cannot be found at  
/lib/modules/3.18.7-200.fc21.x86_64/build or /lib/modules/3.18.7-200.fc21.x86_64/source.  
                                                           [FAILED]  
  (Failed, trying without DKMS)  
Recompiling VirtualBox kernel modules                      [FAILED]  
  (Look at /var/log/vbox-install.log to find out what went wrong)

查看内核版本:

  [root@dev-zhanghua zhanghua]# uname -r
  3.18.7-200.fc21.x86_64

查看已安装的内核版本:

  [root@dev-zhanghua zhanghua]# rpm -qa|grep headers
  kernel-headers-3.17.8-200.fc21.x86_64
  glibc-headers-2.20-7.fc21.x86_64

发现版本不一致, 安装 kernel-headers-3.18.7-200.fc21.x86_64

yum install kernel-headers-3.18.7-200.fc21.x86_64

重启后二者版本一致: 

[root@dev-zhanghua zhanghua]# uname -r
3.18.7-200.fc21.x86_64
[root@dev-zhanghua zhanghua]# rpm -qa|grep headers
kernel-headers-3.18.7-200.fc21.x86_64
glibc-headers-2.20-7.fc21.x86_64

 再次编译, 结果正常(编译VirtualBox 内核,如果失败,可能需要再次安装 dkms ):

  [root@dev-zhanghua zhanghua]# /etc/init.d/vboxdrv setup
  Stopping VirtualBox kernel modules [ OK ]
  Uninstalling old VirtualBox DKMS kernel modules [ OK ]
  Trying to register the VirtualBox kernel modules using DKMS[ OK ]
  Starting VirtualBox kernel modules [ OK ]

 

Fedora21安装VirtualBox

标签:

原文地址:http://www.cnblogs.com/inthedark/p/4389166.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!