1virt-log(1) Virtualization Support virt-log(1)
2
3
4
6 virt-log - Display log files from a virtual machine
7
9 virt-log [--options] -d domname
10
11 virt-log [--options] -a disk.img [-a disk.img ...]
12
14 "virt-log" is a command line tool to display the log files from the
15 named virtual machine (or disk image).
16
17 This tool understands and displays both plain text log files (eg.
18 /var/log/messages) and binary formats such as the systemd journal.
19
20 To display other types of files, use virt-cat(1). To follow (tail)
21 text log files, use virt-tail(1). To copy files out of a virtual
22 machine, use virt-copy-out(1). To display the contents of the Windows
23 Registry, use virt-win-reg(1).
24
26 Display the complete logs from a guest:
27
28 virt-log -d mydomain | less
29
30 Find out what DHCP IP address a VM acquired:
31
32 virt-log -d mydomain | grep 'dhclient.*bound to'
33
35 --help
36 Display brief help.
37
38 -a file
39 --add file
40 Add file which should be a disk image from a virtual machine. If
41 the virtual machine has multiple block devices, you must supply all
42 of them with separate -a options.
43
44 The format of the disk image is auto-detected. To override this
45 and force a particular format use the --format=.. option.
46
47 -a URI
48 --add URI
49 Add a remote disk. See "ADDING REMOTE STORAGE" in guestfish(1).
50
51 --blocksize=512
52 --blocksize=4096
53 --blocksize
54 This parameter sets the sector size of the disk image. It affects
55 all explicitly added subsequent disks after this parameter. Using
56 --blocksize with no argument switches the disk sector size to the
57 default value which is usually 512 bytes. See also
58 "guestfs_add_drive_opts" in guestfs(3).
59
60 -c URI
61 --connect URI
62 If using libvirt, connect to the given URI. If omitted, then we
63 connect to the default libvirt hypervisor.
64
65 If you specify guest block devices directly (-a), then libvirt is
66 not used at all.
67
68 -d guest
69 --domain guest
70 Add all the disks from the named libvirt guest. Domain UUIDs can
71 be used instead of names.
72
73 --echo-keys
74 When prompting for keys and passphrases, virt-log normally turns
75 echoing off so you cannot see what you are typing. If you are not
76 worried about Tempest attacks and there is no one else in the room
77 you can specify this flag to see what you are typing.
78
79 --format=raw|qcow2|..
80 --format
81 The default for the -a option is to auto-detect the format of the
82 disk image. Using this forces the disk format for -a options which
83 follow on the command line. Using --format with no argument
84 switches back to auto-detection for subsequent -a options.
85
86 For example:
87
88 virt-log --format=raw -a disk.img
89
90 forces raw format (no auto-detection) for disk.img.
91
92 virt-log --format=raw -a disk.img --format -a another.img
93
94 forces raw format (no auto-detection) for disk.img and reverts to
95 auto-detection for another.img.
96
97 If you have untrusted raw-format guest disk images, you should use
98 this option to specify the disk format. This avoids a possible
99 security problem with malicious guests (CVE-2010-3851).
100
101 --key SELECTOR
102 Specify a key for LUKS, to automatically open a LUKS device when
103 using the inspection.
104
105 --key NAME:key:KEY_STRING
106 --key UUID:key:KEY_STRING
107 --key all:key:KEY_STRING
108 "NAME" is the libguestfs device name (eg. "/dev/sda1"). "UUID"
109 is the device UUID. "all" means try the key against any
110 encrypted device.
111
112 Use the specified "KEY_STRING" as passphrase.
113
114 --key NAME:file:FILENAME
115 --key UUID:file:FILENAME
116 --key all:file:FILENAME
117 Read the passphrase from FILENAME.
118
119 --key NAME:clevis
120 --key UUID:clevis
121 --key all:clevis
122 Attempt passphrase-less unlocking for the device with Clevis,
123 over the network. Please refer to "ENCRYPTED DISKS" in
124 guestfs(3) for more information on network-bound disk
125 encryption (NBDE).
126
127 Note that if any such option is present on the command line,
128 QEMU user networking will be automatically enabled for the
129 libguestfs appliance.
130
131 --keys-from-stdin
132 Read key or passphrase parameters from stdin. The default is to
133 try to read passphrases from the user by opening /dev/tty.
134
135 If there are multiple encrypted devices then you may need to supply
136 multiple keys on stdin, one per line.
137
138 -v
139 --verbose
140 Enable verbose messages for debugging.
141
142 -V
143 --version
144 Display version number and exit.
145
146 -x Enable tracing of libguestfs API calls.
147
149 This program returns 0 if successful, or non-zero if there was an
150 error.
151
153 guestfs(3), guestfish(1), virt-cat(1), virt-copy-out(1), virt-tail(1),
154 virt-tar-out(1), virt-win-reg(1), http://libguestfs.org/.
155
157 Richard W.M. Jones http://people.redhat.com/~rjones/
158
160 Copyright (C) 2010-2023 Red Hat Inc.
161
163 This program is free software; you can redistribute it and/or modify it
164 under the terms of the GNU General Public License as published by the
165 Free Software Foundation; either version 2 of the License, or (at your
166 option) any later version.
167
168 This program is distributed in the hope that it will be useful, but
169 WITHOUT ANY WARRANTY; without even the implied warranty of
170 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
171 General Public License for more details.
172
173 You should have received a copy of the GNU General Public License along
174 with this program; if not, write to the Free Software Foundation, Inc.,
175 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
176
178 To get a list of bugs against libguestfs, use this link:
179 https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools
180
181 To report a new bug against libguestfs, use this link:
182 https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools
183
184 When reporting a bug, please supply:
185
186 • The version of libguestfs.
187
188 • Where you got libguestfs (eg. which Linux distro, compiled from
189 source, etc)
190
191 • Describe the bug accurately and give a way to reproduce it.
192
193 • Run libguestfs-test-tool(1) and paste the complete, unedited output
194 into the bug report.
195
196
197
198guestfs-tools-1.51.6 2023-12-09 virt-log(1)