美文网首页Kali Linux我用 LinuxLinux
Linux系统安装VirtualBox 5.1

Linux系统安装VirtualBox 5.1

作者: 大猪大猪 | 来源:发表于2017-12-01 00:15 被阅读22次

    VirtualBox支持以下系统

    • Windows 3.x
    • Windows NT 4.0
    • Windows 2000
    • Windows XP
    • Windows Server 2003
    • Windows Server 2008
    • Windows Vista
    • Windows 7
    • Windows 8
    • Windows 8.1
    • Windows 10
    • DOS
    • Linux (2.4, 2.6, 3.0, 3.2, 3.4, 3.10, 3.16, 3.18, 4.1, 4.4, 4.7, 4.8, 4.9, 4.10, 4.11, 4.12)
    • Solaris
    • OpenSolaris
    • OpenBSD

    以下操作方法,怎样在Fedora 26/25/24/23/22, CentOS 7.4/6.9, Red Hat (RHEL) 7.4/6.9上安装VirtualBox 5.1 (当前版本 5.1.28)

    1. 切换ROOT用户

    su -
    ## 或者 ##
    sudo -i
    

    2. 安装Fedora或者RHEL仓库索引文件

    cd /etc/yum.repos.d/
    
    ## Fedora 26/25/24/23/22/21/20/19/18/17/16 users
    wget http://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo
    
    ## CentOS 7.4/6.9 跟 Red Hat (RHEL) 7.4/6.9 users
    wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo
    

    3. 更新包,更新内核

    ## Fedora 26/25/24/23/22 ##
    dnf update
    
    ## Fedora 21/20/19/18/17/16 跟 CentOS/RHEL 7/6/5 ##
    yum update
    

    4. 检查内核是否成功更新

    rpm -qa kernel |sort -V |tail -n 1
    
    uname -r
    

    5. 重启并选择更新后的内核版本

    reboot
    

    6. 安装依赖包

    ## CentOS 7 跟 RHEL 7 ##
    rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
    
    ## CentOS 6 跟 RHEL 6 ##
    rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
    
    ## CentOS 5 跟 RHEL 5 ##
    rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-5.noarch.rpm
    
    ## Fedora 26/25/24/23/22 ##
    dnf install binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel dkms
    
    ## Fedora 21/20/19/18/17/16 and CentOS/RHEL 7/6/5 ##
    yum install binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel dkms
    
    ## PAE kernel users install ##
    ## Fedora 24/23/22 ##
    dnf install binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-PAE-devel dkms
    
    ## Fedora 21/20/19/18/17/16 and CentOS/RHEL 7/6/5 ##
    yum install binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-PAE-devel dkms
    

    7. 安装VirtualBox版本,最新 Version 5.1 (当前 5.1.28)

    ## Fedora 26/25/24/23/22 ##
    dnf install VirtualBox-5.1
    
    ## Fedora 21/20/19/18/17/16/15/14 and CentOS/RHEL 7/6/5 ##
    yum install VirtualBox-5.1
    

    8. 重新编译内核模块

    ## Fedora 26/25/24/23/22/21/20/19 and CentOS/RHEL 7 ##
    /usr/lib/virtualbox/vboxdrv.sh setup
    
    ## Fedora 18/17/16 and CentOS/RHEL 6/5 ##
    /etc/init.d/vboxdrv setup
    ## 或者 ##
    service vboxdrv setup
    

    9. 添加用户到VirtualBox用户组

    usermod -a -G vboxusers 用户名
    

    启动VirtualBox

    VirtualBox
    

    10. 故障排除

    如果有KERN_DIR参数有问题或你的内核目录没有自动检测到,请手动设置KERN_DIR环境变量,使用以下方法:

    ## 当前运行的内核是 Fedora ##
    KERN_DIR=/usr/src/kernels/`uname -r`
     
    ## 当前运行的内核是 CentOS 跟 Red Hat (RHEL) ##
    KERN_DIR=/usr/src/kernels/`uname -r`-`uname -m`
     
    ## 例如 Fedora ##
    KERN_DIR=/usr/src/kernels/2.6.33.5-124.fc13.i686
     
    ## 例如 CentOS 跟 Red Hat (RHEL) ##
    KERN_DIR=/usr/src/kernels/2.6.18-194.11.1.el5-x86_64
     
    ## 导出变量 KERN_DIR ##
    export KERN_DIR
    
    

    相关文章

      网友评论

        本文标题:Linux系统安装VirtualBox 5.1

        本文链接:https://www.haomeiwen.com/subject/bdfibxtx.html