guestfs-recipes (1) Linux Manual Page
NAME
guestfs-recipes – libguestfs, guestfish and virt tools recipes
DESCRIPTION
This page contains recipes for and links to things you can do using libguestfs, guestfish(1) and the virt tools.
Access a remote disk image using guestfish
If the disk image is on a remote server which is accessible using SSH, HTTP, FTP, NBD, iSCSI, or similar, then you can open it directly. See “ADDING REMOTE STORAGE” in guestfish(1) for several examples. This requires libguestfs ≥ 1.22 and qemu ≥ 1.5.
Audit a virtual machine for setuid files
See: “EXAMPLES” in virt-ls(1).
Audit a virtual machine for vulnerabilities and security problems
See: https://rwmj.wordpress.com/2013/05/16/scanning-offline-guests-using-openscap-and-guestmount/#content
Change the background image in a Windows XP VM
The links below explain how to use guestfish(1) to change the background image for a user of a Windows XP VM. Unfortunately the technique appears to be substantially different for each version of Windows.
https://lists.fedoraproject.org/pipermail/virt/2011-May/002655.html https://lists.fedoraproject.org/pipermail/virt/2011-May/002658.html
Checksum a file or device within a disk image
To checksum a whole device, or a partition, LV etc within a disk image:
guestfish --ro -a disk.img run : checksum-device md5 /dev/sda1
Replace "md5" with the type of checksum you want. See “guestfs_checksum_device” in guestfs(3) for a list of supported types.
/dev/sda1 means “the first partition”. You could use /dev/sda to checksum the whole disk image, or the name of a logical volume or RAID device.
To checksum a single file:
guestfish --ro -a disk.img -i checksum sha256 /etc/passwd
or for a Windows guest:
guestfish --ro -a disk.img -i \
checksum sha256 'win:\windows\system32
