Inspecting and editing KVM configs
In this recipe, we are going to use the virsh
tool to inspect and edit the configuration for an existing virtual machine. As we saw earlier, once we define and start a KVM instance, libvirt
creates the XML definition file in the /etc/libvirt/qemu/
directory. We can dump the guest configuration to disk, for inspection, or to back it up. With the virsh
command we can also perform updates to the configuration in place, as we will see later in this recipe.
Getting ready
For this recipe, we are going to need the following:
- The QEMU binaries, provided after following the Installing and configuring QEMU recipe from Chapter 1, Getting Started with QEMU and KVM
- The custom raw Debian image we built in the Installing custom OS on the image with debootstrap recipe from the previous chapter, or any other virtual machine image, in either
raw
orqcow2
format - The
virsh
tool provided by completing the Installing and configuring libvirt recipe - A running
libvirt
KVM instance