Libvirt Tips and Tricks
Published: 2025-11-01
Intro
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.
Virtual Machines
List all VMs.
cmd
virsh list --allGet the `XML` for a VM.
cmd
virsh dumpxml <vm-name>Networks
List all networks.
cmd
virsh net-list --allGet the `XML` for a network
cmd
virsh net-dumpxml <network-name>DHCP
List the DHCP leases for a network.
cmd
virsh net-dhcp-leases <network-name>Outro
Get some Libvirt in your life ☮️