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

Posted on 2006-03-28
Last Modified: 2008-06-20
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: ...

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,


Question by:byronleonard
    LVL 18

    Expert Comment

    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
            -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)


    Author Comment


    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
    LVL 18

    Accepted Solution

    I'm not following.  Something (manually or autmatically) has to do the shutdown.

    Author Comment


    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Just about everyone has an old PC laying around.  Ask anyone in the IT industry, whether they are a professional or play in it as a hobby.  From outdated Desktops to cheap "throwaway" laptops, they are all around and not as hard to "fix up" as you m…
    I don't know if many of you have made the great mistake of using the Cisco Thin Client model with the management software VXC. If you have then you are probably more then familiar with the incredibly clunky interface, the numerous work arounds, and …
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now