I'm running a Windows 7 in a KVM virtual machine on my laptop.
When there is no user logged in or if I'm logged in but the session is not locked, I can ask Windows to shutdown or reboot directly from the host (ACPI signal?).
But when the session is locked, nothing is happening anymore.
This is quite annoying because if I forget to shutdown the VM (or unlock the session) before shutting down the host, the VM is just killed.
I'm looking for a way to make Windows behave the same way as when the session is unlocked. An idea?
Edit: It's Windows 7 enterprise and it's linked to an AD, but I'm never connecting to it.
As you discovered, when the session is locked Windows does not respond to ACPI events. However, you can shutdown the machine via WMI and other APIs.
As a side note, I did some testing on how Windows responds to ACPI shutdown event. You can find more here
Having looked around a bit, it appears there is unfortunately no way to enable reboot/shutdown from the start menu in a remote session in Windows 7, even through group policies :( I guess Windows 7 is designed for a "dumber" user on average, considering Server 2008 is not gimped in this way :) I guess my main method will be to press Ctrl-Alt-End (remote equivalent to Ctrl-Alt-Del) and then use the shutdown options from that dialog.