zoukankan      html  css  js  c++  java
  • 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
  • 相关阅读:
    索引法则--少用OR,它在连接时会索引失效
    索引法则--LIKE以%开头会导致索引失效进而转向全表扫描(使用覆盖索引解决)
    索引法则--字符串不加单引号会导致索引失效
    索引法则--IS NULL, IS NOT NULL 也无法使用索引
    tomcat管理模块报401 Unauthorized
    MySQL报Too many connections
    JDBC连接MySql例子
    linux安装jdk并设置环境变量(看这一篇文章即可)
    深度解析Java可变参数类型以及与数组的区别
    MySQL真正的UTF-8字符集utf8mb4
  • 原文地址:https://www.cnblogs.com/inthedark/p/4389166.html
Copyright © 2011-2022 走看看