Automatic startup/shutdown of VM

Discussions related to using VirtualBox on Windows hosts.

Automatic startup/shutdown of VM

Postby soulblade64 » 22. Nov 2010, 07:33

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?
soulblade64
 
Posts: 5
Joined: 9. Oct 2008, 03:51

Re: Automatic startup/shutdown of VM

Postby Sasquatch » 24. Nov 2010, 00:10

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.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Sasquatch
Volunteer
 
Posts: 17800
Joined: 17. Mar 2008, 13:41
Location: /dev/random
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux

Re: Automatic startup/shutdown of VM

Postby soulblade64 » 24. Nov 2010, 00:16

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.
soulblade64
 
Posts: 5
Joined: 9. Oct 2008, 03:51

Re: Automatic startup/shutdown of VM

Postby bodycount2 » 13. May 2011, 13:01

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?
bodycount2
 
Posts: 2
Joined: 13. May 2011, 11:48
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: WindowsXP, Ubuntu

Re: Automatic startup/shutdown of VM

Postby Sasquatch » 13. May 2011, 19:02

What command are you using? It shouldn't ask when you use the proper command.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Sasquatch
Volunteer
 
Posts: 17800
Joined: 17. Mar 2008, 13:41
Location: /dev/random
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux

Re: Automatic startup/shutdown of VM

Postby Leak » 14. May 2011, 14:22

Sasquatch wrote:What command are you using? It shouldn't ask when you use the proper command.

He posted more details here...
Leak
 
Posts: 239
Joined: 31. Mar 2009, 13:00
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Debian Testing, Windows XP, Windows Server 2003/2008 R2


Return to VirtualBox on Windows Hosts

Who is online

Users browsing this forum: No registered users and 54 guests