guestmount
For some types of changes, you may find it easier to mount the image's file system directly
in the guest. The guestmount program, also from the libguestfs project, allows you to do
so.
For example, to mount the root partition from our centos63_desktop.qcow2 image to
/mnt, we can do:
# guestmount -a centos63_desktop.qcow2 -m /dev/vg_centosbase/lv_root --rw /mnt
If we didn't know in advance what the mount point is in the guest, we could use the -
i(inspect) flag to tell guestmount to automatically determine what mount point to use:
# guestmount -a centos63_desktop.qcow2 -i --rw /mnt
Once mounted, we could do things like list the installed packages using rpm:
# rpm -qa --dbpath /mnt/var/lib/rpm
Once done, we unmount:
# umount /mnt