9 Replies Latest reply on Sep 30, 2019 3:09 AM by kopseng

    Power Button on host machine

    Jake1042 Novice

      In various search results on the topic - like VMware Workstation Documentation Center it looks like I can configure the VMware to respond to the power button on the host machine.This is for Workstation 9....

       

      But when I look at the VMworkstation 15 - it do not have such options on the "Virtual Machine Settings" -> "Options" -> "Power"

      Here I can select two check-points "Enter full screen mode after powering on" and "Report battery information to guest" (which is greyed out as the host PC does not have a battery.

       

      So - how do I set the "Power" option? I would like the power button on the host PC to shut down the virtual machine.

        • 1. Re: Power Button on host machine
          continuum Guru
          vExpertCommunity Warriors

          > it looks like I can configure the VMware to respond to the power button on the host machine.This is for Workstation 9....
          Sorry to disapoint you: you missread that part.
          > I would like the power button on the host PC to shut down the virtual machine.
          You can of course do that - but in most cases this will not result in a clean shut down of the VMs.
          So dont do that.

          • 2. Re: Power Button on host machine
            Jake1042 Novice

            OK - maybe I got it wrong.

             

            But is there some way I can make the virtual machine make a normal shutdown when the power button on the host-PC is pressed?

             

            On my host PC I can specify what happens "when I press the power button" - one of the options is "Shut down".

             

            Can I somehow communicate that to the Virtual Machine?

             

            My goal is to make the best possible shutdown of the entire system (host PC and virtual machine) when the power button is pressed on the host PC.

             

            Please bear this goal in mind when making suggestions. Maybe there is a completely other way to achieve my goal?

            • 3. Re: Power Button on host machine
              continuum Guru
              Community WarriorsvExpert

              > My goal is to make the best possible shutdown of the entire system (host PC and virtual machine) when the power button is pressed on the host PC.
              The best option for this purpose is to create a batch-file and store it on your desktop.
              This batch would include a command line that powers off each VM. You can use vmrun to do that or use something more sophisticated like a ssh-script that connects to each running VM and powers it off via ssh.
              The last line would then be a Windows cmd that finally powers off the host.
              It may be possible to assign such a batch to the shutdown button via a registry entry but I would have to look it up.
              > On my host PC I can specify what happens "when I press the power button" - one of the options is "Shut down".
              If you can assign a custom batch for this purpose it would solve your request.

              • 4. Re: Power Button on host machine
                wila Guru
                Community WarriorsUser ModeratorsvExpert
                | Author of Vimalin. The virtual machine Backup app for VMware Desktop Products
                | Vimalin : Automated backups for VMware Fusion and VMware Workstation and Player
                | More info at https://www.vimalin.com
                | Twitter @wilva
                | VMware Wiki at http://www.vi-toolkit.com
                • 5. Re: Power Button on host machine
                  Jake1042 Novice

                  Thanks for this. I will have to dig into this in more detail if I shall make it work.

                   

                  Had hoped for a simple "check box solution" based on an already available feature in the VMware Workstation Player 15...

                  • 6. Re: Power Button on host machine
                    wila Guru
                    User ModeratorsvExpertCommunity Warriors

                    Hi,

                     

                    It is a "checkbox solution" if you use shared VMs.

                    However there's a mixed bag of responses here at the forum on how well that works.

                     

                    So I am not yet convinced that it always works as designed, but that's the sceptic in me talking.

                    --

                    Wil

                    | Author of Vimalin. The virtual machine Backup app for VMware Desktop Products
                    | Vimalin : Automated backups for VMware Fusion and VMware Workstation and Player
                    | More info at https://www.vimalin.com
                    | Twitter @wilva
                    | VMware Wiki at http://www.vi-toolkit.com
                    • 7. Re: Power Button on host machine
                      Jake1042 Novice

                      What does "shared WMs" mean?

                       

                      I have Workstation Player on a stand-alone PC (running Windows 10). The PC is not on the internet.

                       

                      When starting up the PC a script file starts the win10 VMware in full-screen mode, which then autostarts my application - and that's it.

                       

                      If somebody activates the power button - I would like everything to shut down nicely.

                       

                      If I hold in the power button - the host PC simply stops and takes the VMware down. It has survived this on previous occasions - but I guess a controlled shutdown of first the VMware and then the host is desirable.

                      • 8. Re: Power Button on host machine
                        RDPetruska Guru
                        User ModeratorsvExpert

                        Shared Virtual Machines is an option with Workstation Pro, not with Player. 

                        • 9. Re: Power Button on host machine
                          kopseng Novice

                          Put the previously mentioned script and solution up on GitHub: GitHub - fatso83/vmware-auto-suspend: Auto-suspend all VMs in case of a Windows shutdown or logout .

                           

                          Feel free to help improve the solution, for instance by adding automation of the Windows Task creation (which I assume is possible).