<实用>使用VBoxManage 将Virtualbox放入后台运行

Kvm、VMware、Virtualbox、Xen、Qemu 等
回复
kamui0523
帖子: 547
注册时间: 2008-05-14 18:53
来自: 上海

<实用>使用VBoxManage 将Virtualbox放入后台运行

#1

帖子 kamui0523 » 2010-04-23 11:21

KVM默认将虚拟机放入后台运行,即使关闭窗口也不会关闭虚拟机,这个特性非常好,而virtualbox默认却不能,有时候我们可能会重启X,这时不得不关闭虚拟机,如果能让virtualbox也放入后台运行,将会方便不少,下面简单介绍下VBoxManage的简单命令来实现这一功能
首先用图形创建一个虚拟机,当然使用VBoxManage也可以创建,只不过相对繁琐,不建议么操作.
创建完毕后使用如下命令启动虚拟机即可

代码: 全选

VBoxManage startvm <vm_name> -type vrdp
如果要连接虚拟机,只需要输入

代码: 全选

rdesktop 127.0.0.1:3389
即可
如果要指定分辨率并且打开声音,输入

代码: 全选

rdesktop 127.0.0.1:3389 -g 800x600 -r sound:remote
下面列举一些 VBoxManage常用的的操作:

代码: 全选

查看有哪些虚拟机
VBoxManage list vms

查看虚拟的详细信息
VBoxManage list vms --long

查看运行着的虚拟机
VBoxManage list runningvms

开启虚拟机并开启远程桌面连接的支持
VBoxManage startvm <vm_name> -type vrdp

改变虚拟机的远程连接端口,用于多个vbox虚拟机同时运行
VBoxManage controlvm <vm_name> vrdpprot <ports>

关闭虚拟机
VBoxManage controlvm <vm_name> acpipowerbutton

强制关闭虚拟机
VBoxManage controlvm <vm_name> poweroff
更多VBoxManage用法请参考VBoxMange --help
头像
速腾1994
论坛版主
帖子: 17379
注册时间: 2008-11-01 20:43
系统: Arch+gnome

Re: <实用>使用VBoxManage 将Virtualbox放入后台运行

#2

帖子 速腾1994 » 2010-04-23 17:40

虚拟机,make
头像
ptpt52
帖子: 717
注册时间: 2008-07-27 8:51
系统: Ubuntu/Windows
来自: 广西玉林|广东深圳
联系:

Re: <实用>使用VBoxManage 将Virtualbox放入后台运行

#3

帖子 ptpt52 » 2010-04-23 17:49

mark :em11
走过去了也便有了路
http://www.ptpt52.com/
delectate
帖子: 18311
注册时间: 2008-01-09 22:41

Re: <实用>使用VBoxManage 将Virtualbox放入后台运行

#4

帖子 delectate » 2010-04-23 18:02

:em11

mark
头像
佚之狐L
帖子: 840
注册时间: 2008-01-28 13:02

Re: <实用>使用VBoxManage 将Virtualbox放入后台运行

#5

帖子 佚之狐L » 2010-04-23 18:16

还能这么玩?盖章
携书弹剑走黄沙,瀚海天山处处家;
大漠西风飞翠羽,江南八月看桂花
头像
adam8157
帖子: 2794
注册时间: 2009-03-05 16:31
联系:

Re: <实用>使用VBoxManage 将Virtualbox放入后台运行

#6

帖子 adam8157 » 2010-04-23 18:21

OSE 不支持...
头像
daf3707
论坛版主
帖子: 12739
注册时间: 2007-06-13 15:57
来自: 在他乡

Re: <实用>使用VBoxManage 将Virtualbox放入后台运行

#7

帖子 daf3707 » 2010-04-23 18:24

和虚拟机直接运行还是有些差距,只是以远程桌面的方式连接了。
jimmin
帖子: 2138
注册时间: 2006-09-24 4:37

Re: <实用>使用VBoxManage 将Virtualbox放入后台运行

#8

帖子 jimmin » 2010-04-23 18:55

mark 就想要这个,没想到真有! :em11
sonicbbs
帖子: 82
注册时间: 2009-04-23 13:35

Re: <实用>使用VBoxManage 将Virtualbox放入后台运行

#9

帖子 sonicbbs » 2010-10-15 14:58

VBoxManage startvm <vm_name> -type vrdp

用这个启动时可以的,但是会多出来一个VBoxHeadless.exe 的启动CMD。

还是有一个窗口,如何把这个窗口也消失掉?
头像
hamaburg
帖子: 284
注册时间: 2006-06-30 12:52

Re: <实用>使用VBoxManage 将Virtualbox放入后台运行

#10

帖子 hamaburg » 2010-10-23 20:45

adam8157 写了:OSE 不支持...
那就 --type headless
然后在虚拟系统中安装 vnc 或者 打开 远程 桌面
:em01
头像
Jarson
帖子: 2371
注册时间: 2008-07-21 9:44
来自: 深圳
联系:

Re: <实用>使用VBoxManage 将Virtualbox放入后台运行

#11

帖子 Jarson » 2010-10-24 17:50

虚拟系统是XP(需要密码登录)也能这么干吗?
头像
qq420100523
帖子: 1684
注册时间: 2009-07-31 18:56
系统: windows、ubuntu
来自: 广东阳江

Re: <实用>使用VBoxManage 将Virtualbox放入后台运行

#12

帖子 qq420100523 » 2010-10-24 18:10

mark
头像
自由建客
帖子: 13468
注册时间: 2008-07-30 23:21
系统: Debian stable AMD64

Re: <实用>使用VBoxManage 将Virtualbox放入后台运行

#13

帖子 自由建客 » 2010-10-26 22:14

无缝模式就无法享受了
sonicbbs
帖子: 82
注册时间: 2009-04-23 13:35

Re: <实用>使用VBoxManage 将Virtualbox放入后台运行

#14

帖子 sonicbbs » 2010-10-26 23:40

自己的问题找到一个解决方式。。但是也是头痛医头的方式。

不用下面的启动
VBoxManage startvm <vm_name> -type vrdp

而是看了一下help
写了一个BAT
用VBoxHeadless启动
但是在启动的代码前 追加了一行scrip 可以让CMD窗口1闪就关掉 然后在后台运行虚拟机。。

临时只有这个方案了。。。
回复