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