Setting a Virtual Machine to Automatically Start
One of the problems I had with our development and testing virtual server at work was that automatic updates on the host machine (necessary to maintain security) would reboot the server and our virtual machines would no longer be running.
Fair enough; you would expect that. And the solution is to obviously set them to auto start once virtual server has booted and the service is running. Here are the steps to get the whole thing working:
1. Create a user account
The best way to tackle this step is to create a local user account that is dedicated to automating virtual machines. This user account should not be given any permissions on the server (preferably not even ‘Allow log on locally‘ rights but unfortunately when I tested this it failed to start the VMs) and should be given a strong password. See below:

Create the Local User account
2. Apply permissions to virtual machines
Once you have your user account created and ready, you must give it permissions to read, write, and modify your virtual machine’s .VHD and .VMC files. When I did this, I added these permissions to my root virtual machines folder to allow all virtual machines to inherit the permissions and therefore start automatically from this account. See below:

Applying permissions to the virtual machines folder
3. Apply permissions to virtual network configuration files
In order to access the virtual networks (and physical networks!) permissions need to be added to read, write, and modify the .VNC files that represent each network available to the VM. You can find these configuration files (by default) in “C:\Documents and Settings\All Users\Documents\Shared Virtual Networks”, then add the permissions as shown:

Applying virtual network permissions to the Shared Networks folder
4. Set the virtual machine to automatically start using the new user account
Head on over to your Virtual Server administration page and select Edit Configuration for the virtual machine you wish to automate. If the virtual machine is currently running, you must ensure it is fully stopped before setting it to automatically start (the site will prevent you from changing any settings):

Edit configuration for the virtual machine
Next select the General properties link to go to the required section to add automation for the virtual machine:

General properties for the virtual machine
You should be presented with the following page, which is pretty self-explanitory:
Tick Run virtual machine under the following user account and enter the user account you created under User name and Password in the form of <Server>\<Account> (so in my example it is XAVIER\LocalVSUser) then select what conditions you wish the server to be started from, and what type of delay you would like to give before it starts. I usually give each VM a 360 second delay to allow adequate time for other services to finish loading before the Virtual Server takes over the system.
Done!
This should be all you need to set the virtual machine to automatically start. One thing to remember is that most problems that arise from being unable to run or use a virtual machine when set to automatically start come from permissions. Extra help is available from Microsoft here: Modifying general virtual machine properties.



Leave a Reply