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
32 qemu-kvm 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: "8"
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: 1024
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/rhel-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/rhel-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 grub-efi memtest86+ syslinux
461
462 One drawback to using qemu is that it pulls the packages from the repo
463 each time you run it. To speed things up you either need a local mirror
464 of the packages, or you can use a caching proxy. When using a proxy you
465 pass it to livemedia-creator like this:
466 --proxy=http://proxy.yourdomain.com:3128
467
468 You also need to use a specific mirror instead of mirrormanager so that
469 the packages will get cached, so your kickstart url would look like:
470 url --url="http://dl.fedoraproject.org/pub/fedora/linux/develop‐
471 ment/rawhide/x86_64/os/"
472
473 You can also add an update repo, but don't name it updates. Add --proxy
474 to it as well.
475
477 You can create images without using qemu by passing --no-virt on the
478 cmdline. This will use Anaconda's directory install feature to handle
479 the install. There are a couple of things to keep in mind when doing
480 this:
481
482 1. It will be most reliable when building images for the same release
483 that the host is running. Because Anaconda has expectations about
484 the system it is running under you may encounter strange bugs if you
485 try to build newer or older releases.
486
487 2. It may totally trash your host. So far I haven't had this happen,
488 but the possibility exists that a bug in Anaconda could result in it
489 operating on real devices. I recommend running it in a virt or on a
490 system that you can afford to lose all data from.
491
492 The logs from anaconda will be placed in an ./anaconda/ directory in
493 either the current directory or in the directory used for --logfile
494
495 Example cmdline:
496
497 sudo livemedia-creator --make-iso --no-virt --ks=./rhel-livemedia.ks
498
499 NOTE:
500 Using no-virt to create a partitioned disk image (eg. --make-disk or
501 --make-vagrant) will only create disks usable on the host platform
502 (BIOS or UEFI). You can create BIOS partitioned disk images on UEFI
503 by using virt.
504
505 NOTE:
506 As of version 30.7 SELinux can be set to Enforcing. The current
507 state is logged for debugging purposes and if there are SELinux
508 denials they should be reported as a bug.
509
511 Amazon EC2 images can be created by using the --make-ami switch and an
512 appropriate kickstart file. All of the work to customize the image is
513 handled by the kickstart. The example currently included was modified
514 from the cloud-kickstarts version so that it would work with liveme‐
515 dia-creator.
516
517 Example cmdline:
518
519 sudo livemedia-creator --make-ami --iso=/path/to/boot.iso
520 --ks=./docs/rhel-livemedia-ec2.ks
521
522 This will produce an ami-root.img file in the working directory.
523
524 At this time I have not tested the image with EC2. Feedback would be
525 welcome.
526
528 livemedia-creator can now replace appliance-tools by using the
529 --make-appliance switch. This will create the partitioned disk image
530 and an XML file that can be used with virt-image to setup a virtual
531 system.
532
533 The XML is generated using the Mako template from
534 /usr/share/lorax/appliance/libvirt.xml You can use a different template
535 by passing --app-template <template path>
536
537 Documentation on the Mako template system can be found at the Mako site
538
539 The name of the final output XML is appliance.xml, this can be changed
540 with --app-file <file path>
541
542 The following variables are passed to the template:
543
544 disks A list of disk_info about each disk. Each entry has the fol‐
545 lowing attributes:
546 name base name of the disk image file
547
548 format "raw"
549
550 checksum_type "sha256"
551
552 checksum sha256 checksum of the disk image
553
554 name Name of appliance, from --app-name argument
555
556 arch Architecture
557
558 memory Memory in KB (from --ram)
559
560 vcpus from --vcpus
561
562 networks list of networks from the kickstart or []
563
564 title from --title
565
566 project from --project
567
568 releasever from --releasever
569
570 The created image can be imported into libvirt using:
571 virt-image appliance.xml
572
573 You can also create qcow2 appliance images using --image-type=qcow2,
574 for example:
575
576 sudo livemedia-creator --make-appliance --iso=/path/to/boot.iso --ks=./docs/rhel-minimal.ks \
577 --image-type=qcow2 --app-file=minimal-test.xml --image-name=minimal-test.img
578
580 livemedia-creator can be used to create un-partitined filesystem images
581 using the --make-fsimage option. As of version 21.8 this works with
582 both qemu and no-virt modes of operation. Previously it was only avail‐
583 able with no-virt.
584
585 Kickstarts should have a single / partition with no extra mountpoints.
586 livemedia-creator --make-fsimage --iso=/path/to/boot.iso
587 --ks=./docs/rhel-minimal.ks
588
589 You can name the output image with --image-name and set a label on the
590 filesystem with --fs-label
591
593 The --make-tar command can be used to create a tar of the root filesys‐
594 tem. By default it is compressed using xz, but this can be changed
595 using the --compression and --compress-arg options. This option works
596 with both virt and no-virt install methods.
597
598 As with --make-fsimage the kickstart should be limited to a single /
599 partition.
600
601 For example:
602
603 livemedia-creator --make-tar --iso=/path/to/boot.iso --ks=./docs/rhel-minimal.ks \
604 --image-name=rhel-root.tar.xz
605
607 The --make-pxe-live command will produce squashfs image containing live
608 root filesystem that can be used for pxe boot. Directory with results
609 will contain the live image, kernel image, initrd image and template of
610 pxe configuration for the images.
611
613 The --make-ostree-live command will produce the same result as
614 --make-pxe-live for installations of Atomic Host. Example kickstart
615 for such an installation using Atomic installer iso with local repo
616 included in the image can be found in docs/rhel-atomic-pxe-live.ks.
617
618 The PXE images can also be created with --no-virt by using the example
619 kickstart in docs/rhel-atomic-pxe-live-novirt.ks. This also works
620 inside the mock environment.
621
623 As of lorax version 22.2 you can use livemedia-creator and anaconda
624 version 22.15 inside of a mock chroot with --make-iso and --make-fsim‐
625 age.
626
627 NOTE:
628 As of mock 1.3.4 you need to use --old-chroot with mock. Mock now
629 defaults to using systemd-nspawn which cannot create the needed loop
630 device nodes. Passing --old-chroot will use the old system where
631 /dev/loop* is setup for you.
632
633 On the host system:
634
635 1. yum install -y mock
636
637 2. Add a user to the mock group to use for running mock. eg. builder
638
639 3. Create a new /etc/mock/ config file based on the rawhide one, or
640 modify the existing one so that the following options are setup:
641
642 config_opts['chroot_setup_cmd'] = 'install @buildsys-build anaconda-tui lorax'
643
644 # build results go into /home/builder/results/
645 config_opts['plugin_conf']['bind_mount_opts']['dirs'].append(('/home/builder/results','/results/'))
646
647 If you are creating images for a branched release of Fedora you
648 should also enable the updates-testing repository so that you get
649 the latest builds in your mock chroot.
650
651 The following steps are run as the builder user who is a member of the
652 mock group.
653
654 4. Make a directory for results matching the bind mount above mkdir
655 ~/results/
656
657 5. Copy the example kickstarts cp /usr/share/docs/lorax/*ks .
658
659 6. Make sure tar and dracut-network are in the %packages section and
660 that the url points to the correct repo
661
662 7. Init the mock mock -r rhel-8-x86_64 --old-chroot --init
663
664 8. Copy the kickstart inside the mock mock -r rhel-8-x86_64
665 --old-chroot --copyin ./rhel-minimal.ks /root/
666
667 9. Make a minimal iso:
668
669 mock -r rhel-8-x86_64 --old-chroot --chroot -- livemedia-creator --no-virt \
670 --resultdir=/results/try-1 --logfile=/results/logs/try-1/try-1.log \
671 --make-iso --ks /root/rhel-minimal.ks
672
673 Results will be in ./results/try-1 and logs under /results/logs/try-1/
674 including anaconda logs and livemedia-creator logs. The new iso will be
675 located at ~/results/try-1/images/boot.iso, and the ~/results/try-1/
676 directory tree will also contain the vmlinuz, initrd, etc.
677
679 Version 25.0 of livemedia-creator switches to using qemu for virtual‐
680 ization. This allows creation of all image types, and use of the KVM
681 on the host if /dev/kvm is present in the mock environment.
682
683 On the host system:
684
685 1. yum install -y mock
686
687 2. Add a user to the mock group to use for running mock. eg. builder
688
689 3. Create a new /etc/mock/ config file based on the rawhide one, or
690 modify the existing one so that the following options are setup:
691
692 config_opts['chroot_setup_cmd'] = 'install @buildsys-build lorax qemu'
693
694 # build results go into /home/builder/results/
695 config_opts['plugin_conf']['bind_mount_opts']['dirs'].append(('/home/builder/results','/results/'))
696
697 If you are creating images for a branched release of Fedora you
698 should also enable the updates-testing repository so that you get
699 the latest builds in your mock chroot.
700
701 The following steps are run as the builder user who is a member of the
702 mock group.
703
704 4. Make a directory for results matching the bind mount above mkdir
705 ~/results/
706
707 5. Copy the example kickstarts cp /usr/share/docs/lorax/*ks .
708
709 6. Make sure tar and dracut-network are in the %packages section and
710 that the url points to the correct repo
711
712 7. Init the mock mock -r rhel-8-x86_64 --old-chroot --init
713
714 8. Copy the kickstart inside the mock mock -r rhel-8-x86_64
715 --old-chroot --copyin ./rhel-minimal.ks /root/
716
717 9. Copy the Anaconda boot.iso inside the mock mock -r rhel-8-x86_64
718 --old-chroot --copyin ./boot.iso /root/
719
720 10.
721 Make a minimal iso:
722
723 mock -r rhel-8-x86_64 --old-chroot --chroot -- livemedia-creator \
724 --resultdir=/results/try-1 --logfile=/results/logs/try-1/try-1.log \
725 --make-iso --ks /root/rhel-minimal.ks --iso /root/boot.iso
726
727 Results will be in ./results/try-1 and logs under /results/logs/try-1/
728 including anaconda logs and livemedia-creator logs. The new iso will be
729 located at ~/results/try-1/images/boot.iso, and the ~/results/try-1/
730 directory tree will also contain the vmlinuz, initrd, etc.
731
732 This will run qemu without kvm support, which is going to be very slow.
733 You can add mknod /dev/kvm c 10 232; to create the device node before
734 running lmc.
735
737 OpenStack supports partitioned disk images so --make-disk can be used
738 to create images for importing into glance, OpenStack's image storage
739 component. You need to have access to an OpenStack provider that
740 allows image uploads, or setup your own using the instructions from the
741 RDO Project.
742
743 The example kickstart, rhel-openstack.ks, is only slightly different
744 than the rhel-minimal.ks one. It adds the cloud-init and
745 cloud-utils-growpart packages. OpenStack supports setting up the image
746 using cloud-init, and cloud-utils-growpart will grow the image to fit
747 the instance's disk size.
748
749 Create a qcow2 image using the kickstart like this:
750 sudo livemedia-creator --make-disk --iso=/path/to/boot.iso
751 --ks=/path/to/rhel-openstack.ks --image-type=qcow2
752
753 NOTE:
754 On the RHEL7 version of lmc --image-type isn't supported. You can
755 only create a bare partitioned disk image.
756
757 Import the resulting disk image into the OpenStack system, either via
758 the web UI, or glance on the cmdline:
759
760 glance image-create --name "rhel-openstack" --is-public true --disk-format qcow2 \
761 --container-format bare --file ./rhel-openstack.qcow2
762
763 If qcow2 wasn't used then --disk-format should be set to raw.
764
766 Use lmc to create a tarfile as described in the TAR File Creation sec‐
767 tion, but substitute the rhel-container.ks example kickstart which
768 removes the requirement for core files and the kernel.
769
770 You can then import the tarfile into podman or docker like this:
771 podman import /var/tmp/root.tar.xz rhel-root
772
773 And then run bash inside of it:
774 podman run -i -t rhel-root /bin/bash
775
777 The OCI is a new specification that is still being worked on. You can
778 read more about it at the Open Container Initiative website. You can
779 create OCI images using the following command:
780
781 sudo livemedia-creator --make-oci --oci-config /path/to/config.json --oci-runtime /path/to/runtime.json \
782 --iso=/path/to/boot.iso --ks=/path/to/rhel-minimal.ks
783
784 You must provide the config.json and runtime.json files to be included
785 in the bundle, their specifications can be found on the OCI github
786 project output will be in the results directory with a default name of
787 bundle.tar.xz
788
789 This will work with --no-virt and inside a mock since it doesn't use
790 any partitioned disk images.
791
793 Vagrant images can be created using the following command:
794
795 sudo livemedia-creator --make-vagrant --vagrant-metadata /path/to/metadata.json \
796 --iso=/path/to/boot.iso --ks=/path/to/rhel-vagrant.ks
797
798 The image created is a vagrant-libvirt provider image and needs to have
799 vagrant setup with libvirt before you can use it.
800
801 The --vagrant-metadata file is optional, it will create a minimal one
802 by default, and if one is passed it will make sure the disk size is
803 setup correctly. If you pass a --vagrant-vagrantfile it will be
804 included in the image verbatim. By default no vagrantfile is created.
805
806 There is an example Vagrant kickstart file in the docs directory that
807 sets up the vagrant user with the default insecure SSH pubkey and a few
808 useful utilities.
809
810 This also works with --no-virt, but will not work inside a mock due to
811 its use of partitioned disk images and qcow2.
812
814 Partitioned disk images can only be created for the same platform as
815 the host system (BIOS or UEFI). You can use virt to create BIOS images
816 on UEFI systems, and it is also possible to create UEFI images on BIOS
817 systems using OVMF. You first need to setup your system with the OVMF
818 firmware. The details can be found here linux-kvm OVMF page but it
819 amounts to:
820
821 1. Download the firmware.repo from Gerd Hoffmann and install it in
822 /etc/yum.repos.d/
823
824 2. Install the edk2.git-ovmf-x64 package
825
826 3. Copy /usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd to
827 /usr/share/OVMF/OVMF_CODE.fd
828
829 4. Copy /usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd to
830 /usr/share/OVMF/OVMF_VARS.fd
831
832 Now you can run livemedia-creator with --virt-uefi to boot and install
833 using UEFI:
834
835 sudo livemedia-creator --make-disk --virt-uefi --iso=/path/to/boot.iso \
836 --ks=/path/to/rhel-minimal.ks
837
838 Make sure that the kickstart you are using creates a /boot/efi parti‐
839 tion by including this:
840
841 part /boot/efi --fstype="efi" --size=500
842
843 NOTE:
844 When using the resulting image with the current version of OVMF
845 (edk2.git-ovmf-x64-0-20151103.b1295.ge5cffca) it will not boot auto‐
846 matically because there is a problem with the fallback path. You
847 can boot it by entering the UEFI shell and running EFI/red‐
848 hat/shim.efi and then using efibootmgr to setup the correct boot
849 entry.
850
852 Sometimes an installation will get stuck. When using qemu the logs will
853 be written to ./virt-install.log and most of the time any problems that
854 happen will be near the end of the file. lmc tries to detect common
855 errors and will cancel the installation when they happen. But not
856 everything can be caught. When creating a new kickstart it is helpful
857 to use vnc so that you can monitor the installation as it happens, and
858 if it gets stuck without lmc detecting the problem you can switch to
859 tty1 and examine the system directly.
860
861 If it does get stuck the best way to cancel is to use kill -9 on the
862 qemu pid, lmc will detect that the process died and cleanup.
863
864 If lmc didn't handle the cleanup for some reason you can do this: 1.
865 sudo umount /tmp/lmc-XXXX to unmount the iso from its mountpoint. 2.
866 sudo rm -rf /tmp/lmc-XXXX 3. sudo rm /var/tmp/lmc-disk-XXXXX to remove
867 the disk image.
868
869 Note that lmc uses the lmc- prefix for all of its temporary files and
870 directories to make it easier to find and clean up leftovers.
871
872 The logs from the qemu run are stored in virt-install.log, logs from
873 livemedia-creator are in livemedia.log and program.log
874
875 You can add --image-only to skip the .iso creation and examine the
876 resulting disk image. Or you can pass --keep-image to keep it around
877 after the iso has been created.
878
879 Cleaning up aborted --no-virt installs can sometimes be accomplished by
880 running the anaconda-cleanup script. As of Fedora 18 anaconda is
881 multi-threaded and it can sometimes become stuck and refuse to exit.
882 When this happens you can usually clean up by first killing the ana‐
883 conda process then running anaconda-cleanup.
884
886 Development on this will take place as part of the lorax project, and
887 on the anaconda-devel-list mailing list, and on github
888
889 Feedback, enhancements and bugs are welcome. You can use bugzilla to
890 report bugs against the lorax component.
891
893 Weldr Team
894
896 2018, Red Hat, Inc.
897
898
899
900
90128.14.21 Jan 09, 2019 LIVEMEDIA-CREATOR(1)