Shutdown VMware guest applications when UPS kicks in

1

My situation is that I am running VMware workstation to run a LAMP server for some lightweight data collection.

My host OS is Windows XP. I have a APC UPS that is set to shut down the PC via PowerChute if a power outage hits.

What I am wondering is if there is some way to gracefully shut down the LAMP server because I am pretty sure that VMware will keep PowerChute from shutting down the PC if there is a VMware appliance running.

Chris

Posted 2009-11-09T15:45:53.030

Reputation: 233

Can you show me an example of the window that pops up when the PC is trying to shut down (The vmware one). IIRC it says something like virtual machine still in use but I need the exact text and I can make you an autohotkey script to close the virtual machine properly. – John T – 2009-11-09T15:52:01.270

http://i33.tinypic.com/2z9mq77.jpg – Chris – 2009-11-09T15:56:34.397

Ah, thanks! Gonna need the file menu and shutdown dialog too (power off machine, send shutdown signal...) sorry for the hassle! – John T – 2009-11-09T16:03:01.123

http://i35.tinypic.com/2rmo9co.jpg -- Shut Down Guest is the option that must be used. Followed by http://i33.tinypic.com/snmpog.jpg – Chris – 2009-11-09T16:29:21.740

Answers

2

This should do the trick:

#Persistent
SetTitleMatchMode, Slow
WinWait,,virtual machine is in use,,,
{
    WinMaximize
    Send { Enter }
    Send { Alt } 
    Send { Right 3 }
    Send { Down }
    Send { Right }
    Send { Down 5 }
    Send { Enter }
    Sleep 5000
    Send { Enter }
}

You'll need to install AutoHotkey

John T

Posted 2009-11-09T15:45:53.030

Reputation: 149 037

It worked first try? Even I'm surprised. You're very welcome :) – John T – 2009-11-09T23:32:58.093