VirtualBox号称是最强的免费虚拟机软件,它不仅具有丰富的特色,而且性能也很优异。它简单易用,可虚拟的系统包括Windows、[Mac OS X]、Linux、OpenBSD、Solaris、IBM OS2甚至Android等操作系统。
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
以上就是良许教程网为各位朋友分享的Linu系统相关内容。想要了解更多Linux相关知识记得关注公众号“良许Linux”,或扫描下方二维码进行关注,更多干货等着你 !