How it works...
As hinted at previously, when you create a VM using virt-install, what you're actually doing is writing an initial XML file that contains the recipe for how the VM looks and acts.
This file actually exists at /etc/libvirt/qemu/ex-alpine-2.xml and can be read in the same way as any other file on the system (virsh just makes it easier, like systemctl cat).
When we use tools such as virt-install, virt-viewer, or any of the virt-* suite, we're taking a lot of typing and copying of files out of the equation. You can write a runbook that recreates an environment with just a few one-line commands. Virsh then exists to query your setup and get some basic information about the solutions you've spun up.
We can use something like virsh ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access