1virt-diff(1) Virtualization Support virt-diff(1)
2
3
4
6 virt-diff - Differences between files in two virtual machines
7
9 virt-diff [--options] -d domain1 -D domain2
10
11 virt-diff [--options] -a disk1.img [-a ...] -A disk2.img [-A ...]
12
14 "virt-diff" lists the differences between files in two virtual machines
15 or disk images. The usual use case is to show the changes in a VM
16 after it has been running for a while, by taking a snapshot, running
17 the VM, and then using this tool to show what changed between the new
18 VM state and the old snapshot.
19
20 This tool will find differences in filenames, file sizes, checksums,
21 extended attributes, file content and more from a virtual machine or
22 disk image. However it does not look at the boot loader, unused space
23 between partitions or within filesystems, "hidden" sectors and so on.
24 In other words, it is not a security or forensics tool.
25
26 To specify two guests, you have to use the -a or -d option(s) for the
27 first guest, and the -A or -D option(s) for the second guest. The
28 common case is:
29
30 virt-diff -a old.img -A new.img
31
32 or using names known to libvirt:
33
34 virt-diff -d oldguest -D newguest
35
37 --help
38 Display brief help.
39
40 -a file
41 --add file
42 Add file which should be a disk image from the first virtual
43 machine. If the virtual machine has multiple block devices, you
44 must supply all of them with separate -a options.
45
46 The format of the disk image is auto-detected. To override this
47 and force a particular format use the --format=.. option.
48
49 -a URI
50 --add URI
51 Add a remote disk. See "ADDING REMOTE STORAGE" in guestfish(1).
52
53 --all
54 Same as --extra-stats --times --uids --xattrs.
55
56 --atime
57 The default is to ignore changes in file access times, since those
58 are unlikely to be interesting. Using this flag shows atime
59 differences as well.
60
61 -A file
62 -A URI
63 Add a disk image from the second virtual machine.
64
65 --blocksize=512
66 --blocksize=4096
67 --blocksize
68 This parameter sets the sector size of the disk image. It affects
69 all explicitly added subsequent disks after this parameter. Using
70 --blocksize with no argument switches the disk sector size to the
71 default value which is usually 512 bytes. See also
72 "guestfs_add_drive_opts" in guestfs(3).
73
74 --checksum
75 --checksum=crc|md5|sha1|sha224|sha256|sha384|sha512
76 Use a checksum over file contents to detect when regular files have
77 changed content.
78
79 With no argument, this defaults to using md5. Using an argument,
80 you can select the checksum type to use. If the flag is omitted
81 then file times and size are used to determine if a file has
82 changed.
83
84 -c URI
85 --connect URI
86 If using libvirt, connect to the given URI. If omitted, then we
87 connect to the default libvirt hypervisor.
88
89 If you specify guest block devices directly (-a), then libvirt is
90 not used at all.
91
92 --csv
93 Write out the results in CSV format (comma-separated values). This
94 format can be imported easily into databases and spreadsheets, but
95 read "NOTE ABOUT CSV FORMAT" below.
96
97 --dir-links
98 The default is to ignore changes in the number of links in
99 directory entries, since those are unlikely to be interesting.
100 Using this flag shows changes to the nlink field of directories.
101
102 --dir-times
103 The default is to ignore changed times on directory entries, since
104 those are unlikely to be interesting. Using this flag shows
105 changes to the time fields of directories.
106
107 -d guest
108 --domain guest
109 Add all the disks from the named libvirt guest, as the first guest.
110 Domain UUIDs can be used instead of names.
111
112 -D guest
113 Add all the disks from the named libvirt guest, as the second
114 guest. Domain UUIDs can be used instead of names.
115
116 --echo-keys
117 When prompting for keys and passphrases, virt-diff normally turns
118 echoing off so you cannot see what you are typing. If you are not
119 worried about Tempest attacks and there is no one else in the room
120 you can specify this flag to see what you are typing.
121
122 --extra-stats
123 Display extra stats.
124
125 --format=raw|qcow2|..
126 --format
127 The default for the -a/-A option is to auto-detect the format of
128 the disk image. Using this forces the disk format for -a/-A
129 options which follow on the command line. Using --format with no
130 argument switches back to auto-detection for subsequent -a/-A
131 options.
132
133 For example:
134
135 virt-diff --format=raw -a disk.img [...]
136
137 forces raw format (no auto-detection) for disk.img.
138
139 virt-diff --format=raw -a disk.img --format -a another.img [...]
140
141 forces raw format (no auto-detection) for disk.img and reverts to
142 auto-detection for another.img.
143
144 If you have untrusted raw-format guest disk images, you should use
145 this option to specify the disk format. This avoids a possible
146 security problem with malicious guests (CVE-2010-3851).
147
148 -h
149 --human-readable
150 Display file sizes in human-readable format.
151
152 --key SELECTOR
153 Specify a key for LUKS, to automatically open a LUKS device when
154 using the inspection.
155
156 --key NAME:key:KEY_STRING
157 --key UUID:key:KEY_STRING
158 --key all:key:KEY_STRING
159 "NAME" is the libguestfs device name (eg. "/dev/sda1"). "UUID"
160 is the device UUID. "all" means try the key against any
161 encrypted device.
162
163 Use the specified "KEY_STRING" as passphrase.
164
165 --key NAME:file:FILENAME
166 --key UUID:file:FILENAME
167 --key all:file:FILENAME
168 Read the passphrase from FILENAME.
169
170 --key NAME:clevis
171 --key UUID:clevis
172 --key all:clevis
173 Attempt passphrase-less unlocking for the device with Clevis,
174 over the network. Please refer to "ENCRYPTED DISKS" in
175 guestfs(3) for more information on network-bound disk
176 encryption (NBDE).
177
178 Note that if any such option is present on the command line,
179 QEMU user networking will be automatically enabled for the
180 libguestfs appliance.
181
182 --keys-from-stdin
183 Read key or passphrase parameters from stdin. The default is to
184 try to read passphrases from the user by opening /dev/tty.
185
186 If there are multiple encrypted devices then you may need to supply
187 multiple keys on stdin, one per line.
188
189 --times
190 Display time fields.
191
192 --time-days
193 Display time fields as days before now (negative if in the future).
194
195 Note that 0 in output means "up to 1 day before now", or that the
196 age of the file is between 0 and 86399 seconds.
197
198 --time-relative
199 Display time fields as seconds before now (negative if in the
200 future).
201
202 --time-t
203 Display time fields as seconds since the Unix epoch.
204
205 --uids
206 Display UID and GID fields.
207
208 -v
209 --verbose
210 Enable verbose messages for debugging.
211
212 -V
213 --version
214 Display version number and exit.
215
216 -x Enable tracing of libguestfs API calls.
217
218 --xattrs
219 Display extended attributes.
220
222 Comma-separated values (CSV) is a deceptive format. It seems like it
223 should be easy to parse, but it is definitely not easy to parse.
224
225 Myth: Just split fields at commas. Reality: This does not work
226 reliably. This example has two columns:
227
228 "foo,bar",baz
229
230 Myth: Read the file one line at a time. Reality: This does not work
231 reliably. This example has one row:
232
233 "foo
234 bar",baz
235
236 For shell scripts, use "csvtool" (https://github.com/Chris00/ocaml-csv
237 also packaged in major Linux distributions).
238
239 For other languages, use a CSV processing library (eg. "Text::CSV" for
240 Perl or Python’s built-in csv library).
241
242 Most spreadsheets and databases can import CSV directly.
243
245 This program returns 0 if successful, or non-zero if there was an
246 error.
247
249 guestfs(3), guestfish(1), virt-cat(1), virt-copy-out(1), virt-ls(1),
250 virt-tar-out(1), http://libguestfs.org/.
251
253 Richard W.M. Jones http://people.redhat.com/~rjones/
254
256 Copyright (C) 2009-2023 Red Hat Inc.
257
259 This program is free software; you can redistribute it and/or modify it
260 under the terms of the GNU General Public License as published by the
261 Free Software Foundation; either version 2 of the License, or (at your
262 option) any later version.
263
264 This program is distributed in the hope that it will be useful, but
265 WITHOUT ANY WARRANTY; without even the implied warranty of
266 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
267 General Public License for more details.
268
269 You should have received a copy of the GNU General Public License along
270 with this program; if not, write to the Free Software Foundation, Inc.,
271 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
272
274 To get a list of bugs against libguestfs, use this link:
275 https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools
276
277 To report a new bug against libguestfs, use this link:
278 https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools
279
280 When reporting a bug, please supply:
281
282 • The version of libguestfs.
283
284 • Where you got libguestfs (eg. which Linux distro, compiled from
285 source, etc)
286
287 • Describe the bug accurately and give a way to reproduce it.
288
289 • Run libguestfs-test-tool(1) and paste the complete, unedited output
290 into the bug report.
291
292
293
294guestfs-tools-1.51.6 2023-12-09 virt-diff(1)