爬坑系列--centos7 安装virtualbox
安装centos7并设置好网络
安装epel yum源
wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -ivh epel-release-latest-7.noarch.rpm
yum repolist
安装依赖
yum localinstall -y rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm (文件不好找)
yum install -y gcc gcc-c++ make patchdkms qt libgomp \
qt-x11 kernel-headers kernel-devel fontforge \
binutils glibc-headers glibc-devel kernel dkms
查看
ls /usr/src/kernels/
设置
vim /etc/profile
export KERN_DIR=3.10.0-693.11.1.el7.x86_64
source /etc/profile
安装
wget http://download.virtualbox.org/virtualbox/rpm/rhel/7/x86_64/VirtualBox-5.2-5.2.2_119230_el7-1.x86_64.rpm
yum localinstall -y VirtualBox-5.2-5.2.2_119230_el7-1.x86_64.rpm
启动
全程监控 /var/log/vbox-install.log 日志
重新构建内核
rcvboxdrv setup
报错
报错信息
/tmp/vbox.0/Makefile.include.header:99: *** The variable KERN_DIR must be a kernel build folder and end with /build without a trailing slash, or KERN_VER must be set。 停止。
检查依赖是否安装完整
yum install -y gcc gcc-c++
yum install -y kernel-headers kernel-devel kernel
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/SDL-1.2.15-14.el7.i686.rpm
yum localinstall -y SDL-1.2.15-14.el7.i686.rpm
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/fontconfig-2.10.95-11.el7.x86_64.rpm
yum localinstall -y fontconfig-2.10.95-11.el7.x86_64.rpm
添加root到vboxusers
usermod -a -G vboxusers root
重启
reboot
完全没用(或许有点用),百度就是个坑。
分析报错信息:说设置KERN_DIR 和KERN_VER ,KERN_DIR 设置了,那就试试加一个KERN_VER
vim /etc/profile
export KERN_DIR=3.10.0-693.11.1.el7.x86_64
export KERN_VER=3.10.0-693.11.1.el7.x86_64
source /etc/profile
/sbin/vboxconfig
成功
安装virtualbox拓展
VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack*