Page 1 of 1

Automatic startup/shutdown of VM

Posted: 22. Nov 2010, 07:33
by soulblade64
So I have a Windows 7 host, and I want to have a VM run headless on startup, and shutdown gracefully when I shut down the PC.

I have correctly created the scripts to start and shutdown the VM, when fired manually they work like a charm. Particularly I am having issues with the shutdown script. When I try adding the script in gpedit.msc, both to the shutdown and logoff scripts section, the VM fails to gracefully shut down before the the system shuts down.

Is there anything I need to put into my script to make it work, or anything I've got to configure in the host to make it wait for the script to run and shut the VM down?

Re: Automatic startup/shutdown of VM

Posted: 24. Nov 2010, 00:10
by Sasquatch
Use saved state instead of a graceful shutdown, because that takes way too long. The system only waits for a few seconds, just enough for save state to work, but too short for a graceful shutdown. Also, if it's a server OS inside the VM, it won't listen to the ACPI power button command most of the time.

Re: Automatic startup/shutdown of VM

Posted: 24. Nov 2010, 00:16
by soulblade64
Sasquatch wrote:Use saved state instead of a graceful shutdown, because that takes way too long. The system only waits for a few seconds, just enough for save state to work, but too short for a graceful shutdown. Also, if it's a server OS inside the VM, it won't listen to the ACPI power button command most of the time.
I have considered save state, but I would prefer it to shut down. I've even tried delays in the script, but that doesn't work either.

Guest OS is Windows 7, so it the ACPI power button works.

I've also realised that VBoxHeadlessTray is easier than scripting, and if I have to use save state, this is my best bet.

Re: Automatic startup/shutdown of VM

Posted: 13. May 2011, 13:01
by bodycount2
Hi, I also made .bat scripts for starting up and shutting down the machines. scripts run perfectly when started manually, but when I add them to local computer policy/window settings/scripts/shutdown, confirmation window for saving machine state pops up, how to get rid of confirmation window?

Re: Automatic startup/shutdown of VM

Posted: 13. May 2011, 19:02
by Sasquatch
What command are you using? It shouldn't ask when you use the proper command.

Re: Automatic startup/shutdown of VM

Posted: 14. May 2011, 14:22
by Leak
Sasquatch wrote:What command are you using? It shouldn't ask when you use the proper command.
He posted more details here...