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 --all

Get the `XML` for a VM.

cmd
virsh dumpxml <vm-name>

Networks

List all networks.

cmd
virsh net-list --all

Get 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 ☮️