1virt-p2v-make-kickstart(1)  Virtualization Support  virt-p2v-make-kickstart(1)
2
3
4

NAME

6       virt-p2v-make-kickstart - Build the virt-p2v kickstart
7

SYNOPSIS

9        virt-p2v-make-kickstart [-o p2v.ks] [--proxy=http://...] repo [repo...]
10

DESCRIPTION

12       virt-p2v(1) converts a physical machine to run virtualized on KVM,
13       managed by libvirt, OpenStack, oVirt, Red Hat Enterprise Virtualisation
14       (RHEV), or one of the other targets supported by virt-v2v(1).
15
16       Kickstart is a format used by Red Hat-derived distributions (such as
17       Fedora, Red Hat Enterprise Linux, CentOS, Scientific Linux, and others)
18       to describe how to make live CDs, install the distro, make "Spins" and
19       so on.  It is driven by a kickstart file.
20
21       virt-p2v-make-kickstart builds a kickstart file which can be used to
22       build a bootable P2V ISO, live CD, USB key, or PXE image.  This tool
23       only builds the kickstart file, but this manual page describes some of
24       the ways you can use the kickstart file.
25
26       The root user on the disk image uses "p2v" as its initial password.
27

BUILDING THE KICKSTART FILE

29       Using virt-p2v-make-kickstart is very simple:
30
31        virt-p2v-make-kickstart fedora
32
33       will build a kickstart file for Fedora.  The kickstart file will be
34       called p2v.ks and located in the current directory.
35
36       The parameters are a list of one or more repositories.  Some built-in
37       repositories are available: "fedora", "rawhide", "koji" or
38       "rhel-VERSION" (eg. "rhel-7.1").  You can also use a URL as a parameter
39       to point to a repository, for example:
40
41        virt-p2v-make-kickstart https://dl.fedoraproject.org/pub/fedora/linux/releases/21/Everything/x86_64/os/
42
43       To control the name of the output file, use the -o parameter.  To tell
44       kickstart to use a proxy server or web cache to download files, use the
45       --proxy parameter.
46

BUILDING A LIVE CD / ISO

48       Once you have the kickstart file, you can use livecd-creator(8) to make
49       a live CD:
50
51        sudo livecd-creator p2v.ks
52
53       Before running this note that you should probably run "livecd-creator"
54       in a disposable virtual machine for these reasons:
55
56       •   You have to disable SELinux when running the tool.
57
58       •   This tool has to be run as root, and has some nasty failure modes.
59
60       •   You can only create the exact same Live CD distro as the host
61           distro.  Cross-builds will fail in strange ways (eg. RHBZ#1092327).
62

BUILDING A FEDORA SPIN USING KOJI

64       This requires "spin-livecd" permissions on Koji, which are not given
65       out usually, even to Fedora packagers.  However assuming you have been
66       given these permissions (or have your own Koji instance, I guess), then
67       you can do:
68
69        koji spin-livecd [--scratch] virt-p2v 1.XX.YY rawhide x86_64 p2v.ks
70
71       •   Add the "--scratch" option to do a scratch build (recommended for
72           testing).
73
74       •   "1.XX.YY" should match the libguestfs version
75
76       •   Instead of "rawhide" you can use any Koji target.
77

BUILDING A BOOTABLE USB KEY

79       Use the livecd-iso-to-disk(8) program to convert the ISO created above
80       to a USB key:
81
82        sudo livecd-iso-to-disk livecd-p2v.iso /dev/sdX
83

BUILDING A PXE BOOT IMAGE

85       Use the "livecd-iso-to-pxeboot" program to convert the ISO created
86       above to a PXE boot image.
87
88        sudo livecd-iso-to-pxeboot livecd-p2v.iso
89
90       This creates a "tftpboot" subdirectory under the current directory
91       containing the files required to PXE boot virt-p2v:
92
93        $ ls -1R tftpboot/
94        tftpboot/:
95        initrd0.img
96        pxelinux.0
97        pxelinux.cfg/
98        vmlinuz0
99
100        tftpboot/pxelinux.cfg:
101        default
102

32 OR 64 BIT VIRT-P2V?

104       Virt-p2v can convert any 32 or 64 bit guest, regardless of whether
105       virt-p2v itself is built as a 32 or 64 bit binary.  The only
106       restriction is that 64 bit virt-p2v cannot run on 32 bit hardware.
107
108       Old virt-p2v 0.9 was always built as a 32 bit (i686) ISO.  This meant
109       that the CD could be booted on any 32- or 64-bit i686 or x86-64
110       hardware, and could convert any guest.  The old virt-p2v ISO shipped by
111       Red Hat was based on Red Hat Enterprise Linux (RHEL) 6.
112
113       Since RHEL 7 dropped support for 32 bit machines, current virt-p2v on
114       RHEL can only be built for 64 bit.  It cannot run on old 32 bit only
115       hardware.
116
117       Fedora virt-p2v ISOs are generally built for 32 bit, so like the old
118       RHEL 6-based virt-p2v 0.9 they can boot on any hardware.
119

TESTING VIRT-P2V USING QEMU

121   TESTING THE P2V ISO USING QEMU
122       You can use qemu to test-boot the P2V ISO (BIOS mode):
123
124        qemu-kvm -m 1024 -hda /tmp/guest.img -cdrom /tmp/livecd-p2v.iso -boot d
125
126       Note that "-hda" is the (virtual) system that you want to convert (for
127       test purposes).  It could be any guest type supported by virt-v2v(1),
128       including Windows or Red Hat Enterprise Linux.
129
130       For UEFI:
131
132        qemu-kvm -m 1024 -M q35 \
133            -drive if=pflash,format=raw,file=/usr/share/OVMF/OVMF_CODE.fd,readonly=on \
134            -drive if=pflash,format=raw,file=/usr/share/OVMF/OVMF_VARS.fd,snapshot=on \
135            \
136            -drive if=none,format=raw,file=/tmp/guest.img,media=disk,id=guest-disk \
137            -device ide-hd,drive=guest-disk,bus=ide.0 \
138            \
139            -drive if=none,format=raw,file=/tmp/livecd-p2v.iso,media=cdrom,id=p2v-cdrom \
140            -device ide-cd,drive=p2v-cdrom,bus=ide.1,bootindex=1
141
142   TESTING PXE SUPPORT USING QEMU
143       •   Unpack the tftpboot directory into /tmp (so it appears as
144           /tmp/tftpboot).
145
146       •   Copy pxelinux.0 and ldlinux.c32 from syslinux (usually from
147           /usr/share/syslinux) into /tmp/tftpboot.
148
149       •   Adjust the "APPEND" line in /tmp/tftpboot/pxelinux.cfg/default if
150           required.  See "KERNEL COMMAND LINE CONFIGURATION" in virt-p2v(1).
151
152       •   Run qemu like this so that it acts as a TFTP and BOOTP server,
153           emulating a netboot:
154
155            qemu-kvm \
156                -m 4096 -hda /tmp/guest.img \
157                -boot n \
158                -netdev user,id=unet,tftp=/tmp/tftpboot,bootfile=/pxelinux.0 \
159                -device virtio-net-pci,netdev=unet \
160                -serial stdio
161
162           Note that this requires considerably more memory because the PXE
163           image is loaded into memory.  Also that qemu’s TFTP server is very
164           slow and the virt-p2v PXE image is very large, so it can appear to
165           "hang" after pxelinux starts up.
166

ADDING EXTRA PACKAGES

168       You can install extra packages using the --install option.  This can be
169       useful for making a more fully-featured virt-p2v disk with extra tools
170       for debugging and troubleshooting.  Give a list of packages, separated
171       by commas.  For example:
172
173        virt-p2v-make-kickstart [...] --install tcpdump,traceroute
174

ADDING AN SSH IDENTITY

176       You can inject an SSH identity (private key) file to the kickstart and
177       hence into the ISO using the --inject-ssh-identity option.  Note that
178       you cannot inject a key once the ISO has been built.
179
180       First create a key pair.  It must have an empty passphrase:
181
182        ssh-keygen -t rsa -N '' -f id_rsa
183
184       This creates a private key ("id_rsa") and a public key ("id_rsa.pub")
185       pair.  The public key should be appended to the "authorized_keys" file
186       on the virt-v2v conversion server (usually to
187       "/root/.ssh/authorized_keys").
188
189       The private key should be added to the kickstart file and then
190       discarded:
191
192        virt-p2v-make-kickstart [...] --inject-ssh-identity id_rsa
193        rm id_rsa
194
195       The ISO can then be built from the kickstart in the usual way (see
196       above), and it will contain the embedded SSH identity
197       (/var/tmp/id_rsa).
198
199       When booting virt-p2v, specify the URL of the injected file like this:
200
201        │         User name: [root_____________________________] │
202        │                                                        │
203        │          Password: [    <leave this field blank>     ] │
204        │                                                        │
205        │  SSH Identity URL: [file:///var/tmp/id_rsa___________] │
206
207       or if using the kernel command line, add:
208
209        p2v.identity=file:///var/tmp/id_rsa
210
211       For more information, see "SSH IDENTITIES" in virt-p2v(1).
212

OPTIONS

214       --help
215           Display help.
216
217       --inject-ssh-identity id_rsa
218           Add an SSH identity (private key) file into the kickstart.  See
219           "ADDING AN SSH IDENTITY" above.
220
221       --install pkg,pkg,...
222           Add extra packages to the kickstart %packages section.  See "ADDING
223           EXTRA PACKAGES" above.
224
225       -o OUTPUT
226       --output OUTPUT
227           Write kickstart to "OUTPUT".  If not specified, the default is
228           p2v.ks in the current directory.
229
230       --proxy URL
231           Tell the kickstart to use a proxy server or web cache for
232           downloads.
233
234       -v
235       --verbose
236           Enable verbose output.  Use this if you need to debug problems with
237           the script or if you are filing a bug.
238
239       -V
240       --version
241           Display version number and exit.
242

FILES

244       $libdir/virt-p2v/virt-p2v.xz
245           The virt-p2v(1) binary which is copied into the kickstart file.
246
247           The location of the binary can be changed by setting the
248           "VIRT_P2V_DATA_DIR" environment variable.
249
250       $datadir/virt-p2v/issue
251       $datadir/virt-p2v/launch-virt-p2v.in
252       $datadir/virt-p2v/p2v.ks.in
253       $datadir/virt-p2v/p2v.service
254           Various data files that are used to make the kickstart.
255
256           The location of these files can be changed by setting the
257           "VIRT_P2V_DATA_DIR" environment variable.
258

ENVIRONMENT VARIABLES

260       "VIRT_P2V_DATA_DIR"
261           The directory where virt-p2v-make-kickstart looks for data files
262           and the virt-p2v binary (see "FILES" above).  If not set, a
263           compiled-in location is used.
264

SEE ALSO

266       virt-p2v(1), virt-p2v-make-disk(1), virt-v2v(1), livecd-creator(8),
267       livecd-iso-to-disk(8), http://libguestfs.org/.
268

AUTHORS

270       Richard W.M. Jones http://people.redhat.com/~rjones/
271
273       Copyright (C) 2009-2019 Red Hat Inc.
274

LICENSE

276       This program is free software; you can redistribute it and/or modify it
277       under the terms of the GNU General Public License as published by the
278       Free Software Foundation; either version 2 of the License, or (at your
279       option) any later version.
280
281       This program is distributed in the hope that it will be useful, but
282       WITHOUT ANY WARRANTY; without even the implied warranty of
283       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
284       General Public License for more details.
285
286       You should have received a copy of the GNU General Public License along
287       with this program.  If not, see <https://www.gnu.org/licenses/>.
288

BUGS

290       To get a list of bugs against libguestfs (which include virt-p2v), use
291       this link:
292       https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools
293
294       To report a new bug against libguestfs, use this link:
295       https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools
296
297       When reporting a bug, please supply:
298
299       •   The version of virt-p2v.
300
301       •   Where you got virt-p2v (eg. which Linux distro, compiled from
302           source, etc)
303
304       •   Describe the bug accurately and give a way to reproduce it.
305
306
307
308virt-p2v-1.42.3                   2023-01-21        virt-p2v-make-kickstart(1)
Impressum