virt-diff(1) | Virtualization Support | virt-diff(1) |
virt-diff - Differences between files in two virtual machines
virt-diff [--options] -d domain1 -D domain2 virt-diff [--options] -a disk1.img [-a ...] -A disk2.img [-A ...]
"virt-diff" lists the differences between files in two virtual machines or disk images. The usual use case is to show the changes in a VM after it has been running for a while, by taking a snapshot, running the VM, and then using this tool to show what changed between the new VM state and the old snapshot.
This tool will find differences in filenames, file sizes, checksums, extended attributes, file content and more from a virtual machine or disk image. However it does not look at the boot loader, unused space between partitions or within filesystems, "hidden" sectors and so on. In other words, it is not a security or forensics tool.
To specify two guests, you have to use the -a or -d option(s) for the first guest, and the -A or -D option(s) for the second guest. The common case is:
virt-diff -a old.img -A new.img
or using names known to libvirt:
virt-diff -d oldguest -D newguest
The format of the disk image is auto-detected. To override this and force a particular format use the --format=.. option.
With no argument, this defaults to using md5. Using an argument, you can select the checksum type to use. If the flag is omitted then file times and size are used to determine if a file has changed.
If you specify guest block devices directly (-a), then libvirt is not used at all.
For example:
virt-diff --format=raw -a disk.img [...]
forces raw format (no auto-detection) for disk.img.
virt-diff --format=raw -a disk.img --format -a another.img [...]
forces raw format (no auto-detection) for disk.img and reverts to auto-detection for another.img.
If you have untrusted raw-format guest disk images, you should use this option to specify the disk format. This avoids a possible security problem with malicious guests (CVE-2010-3851).
If there are multiple encrypted devices then you may need to supply multiple keys on stdin, one per line.
Note that 0 in output means "up to 1 day before now", or that the age of the file is between 0 and 86399 seconds.
Comma-separated values (CSV) is a deceptive format. It seems like it should be easy to parse, but it is definitely not easy to parse.
Myth: Just split fields at commas. Reality: This does not work reliably. This example has two columns:
"foo,bar",baz
Myth: Read the file one line at a time. Reality: This does not work reliably. This example has one row:
"foo bar",baz
For shell scripts, use "csvtool" (https://github.com/Chris00/ocaml-csv also packaged in major Linux distributions).
For other languages, use a CSV processing library (eg. "Text::CSV" for Perl or Python’s built-in csv library).
Most spreadsheets and databases can import CSV directly.
This program returns 0 if successful, or non-zero if there was an error.
guestfs(3), guestfish(1), virt-cat(1), virt-copy-out(1), virt-ls(1), virt-tar-out(1), http://libguestfs.org/.
Richard W.M. Jones http://people.redhat.com/~rjones/
Copyright (C) 2009-2020 Red Hat Inc.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
To get a list of bugs against libguestfs, use this link: https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools
To report a new bug against libguestfs, use this link: https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools
When reporting a bug, please supply:
2021-01-05 | libguestfs-1.44.0 |