I find that there are three options:
- Turn on the startup-setting on each of the virtual machines. Problem: Not flexible enough since I have a large amount of virtual machines.
- Define a VBScript that runs when the Virtual Server service is started. Problem: The user "NETWORK SERVICE" under which the Virtual Server service runs does not have the sufficient rights (the script reports it's started on the management page, but nothing happens. I know the script works because I can run it in my administrator command prompt without any problems).
- Define a Windows Task that is scheduled to start at system startup and runs the script as a given user. Problem: Seems like the scheduled task is started prior to the Virtual Server service and hence the virtual machines do not start (the task successfully starts the machines when I run it manually).
Do you have any tips on this one?
Regarding option two, as you mentioned, startup scripts will run under the security context of the Virtual Server service. If you want to use this method, you can assign a domain account (and appropriate permissions) to the Virtual Server service. The benefit is that you don't have to worry about the order of execution (as in option three).
And, regarding option three, you could set up dependencies or use more complex code to monitor for the start of the Virtual Server. For example, you could create your own service that specifies the Virtual Server service as a dependency. (Note: I've never done this, so I can't guarantee it will work). Regardless, I think this approach is needlessly complex.
Overall, my advice would be to build a small but simple management application that uses the Virtual Server COM API to set VM startup settings.
If that's not a good solution, feel free to follow-up with some additional details on why options one and two will not work, and I'll try to help you out. Good luck!
This was first published in May 2007