Enable QEMU Guest Agent on Windows

Install the Guest agent from the ISO https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso

Edit the service startup parameters in the registry

1HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\QEMU-GA\\ImagePath = "C:\\Program Files\\qemu-ga\\qemu-ga.exe" -d -p

C:\Program Files\qemu-ga\qemu-ga.exe" -d -p

 1 <controller type='virtio-serial' index='0'>
 2  <alias name='virtio-serial0'/>
 3  <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
 4</controller>
 5
 6<channel type='unix'>
 7  <source mode='bind' path='/var/lib/libvirt/qemu/East-Maint.agent'/>
 8  <target type='virtio' name='org.qemu.guest_agent.1' state='connected'/>
 9  <alias name='channel1'/>
10  <address type='virtio-serial' controller='0' bus='0' port='2'/>
11</channel>

Test using socat to communicate with the socket defined in the XML(Might need to yum install socat -y)

1socat unix-connect:/var/lib/libvirt/qemu/GUEST_NAME.agent readline
2{"execute":"guest-info"}
3Returns:
4{"return": {"version": "0.12.1", "supported_commands": [{"enabled": true, "name": "guest-set-user-password"}, {"enabled": true, "name": "guest-set-vcpus"}, {"enabled": true, "name": "guest-get-vcpus"}, {"enabled": true, "name": "guest-network-get-interfaces"}, {"enabled": true, "name": "guest-suspend-hybrid"}, {"enabled": true, "name": "guest-suspend-ram"}, {"enabled": true, "name": "guest-suspend-disk"}, {"enabled": true, "name": "guest-fstrim"}, {"enabled": true, "name": "guest-fsfreeze-thaw"}, {"enabled": true, "name": "guest-fsfreeze-freeze"}, {"enabled": true, "name": "guest-fsfreeze-status"}, {"enabled": true, "name": "guest-file-flush"}, {"enabled": true, "name": "guest-file-seek"}, {"enabled": true, "name": "guest-file-write"}, {"enabled": true, "name": "guest-file-read"}, {"enabled": true, "name": "guest-file-close"}, {"enabled": true, "name": "guest-file-open"}, {"enabled": true, "name": "guest-shutdown"}, {"enabled": true, "name": "guest-info"}, {"enabled": true, "name": "guest-set-time"}, {"enabled": true, "name": "guest-get-time"}, {"enabled": true, "name": "guest-ping"}, {"enabled": true, "name": "guest-sync"}, {"enabled": true, "name": "guest-sync-delimited"}]}}