Scripting Automatic Startup For Virtual Machines Under Virtual Server
Friday, 17 March 2006 by Michel Roth
Virtual Server allows you to configure virtual machines to startup automatically when the host system boots. However in order to enable this feature you need to configure a user account to run the virtual machine under first (as when the host system boots there is no available user session to run the virtual machine under). Below is a script that will configure a virtual machine to start automatically when the host system boots - if it was running when the host system shutdown:

Set objVS = CreateObject("VirtualServer.Application")
Set objVM = objVS.FindVirtualMachine("VM Name")
objVM.RunAsDefinedAccount = True
result = objVM.SetAccountNameAndPassword("DOMAIN\Username","Password")
objVM.AutoStartAtLaunch = 2


If you want the virtual machine to always start (whether it was running before or not) you should set AutoStartAtLaunch to 1.

Read the whole tip at the source, Virtual PC Guy's WebLog.

Related Items:

Virtual Machine Network Driver For Microsoft Device Emulator (23 November 2005)
Virtual PC 2004 SP1 And LPT Ports (7 March 2006)
Performance Optimization For VMs (20 September 2006)
New Features In Future Versions Virtual Server (Not R2) (29 August 2005)
Time Synchronization In Virtual Machines (2 February 2006)
Optimizing Windows Vista Under Virtual PC (21 March 2006)
ESXGuide Releases ESX Manager 2.1 (18 July 2007)
Using EFS Encryption To Secure Your Virtual Domain Controllers (7 March 2006)
ESX Manager 2.3 (16 July 2008)
Looking at the VM Heartbeat with WMI (13 October 2006)
Comments (0)