2010/1/26 Markus Breitländer <breitlaender@xxxxxxxxxxxxxxxxxxx>: > Hello Glennie, > > Am 26.01.2010 14:46, schrieb Glennie Vignarajah: >> Le 24/01/2010 vers 18:16, dans le message intitulé "Re: How to properly turn >> off guest VM on server shutdown?", Markus Breitländer(Markus Breitländer >> <breitlaender@xxxxxxxxxxxxxxxxxxx>) a écrit: >> >>> Hi! >> >> Hello; >> >>> Does anyone have sample scripts for this job? >> >> #!/bin/bash >> CONNECT_STRING="qemu:///system" >> for MACHINE in $(virsh -c "$CONNECT_STRING" list | awk '/running$/ {print >> $2}') ; do >> virsh -c "$CONNECT_STRING" shutdown $MACHINE >> done >> sleep 600 >> >> This code will shutdown all runnning hosts with acpi en enabled. >> I haven't tested it under windows Seven, but under win 2003, you have modify: >> >> * Using regedit the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows >> NT\CurrentVersion\Windows and set the value "ShutdownWarningDialogTimeout" to >> dword:00000001 (this will force shutdown even if users are connected) >> >> >> AND >> >> * Goto Control Pannel, admin tools and double-click "Local security settings" >> * Expand "Local policies" and click on "Security Options" (left window pan) >> * On the right side, locate "Shutdown: Allow system to be shutdown..." and >> enable the option(this allows to powerdown on ctr-alt-del screen". >> >> HTH > > I was thinking about a script that doesn't use virsh. I suppose you can start your guest with -monitor unix:/${SOCKETFILE},server,nowait and then do something like: socat - unix-connect:${SOCKETFILE} <<EOF system_powerdown EOF Best Regards Kenni Lund -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html