参考
http://lifeofageekadmin.com/how-to-set-your-virtualbox-vm-to-automatically-startup/
步骤
- vi /etc/default/virtualbox
# virtualbox defaults file
VBOXAUTOSTART_DB=/etc/vbox
VBOXAUTOSTART_CONFIG=/etc/vbox/autostart.cfg
- vi /etc/vbox/autostart.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
userid = {
allow = true
}
- 设置权限
sudo chgrp vboxusers /etc/vbox
sudo chmod 1775 /etc/vbox
sudo usermod -a -G vboxusers $USER
- 设置virtualbox 属性
VBoxManage setproperty autostartdbpath /etc/vbox
- 设置要开机启动的vm
VBoxManage modifyvm <uuid|vmname> --autostart-enabled on