Link to home
Create AccountLog in
Avatar of byronleonard
byronleonard

asked on

VMWare auto start and auto shutdown of guest OS's upon host boot and shutdown

I am looking for a way to auto start and auto shutdown my VM using VMWare Workstation 5.5

For startup I found this:
    I'm using autologin with a shortcut to vmware.exe in the startup folder. I added a bit to the shortcut
    "C:\Program Files\VMware\VMware Workstation\vmware.exe" -x "c:\vmware\win98.vmx" "c:\vmware\winxppro.vmx"
    Just set the path to your vmx files and remember to check the power on then open in the machine config.

And this:

    A companion to instsrv is srvany.exe and the method for starting VMWare as a
service is as follows: ... http://groups.google.com/group/vmware.for-windowsnt.experimental/browse_thread/thread/5db8fdb1f7bcc469/be8c1febcd7abc65?lnk=st&q=Run+VMware+Workstation+VMs+as+services&rnum=1&hl=en#be8c1febcd7abc65

However for shutdown I do not have a workable solution.

Someone mentioned using the shutdown.exe to shutdown each individual VM, but I can't find any shutdown event on my W2K3 host.

Any ideas,

Thanks,

Byron
Avatar of carl_legere
carl_legere

it can be copied from a windows XP system and works just as well, you MUST use the shutdown reason code major and minor unless you have turned off shutdown reason codes

C:\>shutdown /?
Usage: shutdown [-i | -l | -s | -r | -a] [-f] [-m \\computername] [-t xx] [-c "c
omment"] [-d up:xx:yy]

        No args                 Display this message (same as -?)
        -i                      Display GUI interface, must be the first option
        -l                      Log off (cannot be used with -m option)
        -s                      Shutdown the computer
        -r                      Shutdown and restart the computer
        -a                      Abort a system shutdown
        -m \\computername       Remote computer to shutdown/restart/abort
        -t xx                   Set timeout for shutdown to xx seconds
        -c "comment"            Shutdown comment (maximum of 127 characters)
        -f                      Forces running applications to close without war
ning
        -d [u][p]:xx:yy         The reason code for the shutdown
                                u is the user code
                                p is a planned shutdown code
                                xx is the major reason code (positive integer le
ss than 256)
                                yy is the minor reason code (positive integer le
ss than 65536)

C:\>
Avatar of byronleonard

ASKER


Thanks, but I mean the Shutdown 'event' that I can use to run a script to run shutdown.exe.

For example in my ups software I want to be able to run a script that will shutdown my VM's
ASKER CERTIFIED SOLUTION
Avatar of carl_legere
carl_legere

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer

I found it.  Thanks.

Start / Run Type gpedit.msc

Computer Configuration / Windows Settings / Scripts (Startup / Shutdown) / Shutdown

Then I can configure a VBScript to run on shutdown.