Setting up a correct shutdown of guest Windows 2003 in qemu-kvm Linux
This is not an article, but simply a note for those who are faced with the problem of correct shutdown. I do not pretend to originality, but the lecture collected in parts on the Internet has helped me, I hope it will help you.
1. Script for sending the guest OS shutdown signal
#!/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
2. Configure the key in the OS registry HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows NT \ CurrentVersion \ Windows ')
ShutdownWarningDialogTimeout dword: 00000001
3. Change the local security policy Control Pannel -> Admin tools -> Local security Policy Local policies -> Security Options -> Shutdown: Allow system to be shutdown ...-> Enable