published: 1st of November 2025
Libvirt provides a common API and daemon to interact with various hypervisors and virtualization technologies, including KVM, QEMU, Xen, LXC, etc..
This post is just a collection of helpful tips and tricks that I common use with my libvirt workflows. This post will be updated periodically with new and exciting propaganda.
List all VMs.
virsh list --all
Get the `XML` for a VM.
virsh dumpxml <vm-name>
List all networks.
virsh net-list --all
Get the `XML` for a network
virsh net-dumpxml <network-name>
List the DHCP leases for a network.
virsh net-dhcp-leases <network-name>
Get some Libvirt in your life ☮️