Changes

From SME Server
Jump to navigationJump to search
2,442 bytes added ,  16:56, 15 April 2015
Add instructions to autostart one or more virtual machines
Line 192: Line 192:  
  svc -t /service/httpd-e-smith/
 
  svc -t /service/httpd-e-smith/
 
  svc -t /service/httpd-admin/
 
  svc -t /service/httpd-admin/
 +
 +
=== Autostart Virtual Machines ===
 +
Once you have one or more virtual machines installed and running, you may want them to start automatically on system boot.  To do this, you will need to stop the virtual machines in question, create one configuration file, edit another, and set some properties using the VBoxManage utility.
 +
====Stop the virtual machines====
 +
Using the phpVirtualBox web interface, power down or save state the virtual machine(s) you want to set to start automatically.  Alternatively, log in to those virtual machines and shut them down.  Confirm in the phpVirtualBox web interface that the status is not "Running".
 +
====Create /etc/vbox/autostart.cfg====
 +
[root@e-smith ~]# '''nano -w /etc/vbox/autostart.cfg'''
 +
 +
Add the following to this file:
 +
# 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
 +
}
 +
 +
====Edit /etc/default/virtualbox====
 +
[root@e-smith ~]# '''nano -w /etc/default/virtualbox'''
 +
Add these two lines:
 +
VBOXAUTOSTART_DB=/etc/vbox
 +
VBOXAUTOSTART_CONFIG=/etc/vbox/autostart.cfg
 +
 +
====Using VBoxManage to set properties====
 +
First, tell VirtualBox where your autostart configuration is:
 +
[root@e-smith ~]# '''VBoxManage setproperty autostartdbpath /etc/vbox'''
 +
 +
Next, use VBoxManage to list your installed virtual machines:
 +
[root@e-smith ~]# '''VBoxManage list vms'''
 +
"Elastix 3.0.0-RC1" {6259ddda-888d-43e9-9364-25867668d889}
 +
"PIAF 3" {69d75c64-4cfe-4023-a4a2-b2b39a442746}
 +
"IncrediblePBX 12" {e7e4845b-8178-4e87-aceb-7f2a78c77977}
 +
"Ubuntu 14.04.1 LTS" {6094a7e0-5b3c-4cc3-b8c8-f55a9716318b}
 +
"Asterisk-GUI" {19d53974-512b-443b-8fd9-aff80c207bd9}
 +
"Windows 7" {df3d3440-3113-4c91-9890-5323f99d755c}
 +
 +
Then, set your desired virtual machines to start automatically, with an optional delay, and optionally to suspend (rather than power down) when your SME server shuts down or reboots.  You can specify the virtual machine by name or by UUID:
 +
[root@e-smith ~]# '''VBoxManage modifyvm "IncrediblePBX 12" --autostart-enabled on --autostart-delay 15'''
 +
[root@e-smith ~]# '''VBoxManage modifyvm df3d3440-3113-4c91-9890-5323f99d755c --autostart-enabled on --autostop-type savestate
 +
 +
Finally, start the vboxautostart-service service:
 +
[root@e-smith ~]# '''service vboxautostart-service start'''
 +
 +
Confirm that the desired virtual machines are running in the phpVirtualBox web interface.
    
=== Uninstall ===
 
=== Uninstall ===
147

edits

Navigation menu