1. 下载VirtualBox
wget http://download.virtualbox.org/virtualbox/3.0.8/VirtualBox-3.0.8_53138_rhel5-1.x86_64.rpm
如果下载后的不是rpm,而是有后缀,可以用mv 改名
mv VirtualBox-3.0.8_53138_rhel5-1.x86_64.rpm.xxxxx VirtualBox-3.0.8_53138_rhel5-1.x86_64.rpm
安装RPM
rpm -ivh VirtualBox-3.0.8_53138_rhel5-1.x86_64.rpm
2. 创建一个vboxuser 组,并把想使用的用户添加到这个组
groupadd vboxuser
usermod -G vboxuser maoxiang
3. 初始化vbox
/etc/init.d/vboxsrv setup
如果启动失败,用 dmesg 查看日志,可以看到最后几行信息
vboxdrv: NMI watchdog active -- refused to load the kernel module! Please disable
如果是 这种情况,编译 启动参数
在 /boot/grbu/grub.conf 中增加 nmi_watchdog 参数
kernel /boot/vmlinuz-2.6.18-164.el5 nmi_watchdog=0 ro root=LABEL=/ rhgb quiet
重新启动计算机,即可。
如果还启动失败 ,有日志在 /var/log/vbox-install.log
Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR= and run Make again. Stop.
说明kernel 的相关包没有安装。
yum info kernel*
一般来说安装以下几个即可
yum install kernel-debug
yum install kernel-devel
如果yum 安装太慢,可以使用国内镜像
cd /etc/yum.d.repo
wget http://centos.ustc.edu.cn/CentOS-Base.repo