1virt-drivers(1) Virtualization Support virt-drivers(1)
2
3
4
6 virt-drivers - Detect bootloader, kernel and drivers inside guest
7
9 virt-drivers [--options] -d domname
10
11 virt-drivers [--options] -a disk.img
12
14 This tool can detect the bootloader, kernel and drivers inside some
15 guests from only the disk image. It can detect, for example, whether a
16 disk image needs BIOS or UEFI to boot, and whether it supports virtio
17 or requires slower emulated devices.
18
19 Notes
20 Normally you should distribute hypervisor metadata (eg. libvirt XML or
21 OVF) alongside disk images to tell the hypervisor how to boot them.
22 This tool is used when this metadata has not been provided. Work with
23 the supplier of the disk image to get them to provide proper metadata.
24
26 The output is an XML document. At the top level it lists the operating
27 systems found (the same as virt-inspector(1)):
28
29 <operatingsystems>
30 <operatingsystem>
31 <root>/dev/sda2</root>
32 <name>linux</name>
33 <arch>x86_64</arch>
34 <distro>fedora</distro>
35 ...
36 </operatingsystem>
37 <operatingsystem>
38 <root>/dev/sdb1</root>
39 ...
40 </operatingsystem>
41 </operatingsystems>
42
43 <firmware>
44 The <firmware> element lists the firmware which is required to boot the
45 guest. For UEFI it will additionally show the EFI system partition
46 ("ESP"). Guests may support multiple boot firmwares. For example this
47 guest is detected as using UEFI boot, and the UEFI ESP is the first
48 partition of the first disk:
49
50 <operatingsystems>
51 <firmware type='uefi'>/dev/sda1</firmware>
52 <operatingsystem>
53 ...
54
55 <bootloader> and <kernel>
56 The <bootloader> element shows the bootloader found in the Linux guest.
57 If known, this may contain information about what Linux kernels are
58 provided. For example:
59
60 <operatingsystems>
61 <firmware type='bios'/>
62 <operatingsystem>
63 <root>/dev/sda2</root>
64 <name>linux</name>
65 ...
66 <bootloader type='grub2' config='/boot/grub2/grub.cfg'>
67 <kernel>
68 <name>kernel</name>
69 <version>6.1.0-0.rc6.46.fc38.x86_64</version>
70 <vmlinuz>/boot/vmlinuz-6.1.0-0.rc6.46.fc38.x86_64</vmlinuz>
71 <modules>
72 ...
73 </modules>
74 <supports_virtio_blk/>
75 <supports_virtio_net/>
76 ...
77 </kernel>
78 </bootloader>
79
80 Many more fields are usually available for Linux guests, including a
81 complete list of kernel modules and information about support for
82 virtio. For a complete example see:
83 https://github.com/rwmjones/guestfs-tools/tree/master/drivers
84
85 <drivers>
86 The <drivers> element lists information about drivers found in Windows
87 guests:
88
89 <operatingsystems>
90 <firmware type='bios'/>
91 <operatingsystem>
92 <root>/dev/sda2</root>
93 <name>windows</name>
94 ...
95 <drivers>
96 <driver>
97 <name>scsidev</name>
98 <pci vendor='1077' device='1216' subsystem='8471101E'/>
99 <pci vendor='1077' device='1216' subsystem='8493101E'/>
100 </driver>
101 ...
102 </drivers>
103
104 The driver name (eg. "scsidev") corresponds to the Windows driver .INF
105 file (eg. scsidev.inf). The list of PCI, USB etc devices are the
106 matching devices which would cause this driver to load at boot.
107
109 --help
110 Display help.
111
112 -a file
113 --add file
114 Add file which should be a disk image from a virtual machine.
115
116 The format of the disk image is auto-detected. To override this
117 and force a particular format use the --format option.
118
119 -a URI
120 --add URI
121 Add a remote disk. The URI format is compatible with guestfish.
122 See "ADDING REMOTE STORAGE" in guestfish(1).
123
124 --blocksize 512
125 --blocksize 4096
126 This parameter sets the sector size of the disk image added with -a
127 option and is ignored for libvirt guest added with -d option. See
128 also "guestfs_add_drive_opts" in guestfs(3).
129
130 --colors
131 --colours
132 Use ANSI colour sequences to colourize messages. This is the
133 default when the output is a tty. If the output of the program is
134 redirected to a file, ANSI colour sequences are disabled unless you
135 use this option.
136
137 -c URI
138 --connect URI
139 If using libvirt, connect to the given URI. If omitted, then we
140 connect to the default libvirt hypervisor.
141
142 If you specify guest block devices directly (-a), then libvirt is
143 not used at all.
144
145 -d guest
146 --domain guest
147 Add all the disks from the named libvirt guest. Domain UUIDs can
148 be used instead of names.
149
150 --echo-keys
151 When prompting for keys and passphrases, virt-get-kernel normally
152 turns echoing off so you cannot see what you are typing. If you
153 are not worried about Tempest attacks and there is no one else in
154 the room you can specify this flag to see what you are typing.
155
156 --format raw|qcow2|..
157 --format auto
158 The default for the -a option is to auto-detect the format of the
159 disk image. Using this forces the disk format for the -a option on
160 the command line.
161
162 If you have untrusted raw-format guest disk images, you should use
163 this option to specify the disk format. This avoids a possible
164 security problem with malicious guests (CVE-2010-3851).
165
166 --key SELECTOR
167 Specify a key for LUKS, to automatically open a LUKS device when
168 using the inspection.
169
170 --key NAME:key:KEY_STRING
171 --key UUID:key:KEY_STRING
172 --key all:key:KEY_STRING
173 "NAME" is the libguestfs device name (eg. "/dev/sda1"). "UUID"
174 is the device UUID. "all" means try the key against any
175 encrypted device.
176
177 Use the specified "KEY_STRING" as passphrase.
178
179 --key NAME:file:FILENAME
180 --key UUID:file:FILENAME
181 --key all:file:FILENAME
182 Read the passphrase from FILENAME.
183
184 --key NAME:clevis
185 --key UUID:clevis
186 --key all:clevis
187 Attempt passphrase-less unlocking for the device with Clevis,
188 over the network. Please refer to "ENCRYPTED DISKS" in
189 guestfs(3) for more information on network-bound disk
190 encryption (NBDE).
191
192 Note that if any such option is present on the command line,
193 QEMU user networking will be automatically enabled for the
194 libguestfs appliance.
195
196 --keys-from-stdin
197 Read key or passphrase parameters from stdin. The default is to
198 try to read passphrases from the user by opening /dev/tty.
199
200 If there are multiple encrypted devices then you may need to supply
201 multiple keys on stdin, one per line.
202
203 -q
204 --quiet
205 Don’t print ordinary progress messages.
206
207 -v
208 --verbose
209 Enable verbose messages for debugging.
210
211 -V
212 --version
213 Display version number and exit.
214
215 --wrap
216 Wrap error, warning, and informative messages. This is the default
217 when the output is a tty. If the output of the program is
218 redirected to a file, wrapping is disabled unless you use this
219 option.
220
221 -x Enable tracing of libguestfs API calls.
222
224 For other environment variables which affect all libguestfs programs,
225 see "ENVIRONMENT VARIABLES" in guestfs(3).
226
228 This program returns 0 if successful, or non-zero if there was an
229 error.
230
232 guestfs(3), guestfish(1), guestmount(1), virt-get-kernel(1),
233 virt-inspector(1), virt-v2v(1), http://libguestfs.org/.
234
236 Richard W.M. Jones http://people.redhat.com/~rjones/
237
239 Copyright (C) 2009-2023 Red Hat Inc.
240
242 This program is free software; you can redistribute it and/or modify it
243 under the terms of the GNU General Public License as published by the
244 Free Software Foundation; either version 2 of the License, or (at your
245 option) any later version.
246
247 This program is distributed in the hope that it will be useful, but
248 WITHOUT ANY WARRANTY; without even the implied warranty of
249 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
250 General Public License for more details.
251
252 You should have received a copy of the GNU General Public License along
253 with this program; if not, write to the Free Software Foundation, Inc.,
254 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
255
257 To get a list of bugs against libguestfs, use this link:
258 https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools
259
260 To report a new bug against libguestfs, use this link:
261 https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools
262
263 When reporting a bug, please supply:
264
265 • The version of libguestfs.
266
267 • Where you got libguestfs (eg. which Linux distro, compiled from
268 source, etc)
269
270 • Describe the bug accurately and give a way to reproduce it.
271
272 • Run libguestfs-test-tool(1) and paste the complete, unedited output
273 into the bug report.
274
275
276
277guestfs-tools-1.51.6 2023-12-09 virt-drivers(1)