VMware Communities
Jake1042
Enthusiast
Enthusiast

Power Button on host machine

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.

0 Kudos
9 Replies
continuum
Immortal
Immortal

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


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
Jake1042
Enthusiast
Enthusiast

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?

0 Kudos
continuum
Immortal
Immortal

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


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
wila
Immortal
Immortal

Hi,

Here's a thread that might help:

VMWare Workstation 12.5 Auto Suspend of Guests when Windows Host Shuts Down

--

Wil

| Author of Vimalin. The virtual machine Backup app for VMware Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva
0 Kudos
Jake1042
Enthusiast
Enthusiast

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

0 Kudos
wila
Immortal
Immortal

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 Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva
0 Kudos
Jake1042
Enthusiast
Enthusiast

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.

0 Kudos
RDPetruska
Leadership
Leadership

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

0 Kudos
kopseng
Enthusiast
Enthusiast

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

0 Kudos