1LIVEMEDIA-CREATOR(1) Lorax LIVEMEDIA-CREATOR(1)
2
3
4
6 livemedia-creator - Live Media Creator Documentation
7
8 Authors
9 Brian C. Lane <bcl@redhat.com>
10
11 livemedia-creator uses Anaconda, kickstart and Lorax to create bootable
12 media that use the same install path as a normal system installation.
13 It can be used to make live isos, bootable (partitioned) disk images,
14 tarfiles, and filesystem images for use with virtualization and con‐
15 tainer solutions like libvirt, docker, and OpenStack.
16
17 The general idea is to use qemu with kickstart and an Anaconda boot.iso
18 to install into a disk image and then use the disk image to create the
19 bootable media.
20
21 livemedia-creator --help will describe all of the options available. At
22 the minimum you need:
23
24 --make-iso to create a final bootable .iso or one of the other --make-*
25 options.
26
27 --iso to specify the Anaconda install media to use with qemu.
28
29 --ks to select the kickstart file describing what to install.
30
31 To use livemedia-creator with virtualization you will need to have qemu
32 installed.
33
34 If you are going to be using Anaconda directly, with --no-virt mode,
35 make sure you have the anaconda-tui package installed.
36
37 Conventions used in this document:
38
39 lmc is an abbreviation for livemedia-creator.
40
41 builder is the system where livemedia-creator is being run
42
43 image is the disk image being created by running livemedia-creator
44
46 Create Live Install Media
47
48
49 usage: livemedia-creator [-h]
50 (--make-iso | --make-disk | --make-fsimage | --make-appliance | --make-ami | --make-tar | --make-pxe-live | --make-ostree-live | --make-oci | --make-vagrant)
51 [--iso ISO] [--iso-only] [--iso-name ISO_NAME]
52 [--ks KS] [--image-only] [--no-virt] [--proxy PROXY]
53 [--anaconda-arg ANACONDA_ARGS]
54 [--armplatform ARMPLATFORM] [--location LOCATION]
55 [--logfile LOGFILE]
56 [--lorax-templates LORAX_TEMPLATES] [--tmp TMP]
57 [--resultdir RESULT_DIR] [--macboot] [--nomacboot]
58 [--disk-image DISK_IMAGE] [--keep-image]
59 [--fs-image FS_IMAGE] [--image-name IMAGE_NAME]
60 [--fs-label FS_LABEL] [--image-type IMAGE_TYPE]
61 [--qemu-arg QEMU_ARGS] [--qcow2]
62 [--qcow2-arg QEMU_ARGS] [--compression COMPRESSION]
63 [--compress-arg COMPRESS_ARGS] [--app-name APP_NAME]
64 [--app-template APP_TEMPLATE] [--app-file APP_FILE]
65 [--ram MEMORY] [--vcpus VCPUS] [--vnc VNC]
66 [--arch ARCH] [--kernel-args KERNEL_ARGS]
67 [--ovmf-path OVMF_PATH] [--virt-uefi] [--no-kvm]
68 [--with-rng WITH_RNG] [--dracut-arg DRACUT_ARGS]
69 [--live-rootfs-size LIVE_ROOTFS_SIZE]
70 [--live-rootfs-keep-size] [--oci-config OCI_CONFIG]
71 [--oci-runtime OCI_RUNTIME]
72 [--vagrant-metadata VAGRANT_METADATA]
73 [--vagrantfile VAGRANTFILE] [--title TITLE]
74 [--project PROJECT] [--releasever RELEASEVER]
75 [--volid VOLID] [--squashfs_args SQUASHFS_ARGS]
76 [--timeout TIMEOUT] [-V]
77
78 Named Arguments
79 -make-iso
80 Build a live iso
81
82 Default: False
83
84 -make-disk
85 Build a partitioned disk image
86
87 Default: False
88
89 -make-fsimage
90 Build a filesystem image
91
92 Default: False
93
94 -make-appliance
95 Build an appliance image and XML description
96
97 Default: False
98
99 -make-ami
100 Build an ami image
101
102 Default: False
103
104 -make-tar
105 Build a tar of the root filesystem
106
107 Default: False
108
109 -make-pxe-live
110 Build a live pxe boot squashfs image
111
112 Default: False
113
114 -make-ostree-live
115 Build a live pxe boot squashfs image of Atomic Host
116
117 Default: False
118
119 -make-oci
120 Build an Open Container Initiative image
121
122 Default: False
123
124 -make-vagrant
125 Build a Vagrant Box image
126
127 Default: False
128
129 -iso Anaconda installation .iso path to use for qemu
130
131 -iso-only
132 Remove all iso creation artifacts except the boot.iso, combine
133 with --iso-name to rename the boot.iso
134
135 Default: False
136
137 -iso-name
138 Name of output iso file for --iso-only. Default is boot.iso
139
140 -ks Kickstart file defining the install.
141
142 -image-only
143 Exit after creating fs/disk image.
144
145 Default: False
146
147 -no-virt
148 Run anaconda directly on host instead of using qemu
149
150 Default: False
151
152 -proxy proxy URL to use for the install
153
154 -anaconda-arg
155 Additional argument to pass to anaconda (no-virt mode). Pass
156 once for each argument
157
158 -armplatform
159 the platform to use when creating images for ARM, i.e., high‐
160 bank, mvebu, omap, tegra, etc.
161
162 -location
163 location of iso directory tree with initrd.img and vmlinuz. Used
164 to run qemu with a newer initrd than the iso.
165
166 -logfile
167 Name and path for primary logfile, other logs will be created in
168 the same directory.
169
170 Default: ./livemedia.log
171
172 -lorax-templates
173 Path to mako templates for lorax
174
175 -tmp Top level temporary directory
176
177 Default: /var/tmp
178
179 -resultdir
180 Directory to copy the resulting images and iso into. Defaults to
181 the temporary working directory
182
183 -macboot
184 Default: True
185
186 -nomacboot
187 Default: True
188
189 -title Substituted for @TITLE@ in bootloader config files
190
191 Default: "Linux Live Media"
192
193 -project
194 substituted for @PROJECT@ in bootloader config files
195
196 Default: "Linux"
197
198 -releasever
199 substituted for @VERSION@ in bootloader config files
200
201 Default: "29"
202
203 -volid volume id
204
205 -squashfs_args
206 additional squashfs args
207
208 -timeout
209 Cancel installer after X minutes
210
211 V show program's version number and exit
212
213 disk/fs image arguments
214 -disk-image
215 Path to existing disk image to use for creating final image.
216
217 -keep-image
218 Keep raw disk image after .iso creation
219
220 Default: False
221
222 -fs-image
223 Path to existing filesystem image to use for creating final
224 image.
225
226 -image-name
227 Name of output file to create. Used for tar, fs and disk image.
228 Default is a random name.
229
230 -fs-label
231 Label to set on fsimage, default is 'Anaconda'
232
233 Default: "Anaconda"
234
235 -image-type
236 Create an image with qemu-img. See qemu-img --help for supported
237 formats.
238
239 -qemu-arg
240 Arguments to pass to qemu-img. Pass once for each argument, they
241 will be used for ALL calls to qemu-img.
242
243 Default: []
244
245 -qcow2 Create qcow2 image instead of raw sparse image when making disk
246 images.
247
248 Default: False
249
250 -qcow2-arg
251 Arguments to pass to qemu-img. Pass once for each argument, they
252 will be used for ALL calls to qemu-img.
253
254 Default: []
255
256 -compression
257 Compression binary for make-tar. xz, lzma, gzip, and bzip2 are
258 supported. xz is the default.
259
260 Default: "xz"
261
262 -compress-arg
263 Arguments to pass to compression. Pass once for each argument
264
265 Default: []
266
267 appliance arguments
268 -app-name
269 Name of appliance to pass to template
270
271 -app-template
272 Path to template to use for appliance data.
273
274 -app-file
275 Appliance template results file.
276
277 Default: "appliance.xml"
278
279 qemu arguments
280 -ram Memory to allocate for installer in megabytes.
281
282 Default: 2048
283
284 -vcpus Passed to qemu -smp command
285
286 -vnc Passed to qemu -display command. eg. vnc=127.0.0.1:5, default is
287 to choose the first unused vnc port.
288
289 -arch System arch to build for. Used to select qemu-system-* command.
290 Defaults to qemu-system-<arch>
291
292 -kernel-args
293 Additional argument to pass to the installation kernel
294
295 -ovmf-path
296 Path to OVMF firmware
297
298 Default: "/usr/share/edk2/ovmf/"
299
300 -virt-uefi
301 Use OVMF firmware to boot the VM in UEFI mode
302
303 Default: False
304
305 -no-kvm
306 Skip using kvm with qemu even if it is available.
307
308 Default: False
309
310 -with-rng
311 RNG device for QEMU (none for no RNG)
312
313 Default: "/dev/random"
314
315 dracut arguments
316 -dracut-arg
317 Argument to pass to dracut when rebuilding the initramfs. Pass
318 this once for each argument. NOTE: this overrides the default.
319 (default: )
320
321 pxe to live arguments
322 -live-rootfs-size
323 Size of root filesystem of live image in GiB
324
325 Default: 0
326
327 -live-rootfs-keep-size
328 Keep the original size of root filesystem in live image
329
330 Default: False
331
332 OCI arguments
333 -oci-config
334 config.json OCI configuration file
335
336 -oci-runtime
337 runtime.json OCI configuration file
338
339 Vagrant arguments
340 -vagrant-metadata
341 optional metadata.json file
342
343 -vagrantfile
344 optional vagrantfile
345
347 Run this to create a bootable live iso:
348
349 sudo livemedia-creator --make-iso \
350 --iso=/extra/iso/boot.iso --ks=./docs/fedora-livemedia.ks
351
352 You can run it directly from the lorax git repo like this:
353
354 sudo PATH=./src/sbin/:$PATH PYTHONPATH=./src/ ./src/sbin/livemedia-creator \
355 --make-iso --iso=/extra/iso/boot.iso \
356 --ks=./docs/fedora-livemedia.ks --lorax-templates=./share/
357
358 You can observe the installation using vnc. The logs will show what
359 port was chosen, or you can use a specific port by passing it. eg.
360 --vnc vnc:127.0.0.1:5
361
362 This is usually a good idea when testing changes to the kickstart. lmc
363 tries to monitor the logs for fatal errors, but may not catch every‐
364 thing.
365
367 There are 2 stages, the install stage which produces a disk or filesys‐
368 tem image as its output, and the boot media creation which uses the
369 image as its input. Normally you would run both stages, but it is pos‐
370 sible to stop after the install stage, by using --image-only, or to
371 skip the install stage and use a previously created disk image by pass‐
372 ing --disk-image or --fs-image
373
374 When creating an iso qemu boots using the passed Anaconda installer iso
375 and installs the system based on the kickstart. The %post section of
376 the kickstart is used to customize the installed system in the same way
377 that current spin-kickstarts do.
378
379 livemedia-creator monitors the install process for problems by watching
380 the install logs. They are written to the current directory or to the
381 base directory specified by the --logfile command. You can also monitor
382 the install by using a vnc client. This is recommended when first modi‐
383 fying a kickstart, since there are still places where Anaconda may get
384 stuck without the log monitor catching it.
385
386 The output from this process is a partitioned disk image. kpartx can be
387 used to mount and examine it when there is a problem with the install.
388 It can also be booted using kvm.
389
390 When creating an iso the disk image's / partition is copied into a for‐
391 matted filesystem image which is then used as the input to lorax for
392 creation of the final media.
393
394 The final image is created by lorax, using the templates in
395 /usr/share/lorax/live/ or the live directory below the directory speci‐
396 fied by --lorax-templates. The templates are written using the Mako
397 template system with some extra commands added by lorax.
398
399 NOTE:
400 The output from --make-iso includes the artifacts used to create the
401 boot.iso; the kernel, initrd, the squashfs filesystem, etc. If you
402 only want the boot.iso you can pass --iso-only and the other files
403 will be removed. You can also name the iso by using --iso-name
404 my-live.iso.
405
407 The docs/ directory includes several example kickstarts, one to create
408 a live desktop iso using GNOME, and another to create a minimal disk
409 image. When creating your own kickstarts you should start with the min‐
410 imal example, it includes several needed packages that are not always
411 included by dependencies.
412
413 Or you can use existing spin kickstarts to create live media with a few
414 changes. Here are the steps I used to convert the Fedora XFCE spin.
415
416 1. Flatten the xfce kickstart using ksflatten
417
418 2. Add zerombr so you don't get the disk init dialog
419
420 3. Add clearpart --all
421
422 4. Add swap partition
423
424 5. bootloader target
425
426 6. Add shutdown to the kickstart
427
428 7. Add network --bootproto=dhcp --activate to activate the network
429 This works for F16 builds but for F15 and before you need to pass
430 something on the cmdline that activate the network, like sshd:
431 livemedia-creator --kernel-args="sshd"
432
433 8. Add a root password:
434
435 rootpw rootme
436 network --bootproto=dhcp --activate
437 zerombr
438 clearpart --all
439 bootloader --location=mbr
440 part swap --size=512
441 shutdown
442
443 9. In the livesys script section of the %post remove the root pass‐
444 word. This really depends on how the spin wants to work. You could
445 add the live user that you create to the %wheel group so that sudo
446 works if you wanted to.
447 passwd -d root > /dev/null
448
449 10. Remove /etc/fstab in %post, dracut handles mounting the rootfs
450
451 cat /dev/null > /dev/fstab
452
453 Do this only for live iso's, the filesystem will be mounted read
454 only if there is no /etc/fstab
455
456 11. Don't delete initramfs files from /boot in %post
457
458 12. When creating live iso's you need to have, at least, these packages
459 in the %package section:: dracut-config-generic dracut-live -dra‐
460 cut-config-rescue grub2-efi memtest86+ syslinux
461
462 User created repositories
463 If you are using your own repositories and installing groups (eg.
464 @core) make sure you create the repodata with groups like this cre‐
465 aterepo -g /path/to/groups.xml /path/to/rpms
466
467 Using a Proxy with repos
468 One drawback to using qemu is that it pulls the packages from the repo
469 each time you run it. To speed things up you either need a local mirror
470 of the packages, or you can use a caching proxy. When using a proxy you
471 pass it to livemedia-creator like this:
472 --proxy=http://proxy.yourdomain.com:3128
473
474 You also need to use a specific mirror instead of mirrormanager so that
475 the packages will get cached, so your kickstart url would look like:
476 url --url="http://dl.fedoraproject.org/pub/fedora/linux/develop‐
477 ment/rawhide/x86_64/os/"
478
479 You can also add an update repo, but don't name it updates. Add --proxy
480 to it as well. You can use all of the kickstart commands in your kick‐
481 start. Make sure there is only one url command, other repos have to use
482 the repo command and cannot be named updates which is reserved for Ana‐
483 conda's use. eg.:
484
485 url --url=PRIMARY-REPO-URL --proxy=PROXY-URL
486 repo --name="repo1" --baseurl=FIRST-REPO-URL --proxy=PROXY-URL
487 repo --name="repo2" --baseurl=SECOND-REPO_URL --proxy=PROXY-URL
488
490 You can create images without using qemu by passing --no-virt on the
491 cmdline. This will use Anaconda's directory install feature to handle
492 the install. There are a couple of things to keep in mind when doing
493 this:
494
495 1. It will be most reliable when building images for the same release
496 that the host is running. Because Anaconda has expectations about
497 the system it is running under you may encounter strange bugs if you
498 try to build newer or older releases.
499
500 2. It may totally trash your host. So far I haven't had this happen,
501 but the possibility exists that a bug in Anaconda could result in it
502 operating on real devices. I recommend running it in a virt or on a
503 system that you can afford to lose all data from.
504
505 The logs from anaconda will be placed in an ./anaconda/ directory in
506 either the current directory or in the directory used for --logfile
507
508 Example cmdline:
509
510 sudo livemedia-creator --make-iso --no-virt --ks=./fedora-livemedia.ks
511
512 NOTE:
513 Using no-virt to create a partitioned disk image (eg. --make-disk or
514 --make-vagrant) will only create disks usable on the host platform
515 (BIOS or UEFI). You can create BIOS partitioned disk images on UEFI
516 by using virt.
517
518 NOTE:
519 As of version 30.7 SELinux can be set to Enforcing. The current
520 state is logged for debugging purposes and if there are SELinux
521 denials they should be reported as a bug.
522
524 Amazon EC2 images can be created by using the --make-ami switch and an
525 appropriate kickstart file. All of the work to customize the image is
526 handled by the kickstart. The example currently included was modified
527 from the cloud-kickstarts version so that it would work with liveme‐
528 dia-creator.
529
530 Example cmdline:
531
532 sudo livemedia-creator --make-ami --iso=/path/to/boot.iso
533 --ks=./docs/fedora-livemedia-ec2.ks
534
535 This will produce an ami-root.img file in the working directory.
536
537 At this time I have not tested the image with EC2. Feedback would be
538 welcome.
539
541 livemedia-creator can now replace appliance-tools by using the
542 --make-appliance switch. This will create the partitioned disk image
543 and an XML file that can be used with virt-image to setup a virtual
544 system.
545
546 The XML is generated using the Mako template from
547 /usr/share/lorax/appliance/libvirt.xml You can use a different template
548 by passing --app-template <template path>
549
550 Documentation on the Mako template system can be found at the Mako site
551
552 The name of the final output XML is appliance.xml, this can be changed
553 with --app-file <file path>
554
555 The following variables are passed to the template:
556
557 disks A list of disk_info about each disk. Each entry has the fol‐
558 lowing attributes:
559 name base name of the disk image file
560
561 format "raw"
562
563 checksum_type "sha256"
564
565 checksum sha256 checksum of the disk image
566
567 name Name of appliance, from --app-name argument
568
569 arch Architecture
570
571 memory Memory in KB (from --ram)
572
573 vcpus from --vcpus
574
575 networks list of networks from the kickstart or []
576
577 title from --title
578
579 project from --project
580
581 releasever from --releasever
582
583 The created image can be imported into libvirt using:
584 virt-image appliance.xml
585
586 You can also create qcow2 appliance images using --image-type=qcow2,
587 for example:
588
589 sudo livemedia-creator --make-appliance --iso=/path/to/boot.iso --ks=./docs/fedora-minimal.ks \
590 --image-type=qcow2 --app-file=minimal-test.xml --image-name=minimal-test.img
591
593 livemedia-creator can be used to create un-partitined filesystem images
594 using the --make-fsimage option. As of version 21.8 this works with
595 both qemu and no-virt modes of operation. Previously it was only avail‐
596 able with no-virt.
597
598 Kickstarts should have a single / partition with no extra mountpoints.
599 livemedia-creator --make-fsimage --iso=/path/to/boot.iso
600 --ks=./docs/fedora-minimal.ks
601
602 You can name the output image with --image-name and set a label on the
603 filesystem with --fs-label
604
606 The --make-tar command can be used to create a tar of the root filesys‐
607 tem. By default it is compressed using xz, but this can be changed
608 using the --compression and --compress-arg options. This option works
609 with both virt and no-virt install methods.
610
611 As with --make-fsimage the kickstart should be limited to a single /
612 partition.
613
614 For example:
615
616 livemedia-creator --make-tar --iso=/path/to/boot.iso --ks=./docs/fedora-minimal.ks \
617 --image-name=fedora-root.tar.xz
618
620 The --make-pxe-live command will produce squashfs image containing live
621 root filesystem that can be used for pxe boot. Directory with results
622 will contain the live image, kernel image, initrd image and template of
623 pxe configuration for the images.
624
626 The --make-ostree-live command will produce the same result as
627 --make-pxe-live for installations of Atomic Host. Example kickstart
628 for such an installation using Atomic installer iso with local repo
629 included in the image can be found in docs/rhel-atomic-pxe-live.ks.
630
631 The PXE images can also be created with --no-virt by using the example
632 kickstart in docs/fedora-atomic-pxe-live-novirt.ks. This also works
633 inside the mock environment.
634
636 As of lorax version 22.2 you can use livemedia-creator and anaconda
637 version 22.15 inside of a mock chroot with --make-iso and --make-fsim‐
638 age.
639
640 NOTE:
641 As of mock 1.3.4 you need to use --old-chroot with mock. Mock now
642 defaults to using systemd-nspawn which cannot create the needed loop
643 device nodes. Passing --old-chroot will use the old system where
644 /dev/loop* is setup for you.
645
646 On the host system:
647
648 1. yum install -y mock
649
650 2. Add a user to the mock group to use for running mock. eg. builder
651
652 3. Create a new /etc/mock/ config file based on the rawhide one, or
653 modify the existing one so that the following options are setup:
654
655 config_opts['chroot_setup_cmd'] = 'install @buildsys-build anaconda-tui lorax'
656
657 # build results go into /home/builder/results/
658 config_opts['plugin_conf']['bind_mount_opts']['dirs'].append(('/home/builder/results','/results/'))
659
660 If you are creating images for a branched release of Fedora you
661 should also enable the updates-testing repository so that you get
662 the latest builds in your mock chroot.
663
664 The following steps are run as the builder user who is a member of the
665 mock group.
666
667 4. Make a directory for results matching the bind mount above mkdir
668 ~/results/
669
670 5. Copy the example kickstarts cp /usr/share/docs/lorax/*ks .
671
672 6. Make sure tar and dracut-network are in the %packages section and
673 that the url points to the correct repo
674
675 7. Init the mock mock -r fedora-rawhide-x86_64 --old-chroot --init
676
677 8. Copy the kickstart inside the mock mock -r fedora-rawhide-x86_64
678 --old-chroot --copyin ./fedora-minimal.ks /root/
679
680 9. Make a minimal iso:
681
682 mock -r fedora-rawhide-x86_64 --old-chroot --chroot -- livemedia-creator --no-virt \
683 --resultdir=/results/try-1 --logfile=/results/logs/try-1/try-1.log \
684 --make-iso --ks /root/fedora-minimal.ks
685
686 Results will be in ./results/try-1 and logs under /results/logs/try-1/
687 including anaconda logs and livemedia-creator logs. The new iso will be
688 located at ~/results/try-1/images/boot.iso, and the ~/results/try-1/
689 directory tree will also contain the vmlinuz, initrd, etc.
690
692 Version 25.0 of livemedia-creator switches to using qemu for virtual‐
693 ization. This allows creation of all image types, and use of the KVM
694 on the host if /dev/kvm is present in the mock environment.
695
696 On the host system:
697
698 1. yum install -y mock
699
700 2. Add a user to the mock group to use for running mock. eg. builder
701
702 3. Create a new /etc/mock/ config file based on the rawhide one, or
703 modify the existing one so that the following options are setup:
704
705 config_opts['chroot_setup_cmd'] = 'install @buildsys-build lorax qemu'
706
707 # build results go into /home/builder/results/
708 config_opts['plugin_conf']['bind_mount_opts']['dirs'].append(('/home/builder/results','/results/'))
709
710 If you are creating images for a branched release of Fedora you
711 should also enable the updates-testing repository so that you get
712 the latest builds in your mock chroot.
713
714 The following steps are run as the builder user who is a member of the
715 mock group.
716
717 4. Make a directory for results matching the bind mount above mkdir
718 ~/results/
719
720 5. Copy the example kickstarts cp /usr/share/docs/lorax/*ks .
721
722 6. Make sure tar and dracut-network are in the %packages section and
723 that the url points to the correct repo
724
725 7. Init the mock mock -r fedora-rawhide-x86_64 --old-chroot --init
726
727 8. Copy the kickstart inside the mock mock -r fedora-rawhide-x86_64
728 --old-chroot --copyin ./fedora-minimal.ks /root/
729
730 9. Copy the Anaconda boot.iso inside the mock mock -r
731 fedora-rawhide-x86_64 --old-chroot --copyin ./boot.iso /root/
732
733 10.
734 Make a minimal iso:
735
736 mock -r fedora-rawhide-x86_64 --old-chroot --chroot -- livemedia-creator \
737 --resultdir=/results/try-1 --logfile=/results/logs/try-1/try-1.log \
738 --make-iso --ks /root/fedora-minimal.ks --iso /root/boot.iso
739
740 Results will be in ./results/try-1 and logs under /results/logs/try-1/
741 including anaconda logs and livemedia-creator logs. The new iso will be
742 located at ~/results/try-1/images/boot.iso, and the ~/results/try-1/
743 directory tree will also contain the vmlinuz, initrd, etc.
744
745 This will run qemu without kvm support, which is going to be very slow.
746 You can add mknod /dev/kvm c 10 232; to create the device node before
747 running lmc.
748
750 OpenStack supports partitioned disk images so --make-disk can be used
751 to create images for importing into glance, OpenStack's image storage
752 component. You need to have access to an OpenStack provider that
753 allows image uploads, or setup your own using the instructions from the
754 RDO Project.
755
756 The example kickstart, fedora-openstack.ks, is only slightly different
757 than the fedora-minimal.ks one. It adds the cloud-init and
758 cloud-utils-growpart packages. OpenStack supports setting up the image
759 using cloud-init, and cloud-utils-growpart will grow the image to fit
760 the instance's disk size.
761
762 Create a qcow2 image using the kickstart like this:
763 sudo livemedia-creator --make-disk --iso=/path/to/boot.iso
764 --ks=/path/to/fedora-openstack.ks --image-type=qcow2
765
766 NOTE:
767 On the RHEL7 version of lmc --image-type isn't supported. You can
768 only create a bare partitioned disk image.
769
770 Import the resulting disk image into the OpenStack system, either via
771 the web UI, or glance on the cmdline:
772
773 glance image-create --name "fedora-openstack" --is-public true --disk-format qcow2 \
774 --container-format bare --file ./fedora-openstack.qcow2
775
776 If qcow2 wasn't used then --disk-format should be set to raw.
777
779 Use lmc to create a tarfile as described in the TAR File Creation sec‐
780 tion, but substitute the fedora-docker.ks example kickstart which
781 removes the requirement for core files and the kernel.
782
783 You can then import the tarfile into docker like this (as root):
784 cat /var/tmp/fedora-root.tar.xz | docker import - fedora-root
785
786 And then run bash inside of it:
787 sudo docker run -i -t fedora-root /bin/bash
788
790 The OCI is a new specification that is still being worked on. You can
791 read more about it at the Open Container Initiative website. You can
792 create OCI images using the following command:
793
794 sudo livemedia-creator --make-oci --oci-config /path/to/config.json --oci-runtime /path/to/runtime.json \
795 --iso=/path/to/boot.iso --ks=/path/to/fedora-minimal.ks
796
797 You must provide the config.json and runtime.json files to be included
798 in the bundle, their specifications can be found on the OCI github
799 project output will be in the results directory with a default name of
800 bundle.tar.xz
801
802 This will work with --no-virt and inside a mock since it doesn't use
803 any partitioned disk images.
804
806 Vagrant images can be created using the following command:
807
808 sudo livemedia-creator --make-vagrant --vagrant-metadata /path/to/metadata.json \
809 --iso=/path/to/boot.iso --ks=/path/to/fedora-vagrant.ks
810
811 The image created is a vagrant-libvirt provider image and needs to have
812 vagrant setup with libvirt before you can use it.
813
814 The --vagrant-metadata file is optional, it will create a minimal one
815 by default, and if one is passed it will make sure the disk size is
816 setup correctly. If you pass a --vagrant-vagrantfile it will be
817 included in the image verbatim. By default no vagrantfile is created.
818
819 There is an example Vagrant kickstart file in the docs directory that
820 sets up the vagrant user with the default insecure SSH pubkey and a few
821 useful utilities.
822
823 This also works with --no-virt, but will not work inside a mock due to
824 its use of partitioned disk images and qcow2.
825
827 Partitioned disk images can only be created for the same platform as
828 the host system (BIOS or UEFI). You can use virt to create BIOS images
829 on UEFI systems, and it is also possible to create UEFI images on BIOS
830 systems using OVMF. You first need to setup your system with the OVMF
831 firmware. The details can be found here linux-kvm OVMF page but it
832 amounts to:
833
834 1. Download the firmware.repo from Gerd Hoffmann and install it in
835 /etc/yum.repos.d/
836
837 2. Install the edk2.git-ovmf-x64 package
838
839 3. Copy /usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd to
840 /usr/share/OVMF/OVMF_CODE.fd
841
842 4. Copy /usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd to
843 /usr/share/OVMF/OVMF_VARS.fd
844
845 Now you can run livemedia-creator with --virt-uefi to boot and install
846 using UEFI:
847
848 sudo livemedia-creator --make-disk --virt-uefi --iso=/path/to/boot.iso \
849 --ks=/path/to/fedora-minimal.ks
850
851 Make sure that the kickstart you are using creates a /boot/efi parti‐
852 tion by including this:
853
854 part /boot/efi --fstype="efi" --size=500
855
856 NOTE:
857 When using the resulting image with the current version of OVMF
858 (edk2.git-ovmf-x64-0-20151103.b1295.ge5cffca) it will not boot auto‐
859 matically because there is a problem with the fallback path. You
860 can boot it by entering the UEFI shell and running
861 EFI/fedora/shim.efi and then using efibootmgr to setup the correct
862 boot entry.
863
865 Sometimes an installation will get stuck. When using qemu the logs will
866 be written to ./virt-install.log and most of the time any problems that
867 happen will be near the end of the file. lmc tries to detect common
868 errors and will cancel the installation when they happen. But not
869 everything can be caught. When creating a new kickstart it is helpful
870 to use vnc so that you can monitor the installation as it happens, and
871 if it gets stuck without lmc detecting the problem you can switch to
872 tty1 and examine the system directly.
873
874 If you suspect problems with %pre or %post sections you can redirect
875 the output to the terminal and examine it by logging into the VM. eg.:
876
877 %pre
878 chvt
879 exec < /dev/tty3 > /dev/tty3 2>/dev/tty3
880 #do stuff
881 echo hello world
882 %end
883
884 If it does get stuck the best way to cancel is to use kill -9 on the
885 qemu pid, lmc will detect that the process died and cleanup.
886
887 If lmc didn't handle the cleanup for some reason you can do this: 1.
888 sudo umount /tmp/lmc-XXXX to unmount the iso from its mountpoint. 2.
889 sudo rm -rf /tmp/lmc-XXXX 3. sudo rm /var/tmp/lmc-disk-XXXXX to remove
890 the disk image.
891
892 Note that lmc uses the lmc- prefix for all of its temporary files and
893 directories to make it easier to find and clean up leftovers.
894
895 The logs from the qemu run are stored in virt-install.log, logs from
896 livemedia-creator are in livemedia.log and program.log
897
898 You can add --image-only to skip the .iso creation and examine the
899 resulting disk image. Or you can pass --keep-image to keep it around
900 after the iso has been created.
901
902 Cleaning up aborted --no-virt installs can sometimes be accomplished by
903 running the anaconda-cleanup script. As of Fedora 18 anaconda is
904 multi-threaded and it can sometimes become stuck and refuse to exit.
905 When this happens you can usually clean up by first killing the ana‐
906 conda process then running anaconda-cleanup.
907
909 Development on this will take place as part of the lorax project, and
910 on the anaconda-devel-list mailing list, and on github
911
912 Feedback, enhancements and bugs are welcome. You can use bugzilla to
913 report bugs against the lorax component.
914
916 Weldr Team
917
919 2018, Red Hat, Inc.
920
921
922
923
92429.21 Nov 29, 2018 LIVEMEDIA-CREATOR(1)