安装环境说明:
- CentOS 6.5 mini desktop 32位
1.安装virtualBox的yum源
vim /etc/yum.repos.d/virtualBox.repo
内容如下:
[virtualBox]
name=Oracle Linux / RHEL / CentOS-$releasever / $basearch - VirtualBox
baseurl=http://download.virtualBox.org/virtualBox/rpm/el/$releasever/$basearch
enabled=1
gpgcheck=1
gpgkey=http://download.virtualBox.org/virtualBox/debian/oracle_vBox.asc
2.CentOS/RHEL系统需要添加EPEL源
# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
3.添加必要的依赖包
# yum install gcc make patch dkms qt libgomp
# yum install kernel-headers kernel-devel fontforge binutils glibc-headers glibc-devel
4.设置环境变量,主要是内核的路径
# vim /etc/profile
export KERN_DIR=/usr/src/kernels/2.6.32-504.3.3.el6.x86_64
# source /etc/profile
5.安装virtualBox
# yum search VirtualBox
# yum install VirtualBox-5.1
6.在完成virtualBox的安装以后需要重新编译与virtualBox相关的内核模块
# service vBoxdrv setup
上面命令如果编译失败可以试试一下命令
# /usr/lib/virtualBox/vBoxdrv.sh setup
启动virtualBox