Koozali.org: home of the SME Server
Obsolete Releases => SME 9.x Contribs => Topic started by: DanB35 on April 15, 2015, 02:46:23 PM
-
I've installed phpVirtualBox on my SME 9 server following http://wiki.contribs.org/Phpvirtualbox, have some VMs running, and all seems to be working well. I'd like to set things up so that two of my VMs start automatically when I boot my SME server, and stop/suspend automatically when I shut it down/reboot. The phpVirtualBox page links to http://wiki.contribs.org/VirtualBox_4.0_on_SME_Server_v8_beta_6#Automatically_Start_Virtual_Machine for that procedure, but I note that (1) the page is geared to SME 8.0b6, while current is 9.0, and (2) it's geared to VB 4.0, while current is 4.3.something.
I also note that the first step in those instructions is to edit /etc/sysconfig/vbox, which doesn't exist on my system. Are there more current instructions to do this?
-
I'd start to search with google for "virtualbox autostart vm centos"..
if you find anything usefull, please feel free to update wiki, thank you
-
OK, a few minutes with Google has found this page: http://lifeofageekadmin.com/how-to-set-your-virtualbox-vm-to-automatically-startup/
With a few alterations to be consistent with the installation on SME, the process looks like this:
- Edit /etc/default/virtualbox to add VBOXAUTOSTART_DB and VBOXAUTOSTART_CONFIG
- Create /etc/vbox/autostart.cfg giving the root user the ability to start VMs
- Since any VMs that would be running on SME are running as root, there's no need to change the group or permissions of /etc/vbox/, nor to add groups to the root user
- VBoxManage setproperty autostartdbpath /etc/vbox
- Make sure VM(s) you want to autostart aren't running
- VBoxManage modifyvm (VM name or UUID) --autostart-enabled on. Repeat this for each VM you want to start automatically.
- service vboxautostart-service start
I don't see that either /etc/default/virtualbox or anything in /etc/vbox/ are templated--the standard template warning header isn't on either file, and neither /etc/e-smith/templates/etc/default/ nor /etc/e-smith/templates/etc/vbox/ exist. This process does seem to work for me--the two VMs I want to start on boot are starting. Any red flags before I add this to the wiki for phpvirtualbox?
Edit: VBoxManage allows you to set a few other flags for the VM that may be relevant. Two are --autostop-type (I don't see that its options are documented very well, but the value of savestate will suspend the machine) and --autostart-delay (delay in seconds before the VM is started).
-
please dan, write all of this in the wiki, that could be useful for someone, I need also to find time there is a new version of phpvirtualbox
-
Done.
-
I need also to find time there is a new version of phpvirtualbox
done