22.13. virt-diff: Listing the Differences between Virtual Machine Files
virt-diffcommand-line tool can be used to lists the differences between files in two virtual machines disk images. The output shows the changes to a virtual machine's disk images after it has been running. The command can also be used to show the difference between overlays.
virt-diffsafely on live guest virtual machines, because it only needs read-only access.
virt-diffcommand does not check the boot loader, unused space between partitions or within file systems, or "hidden" sectors. Therefore, it is recommended that you do not use this as a security or forensics tool.
yum install /usr/bin/virt-diff
yum install libguestfs-tools-c
-doption for the first guest, and the
-Doption for the second guest. For example:
virt-diff -a old.img -A new.img
virt-diff -d oldguest -D newguest
|--help||Displays a brief help entry about a particular command or about the virt-diff package. For additional help, see the virt-diff man page.|| $ |
|-a [file] or --add [file]|| |
Adds the specified file, which should be a disk image from the first virtual machine. If the virtual machine has multiple block devices, you must supply all of them with separate
The format of the disk image is auto-detected. To override this and force a particular format, use the
| $ |
|-a [URI] or --add [URI]||Adds a remote disk. The URI format is compatible with guestfish. For more information, refer to Section 22.4.2, “Adding Files with guestfish”.|| $ |
|--all|| Same as || $ |
|--atime|| By default, || $ |
|-A [file]||Adds the specified file or URI, which should be a disk image from the second virtual machine.|| $ |
|-c [URI] or --connect [URI]|| Connects to the given URI, if using libvirt. If omitted, then it connects to the default libvirt hypervisor. If you specify guest block devices directly (|| $ |
|--csv||Provides the results in a comma-separated values (CSV) format. This format can be imported easily into databases and spreadsheets. For further information, see Note.||virt-diff --csv|
|-d [guest] or --domain [guest]||Adds all the disks from the specified guest virtual machine as the first guest virtual machine. Domain UUIDs can be used instead of domain names.|| $ |
|-D [guest]||Adds all the disks from the specified guest virtual machine as the second guest virtual machine. Domain UUIDs can be used instead of domain names.|| $ |
|--extra-stats||Displays extra statistics.|| $ |
| --format or --format=[|| The default for the || $ |
|-h or --human-readable||Displays file sizes in human-readable format.|| $ |
Displays time fields for changed files as days before now (negative if in the future).
| $ |
|-v or --verbose||Enables verbose messages for debugging purposes.|| $ |
|-V or --version||Displays the virt-diff version number and exits.|| $ |
|-x||Enables tracing of libguestfs API calls.|| $ |