VBoxManage

VBoxManage虚拟机名称centos6.9-1centos6.9-2centos6.9-3使用命令开机虚拟机VBoxManagestartvm'centos6.9-1'正常启动VBoxManagestartvmcentos6.9-2-typevrdp无界面启动VBo

大家好,欢迎来到IT知识分享网。

虚拟机名称 centos6.9-1 centos6.9-2 centos6.9-3
使用命令开机 虚拟机
VBoxManage startvm ‘centos6.9-1’ 正常启动
VBoxManage startvm centos6.9-2 -type vrdp 无界面启动
VBoxManage startvm centos6.9-2 –type headless 无界面启动 推荐使用
VBoxManage startvm ‘centos6.9-3’
 
 
查看正在运行的虚拟机
VBoxManage list runningvms
 
关闭虚拟机
VBoxManage controlvm ‘centos6.9-2’ poweroff 断电关闭虚拟机
VBoxManage controlvm centos6.9-2 savestate 休眠虚拟机
VBoxManage discardstate centos6.9-2 放弃休眠,直接关闭
VBoxManage controlvm centos6.9-2 acpipowerbutton 正常关闭 centos6.9 推荐使用
 
查看快照列表
VBoxManage snapshot centos6.9-2 list
 
创建快照
VBoxManage snapshot centos6.9-2 take snap20180603 snap20180603为快照名称
删除快照
VBoxManage snapshot centos6.9-2 delete snap20180603
快照回复
uuid 使用 查看快照列表获取
VBoxManage snapshot centos6.9-2 restore 0307c6d5-1258-4cd4-984a-4341f17c1bf9 [uuid]
 
设置开机自启动
 
virtualbox(vboxmanage)自动启动虚拟机
系统centos 7,virtualbox 5,宿主机重启后,其上的虚拟机不能自动启动,怎样才能使虚拟机能随主机启动而自动启动呢?步骤如下:
步骤一:
# vi /etc/default/virtualbox
# virtualbox defaults file
VBOXAUTOSTART_DB=/etc/vbox
VBOXAUTOSTART_CONFIG=/etc/vbox/autostartvm.cfg
步骤二:
#vi /etc/vbox/autostartvm.cfg
# Default policy is to deny starting a VM, the other option is “allow”.
default_policy = deny
# Create an entry for each user allowed to run autostart
root = {
allow = true
startup_delay = 10
}
步骤三:
#VBoxManage setproperty autostartdbpath /etc/vbox
步骤四:centos6.9-2为需要开机自启动的虚拟机
#VBoxManage modifyvm centos6.9-2 –autostart-enabled on
步骤五:
#service vboxautostart-service restart –测试发现stop/start不能启动vm,而restart则可以
–详细操作参考参考文献【1】。
 
参考文献:
【1】 How To Set Your VirtualBox 4.2 VM to Automatically Startup ,

How To Set Your VirtualBox 4.2 VM to Automatically Startup

【2】 9.24. Starting virtual machines during system boot,
http://www.virtualbox.org/manual/ch09.html#autostart
【3】 8.8.9. Auto starting VMs during host system boot,
http://www.virtualbox.org/manual/ch08.html
 
如果以上不起作用的情况下
编辑shell脚本
#!/bin/bash
VBoxManage startvm centos6.9-1 –type headless
VBoxManage startvm centos6.9-2 –type headless
VBoxManage startvm centos6.9-3 –type headless
 
添加执行权限
chmod +x /etc/vbox/vm_centos.sh
加入到开机自启动脚本中
 
安装增强工具,实现文件共享
点击安装增强
 
yum -y upgrade kernel kernel-devel
yum install kernel sources kernel-devel
 
sshfs
 
挂载虚拟光驱
mount /dev/cdrom /mnt/
 
cd /mnt/ 查看列表
执行文件
./VBoxLinuxAdditions.run
 
cat /proc/version
查看版本信息,添加版本
/sbin/rcvboxadd quicksetup
/sbin/rcvboxadd quicksetup 3.10.0-957.1.3.el7.x86_64
 
/sbin/rcvboxadd quicksetup 3.10.0-957.10.1.el7.x86_64
 
执行挂载命令
VBoxManage
 
VBoxManage
# 挂载命令 共享目录 要挂载到的目录
mount -t vboxsf www /data/www/
 
 

免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://yundeesoft.com/32901.html

(0)

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

关注微信