• Fedora 21 安装VirtualBox


    注: 所有操作需要root权限  如果不是root用户在下面所有命令前加sudo

    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 ]

     或者再次检查kernel, kernel-modules, kernel-core, kernel-headers, kernel-devel版本是否与uname -r版本一致

    [root@dev-zhanghua kernels]# uname -r
    3.17.4-301.fc21.x86_6
    [root@dev-zhanghua kernels]# rpm -qa|grep kernel
    kernel-3.17.4-301.fc21.x86_64
    kernel-modules-3.17.4-301.fc21.x86_64
    kernel-headers-3.17.4-301.fc21.x86_64
    kernel-core-3.17.4-301.fc21.x86_64
    kernel-devel-3.17.4-301.fc21.x86_64
  • 相关阅读:
    Requests库入门——应用实例-网络图片的爬取与保存(好看的小姐姐≧▽≦)
    Python Requests库简单入门
    Python BeautifulSoup库基础及一般元素提取方法
    Coloring a Tree(耐心翻译+思维)
    Python jieba库的使用说明
    竖式除法模拟
    Pythagorean Triples毕达哥斯拉三角(数学思维+构造)
    C++ STL中的Binary search(二分查找)
    Polycarp and Letters(set首战!)
    Java多线程干货系列—(一)Java多线程基础
  • 原文地址:https://www.cnblogs.com/inthedark/p/4389166.html
Copyright © 2020-2023  润新知