手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

CentOS 6.2安装VirtualBox4.1.10+VirtualBox后台运行+开机自启动

[日期:2012-11-10] 来源:Linux社区  作者:Linux [字体:大 中 小]

6.显示没有kernel-headers那么我们接下来安装kernel-headers

yum install kernel-headerskernel-devel gcc

7.安装完成后再次运行/etc/init.d/vboxdtrv setup

CentOS 6.2安装VirtualBox4.1.10+VirtualBox后台运行+开机自启动

显示没有make命令那么安装make

8.yum install make(如果早就已经安装好了开发工具那么就会省去这一步,如果有了kernel-headers也会省去第六6步)

9.安装好后再次运行/etc/init.d/vboxdtrv setup

 

这次成功了。

CentOS 6.2安装VirtualBox4.1.10+VirtualBox后台运行+开机自启动

然后就可打开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

linux
相关资讯       VirtualBox  VirtualBox安装 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款