1virt-get-kernel(1) Virtualization Support virt-get-kernel(1)
2
3
4
6 virt-get-kernel - Extract kernel and ramdisk from guests
7
9 virt-get-kernel [--options] -d domname
10
11 virt-get-kernel [--options] -a disk.img
12
14 This program extracts the kernel and initramfs from a guest.
15
16 The format of the disk image is automatically detected unless you
17 specify it by using the --format option.
18
19 In the case where the guest contains multiple kernels, the one with the
20 highest version number is chosen. To extract arbitrary kernels from
21 the disk image, see guestfish(1). To extract the entire "/boot"
22 directory of a guest, see virt-copy-out(1).
23
25 --help
26 Display help.
27
28 -a file
29 --add file
30 Add file which should be a disk image from a virtual machine.
31
32 The format of the disk image is auto-detected. To override this
33 and force a particular format use the --format option.
34
35 -a URI
36 --add URI
37 Add a remote disk. The URI format is compatible with guestfish.
38 See "ADDING REMOTE STORAGE" in guestfish(1).
39
40 --blocksize 512
41 --blocksize 4096
42 This parameter sets the sector size of the disk image added with -a
43 option and is ignored for libvirt guest added with -d option. See
44 also "guestfs_add_drive_opts" in guestfs(3).
45
46 --colors
47 --colours
48 Use ANSI colour sequences to colourize messages. This is the
49 default when the output is a tty. If the output of the program is
50 redirected to a file, ANSI colour sequences are disabled unless you
51 use this option.
52
53 -c URI
54 --connect URI
55 If using libvirt, connect to the given URI. If omitted, then we
56 connect to the default libvirt hypervisor.
57
58 If you specify guest block devices directly (-a), then libvirt is
59 not used at all.
60
61 -d guest
62 --domain guest
63 Add all the disks from the named libvirt guest. Domain UUIDs can
64 be used instead of names.
65
66 --echo-keys
67 When prompting for keys and passphrases, virt-get-kernel normally
68 turns echoing off so you cannot see what you are typing. If you
69 are not worried about Tempest attacks and there is no one else in
70 the room you can specify this flag to see what you are typing.
71
72 --format raw|qcow2|..
73 --format auto
74 The default for the -a option is to auto-detect the format of the
75 disk image. Using this forces the disk format for the -a option on
76 the command line.
77
78 If you have untrusted raw-format guest disk images, you should use
79 this option to specify the disk format. This avoids a possible
80 security problem with malicious guests (CVE-2010-3851).
81
82 --key SELECTOR
83 Specify a key for LUKS, to automatically open a LUKS device when
84 using the inspection.
85
86 --key NAME:key:KEY_STRING
87 --key UUID:key:KEY_STRING
88 --key all:key:KEY_STRING
89 "NAME" is the libguestfs device name (eg. "/dev/sda1"). "UUID"
90 is the device UUID. "all" means try the key against any
91 encrypted device.
92
93 Use the specified "KEY_STRING" as passphrase.
94
95 --key NAME:file:FILENAME
96 --key UUID:file:FILENAME
97 --key all:file:FILENAME
98 Read the passphrase from FILENAME.
99
100 --key NAME:clevis
101 --key UUID:clevis
102 --key all:clevis
103 Attempt passphrase-less unlocking for the device with Clevis,
104 over the network. Please refer to "ENCRYPTED DISKS" in
105 guestfs(3) for more information on network-bound disk
106 encryption (NBDE).
107
108 Note that if any such option is present on the command line,
109 QEMU user networking will be automatically enabled for the
110 libguestfs appliance.
111
112 --keys-from-stdin
113 Read key or passphrase parameters from stdin. The default is to
114 try to read passphrases from the user by opening /dev/tty.
115
116 If there are multiple encrypted devices then you may need to supply
117 multiple keys on stdin, one per line.
118
119 --machine-readable
120 --machine-readable=format
121 This option is used to make the output more machine friendly when
122 being parsed by other programs. See "MACHINE READABLE OUTPUT"
123 below.
124
125 -o directory
126 --output directory
127 This option specifies the output directory where kernel and
128 initramfs from the guest are written.
129
130 If not specified, the default output is the current directory.
131
132 --prefix prefix
133 This option specifies a prefix for the extracted files.
134
135 If a prefix is specified, then there will be a dash ("-") after the
136 prefix and before the rest of the file name; for example, a kernel
137 in the guest like "vmlinuz-3.19.0-20-generic" is saved as
138 "mydistro-vmlinuz-3.19.0-20-generic" when the prefix is "mydistro".
139
140 See also --unversioned-names.
141
142 -q
143 --quiet
144 Don’t print ordinary progress messages.
145
146 --unversioned-names
147 This option affects the destination file name of extracted files.
148
149 If enabled, files will be saved locally just with the base name;
150 for example, kernel and ramdisk in the guest like
151 "vmlinuz-3.19.0-20-generic" and "initrd.img-3.19.0-20-generic" are
152 saved respectively as "vmlinuz" and "initrd.img".
153
154 See also --prefix.
155
156 -v
157 --verbose
158 Enable verbose messages for debugging.
159
160 -V
161 --version
162 Display version number and exit.
163
164 --wrap
165 Wrap error, warning, and informative messages. This is the default
166 when the output is a tty. If the output of the program is
167 redirected to a file, wrapping is disabled unless you use this
168 option.
169
170 -x Enable tracing of libguestfs API calls.
171
173 The --machine-readable option can be used to make the output more
174 machine friendly, which is useful when calling virt-get-kernel from
175 other programs, GUIs etc.
176
177 Use the option on its own to query the capabilities of the virt-get-
178 kernel binary. Typical output looks like this:
179
180 $ virt-get-kernel --machine-readable
181 virt-get-kernel
182
183 A list of features is printed, one per line, and the program exits with
184 status 0.
185
186 It is possible to specify a format string for controlling the output;
187 see "ADVANCED MACHINE READABLE OUTPUT" in guestfs(3).
188
190 For other environment variables which affect all libguestfs programs,
191 see "ENVIRONMENT VARIABLES" in guestfs(3).
192
194 This program returns 0 if successful, or non-zero if there was an
195 error.
196
198 guestfs(3), guestfish(1), guestmount(1), virt-copy-out(1),
199 virt-drivers(1), http://libguestfs.org/.
200
202 Richard W.M. Jones http://people.redhat.com/~rjones/
203
205 Copyright (C) 2013-2023 Red Hat Inc.
206
208 This program is free software; you can redistribute it and/or modify it
209 under the terms of the GNU General Public License as published by the
210 Free Software Foundation; either version 2 of the License, or (at your
211 option) any later version.
212
213 This program is distributed in the hope that it will be useful, but
214 WITHOUT ANY WARRANTY; without even the implied warranty of
215 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
216 General Public License for more details.
217
218 You should have received a copy of the GNU General Public License along
219 with this program; if not, write to the Free Software Foundation, Inc.,
220 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
221
223 To get a list of bugs against libguestfs, use this link:
224 https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools
225
226 To report a new bug against libguestfs, use this link:
227 https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools
228
229 When reporting a bug, please supply:
230
231 • The version of libguestfs.
232
233 • Where you got libguestfs (eg. which Linux distro, compiled from
234 source, etc)
235
236 • Describe the bug accurately and give a way to reproduce it.
237
238 • Run libguestfs-test-tool(1) and paste the complete, unedited output
239 into the bug report.
240
241
242
243guestfs-tools-1.51.6 2023-12-09 virt-get-kernel(1)