guidevirshReviewed July 15, 2026
Daily domain operations with virsh
Start every change by pinning the URI, capturing current state, and defining the evidence that will prove success. Inventory before change Apply and verify Use config, live, or both deliberately for device changes. A liv
virshoperationsinventoryconsole
Start every change by pinning the URI, capturing current state, and defining the evidence that will prove success.
Inventory before change
BASH
virsh -c qemu:///system list --all
virsh -c qemu:///system dominfo guest01
virsh -c qemu:///system dumpxml guest01 > /root/guest01.before.xml
virsh -c qemu:///system domblklist guest01 --details
virsh -c qemu:///system domiflist guest01Apply and verify
BASH
virsh shutdown guest01
virsh domstate guest01 --reason
virsh start guest01
virsh domstate guest01 --reason
virsh domifaddr guest01 --source agentUse --config, --live, or both deliberately for device changes. A live-only change can disappear at reboot; a config-only change will not affect the running guest.
Recovery boundary
Keep the pre-change XML until the guest has restarted and service checks pass. Reapply it with virsh define /root/guest01.before.xml when the persistent definition must be restored.