If we want to modify the QCOW2 image that we have just created or the one that is downloaded from the Internet, without booting, we could do so by using the guestfish utility. This is provided by the libguestfs
library.
The installation of guestfish is fairly simple.
apt-get install libguestfs-tools
On some versions (like 12.04), the command is apt-get install guestfish
. It will also ask for the creation of the virtual appliance; please do so. Once the appliance is installed, you can then execute the command sudo guestfish
(or as root).