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
步骤四:vm1为需要开机自启动的虚拟机
#VBoxManage modifyvm vm1 --autostart-enabled on
步骤五:
#service vboxautostart-service restart --测试发现stop/start不能启动vm,而restart则可以
--详细操作参考参考文献【1】。
参考文献:
【1】 How To Set Your VirtualBox 4.2 VM to Automatically Startup ,http://lifeofageekadmin.com/how-to-set-your-virtualbox-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
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/16976507/viewspace-2131041/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/16976507/viewspace-2131041/