Skip to content

Instantly share code, notes, and snippets.

@wido
Created July 11, 2019 12:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wido/5b74b25f27b9b2e6d91e708b824944d7 to your computer and use it in GitHub Desktop.
Save wido/5b74b25f27b9b2e6d91e708b824944d7 to your computer and use it in GitHub Desktop.
Qemu Guest Agent cheatsheet
#!/bin/bash
#
# Talk to a Virtual Machine through the Qemu Guest Agent
#
# See:
# - https://wiki.qemu.org/Features/GuestAgent
# - https://wiki.libvirt.org/page/Qemu_guest_agent
#
# Author: Wido den Hollander <wido@denhollander.io>
#
DOMAIN="myvirtualmachine"
virsh qemu-agent-command $DOMAIN '{"execute": "guest-info"}'|jq
virsh qemu-agent-command $DOMAIN '{"execute": "guest-network-get-interfaces"}'|jq
virsh qemu-agent-command $DOMAIN '{"execute": "guest-get-fsinfo"}'|jq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment