Announcement

Collapse
No announcement yet.

VMWare Stop/Start Script...

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • VMWare Stop/Start Script...

    I know this had been done in here: http://forums.petri.com/showthread.p...ht=stop+script

    But.... Any know how to do this for VMWare Workstation?

    I want to be able to shutdown then backup and then restart the VM.


    Any ideas?

    Thanks

  • #2
    Re: VMWare Stop/Start Script...

    In VMware Workstation, vmware-cmd is replaced with vmrun.
    VCDX3 #34, VCDX4, VCDX5, VCAP4-DCA #14, VCAP4-DCD #35, VCAP5-DCD, VCPx4, vEXPERTx4, MCSEx3, MCSAx2, MCP, CCAx2, A+
    boche.net - VMware Virtualization Evangelist
    My advice has no warranties. Follow at your own risk.

    Comment


    • #3
      VMWare Stop/Start Script...

      Thanks jasonboche,

      I'm not sure i have this correct!

      C:
      cd "\Program Files\VMWare\VMware Workstation"
      call vmrun "D:\Virtual Machines\Server1.vmx" stop
      cd \

      I changed... \VMware Server" to \VMware Workstation

      Any ideas?

      Thanks

      Comment


      • #4
        Re: VMWare Stop/Start Script...

        Instead of simply using the stop command, use stop trysoft hard.

        stop is the command

        trysoft is the first method of stop meaning shut down the guest OS gracefully if possible

        hard is the secondary method of stop meaning if trysoft fails to shut down the VM, then just power the VM off
        VCDX3 #34, VCDX4, VCDX5, VCAP4-DCA #14, VCAP4-DCD #35, VCAP5-DCD, VCPx4, vEXPERTx4, MCSEx3, MCSAx2, MCP, CCAx2, A+
        boche.net - VMware Virtualization Evangelist
        My advice has no warranties. Follow at your own risk.

        Comment


        • #5
          Re: VMWare Stop/Start Script...

          I tried that... but no luck. What i used is:

          call "C:\Program Files\VMWare\VMware Workstation\vmrun" "D:\Virtual Machines\Server1.vmx" stop trysoft hard


          Any ideas?

          Comment


          • #6
            Re: VMWare Stop/Start Script...

            Help me help you - what are the error message or displayed symptoms?! "No Luck" doesn't get us much closer to a solution.

            Just guessing but from what you posted and knowing default VMware behavior, your VM is probably living in the path D:\Virtual Machines\Server1\Server1.vmx which would mean the path in your script above is incorrect.
            VCDX3 #34, VCDX4, VCDX5, VCAP4-DCA #14, VCAP4-DCD #35, VCAP5-DCD, VCPx4, vEXPERTx4, MCSEx3, MCSAx2, MCP, CCAx2, A+
            boche.net - VMware Virtualization Evangelist
            My advice has no warranties. Follow at your own risk.

            Comment


            • #7
              Re: VMWare Stop/Start Script...

              Sorry... Should have given more info..

              I have put that line of code into a batch file and tried to run it. a Command Prompt opens, but closes instantly. I tried this using VMs Server and it shut the machine down. I just cant get it to work with workstation.

              My reason is i want to shut down the machine at 23:00. Wait 10 mins. run a batch file to XCopy onto an external drive and then at 03:30 start the machine back up again.

              Thanks

              Neil

              Comment


              • #8
                Re: VMWare Stop/Start Script...

                Still don't have enough information to help you.

                Please open a command prompt and run your script manually so that we can see the resulting output.

                Thank you
                VCDX3 #34, VCDX4, VCDX5, VCAP4-DCA #14, VCAP4-DCD #35, VCAP5-DCD, VCPx4, vEXPERTx4, MCSEx3, MCSAx2, MCP, CCAx2, A+
                boche.net - VMware Virtualization Evangelist
                My advice has no warranties. Follow at your own risk.

                Comment


                • #9
                  Re: VMWare Stop/Start Script...

                  Image of Command Prompt:

                  Hope this helps.

                  Comment


                  • #10
                    Re: VMWare Stop/Start Script...

                    The correct command and syntax for your VM is:


                    "c:\Program Files\VMware\VMware Workstation\vmrun.exe" -T ws stop "G:\exchangesrv\exchangesrv.vmx" trysoft hard
                    VCDX3 #34, VCDX4, VCDX5, VCAP4-DCA #14, VCAP4-DCD #35, VCAP5-DCD, VCPx4, vEXPERTx4, MCSEx3, MCSAx2, MCP, CCAx2, A+
                    boche.net - VMware Virtualization Evangelist
                    My advice has no warranties. Follow at your own risk.

                    Comment

                    Working...
                    X