6.显示没有kernel-headers那么我们接下来安装kernel-headers
yum install kernel-headerskernel-devel gcc
7.安装完成后再次运行/etc/init.d/vboxdtrv setup

显示没有make命令那么安装make
8.yum install make(如果早就已经安装好了开发工具那么就会省去这一步,如果有了kernel-headers也会省去第六6步)
9.安装好后再次运行/etc/init.d/vboxdtrv setup
这次成功了。

然后就可打开virtualbox建立虚拟系统了。但是还有个问题,作为服务器,我们希望注销用户后虚拟系统一直在后台跑着,如何实现呢?
很简单用命令就行了
将所有虚拟系统都关掉,然后用
VBoxManage startvm 虚拟机名字 --type headles命令启动虚拟机,这样就会在后台运行了
VBoxManage startvm <uuid>|<name>...
[--typegui|sdl|headless]
如何关闭?
VBoxManage controlvm 虚拟机名称 poweroff这是关机命令
VBoxManage controlvm <uuid>|<name>
pause|resume|reset|poweroff|savestate|
如何开机启动?
编辑/etc/rc.d/rc.local
在里面加入
VBoxManage startvm 虚拟机名字 --type headles命令就可以开机启动了。
#!/bin/sh
#
# This script will beexecuted *after* all the other init scripts.
# You can put your owninitialization stuff in here if you don't
# want to do the full Sys Vstyle init stuff.
touch /var/lock/subsys/local
VBoxManage startvm win03-233 --type headless
VBoxManage startvm CentOS6.2-234 --type headless
