1LIVEMEDIA-CREATOR(1)                 Lorax                LIVEMEDIA-CREATOR(1)
2
3
4

NAME

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

LIVEMEDIA-CREATOR CMDLINE ARGUMENTS

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_args SQUASHFS_ARGS]
79                                   [--timeout TIMEOUT] [-V]
80
81   Named Arguments
82       -make-iso
83              Build a live iso
84
85              Default: False
86
87       -make-disk
88              Build a partitioned disk image
89
90              Default: False
91
92       -make-fsimage
93              Build a filesystem image
94
95              Default: False
96
97       -make-appliance
98              Build an appliance image and XML description
99
100              Default: False
101
102       -make-ami
103              Build an ami image
104
105              Default: False
106
107       -make-tar
108              Build a tar of the root filesystem
109
110              Default: False
111
112       -make-tar-disk
113              Build a tar of a partitioned disk image
114
115              Default: False
116
117       -make-pxe-live
118              Build a live pxe boot squashfs image
119
120              Default: False
121
122       -make-ostree-live
123              Build a live pxe boot squashfs image of Atomic Host
124
125              Default: False
126
127       -make-oci
128              Build an Open Container Initiative image
129
130              Default: False
131
132       -make-vagrant
133              Build a Vagrant Box image
134
135              Default: False
136
137       -iso   Anaconda installation .iso path to use for qemu
138
139       -iso-only
140              Remove  all  iso creation artifacts except the boot.iso, combine
141              with --iso-name to rename the boot.iso
142
143              Default: False
144
145       -iso-name
146              Name of output iso file for --iso-only. Default is boot.iso
147
148       -ks    Kickstart file defining the install.
149
150       -image-only
151              Exit after creating fs/disk image.
152
153              Default: False
154
155       -no-virt
156              Run anaconda directly on host instead of using qemu
157
158              Default: False
159
160       -proxy proxy URL to use for the install
161
162       -anaconda-arg
163              Additional argument to pass to  anaconda  (no-virt  mode).  Pass
164              once for each argument
165
166       -armplatform
167              the  platform  to  use when creating images for ARM, i.e., high‐
168              bank, mvebu, omap, tegra, etc.
169
170       -location
171              location of iso directory tree with initrd.img and vmlinuz. Used
172              to run qemu with a newer initrd than the iso.
173
174       -logfile
175              Name and path for primary logfile, other logs will be created in
176              the same directory.
177
178              Default: ./livemedia.log
179
180       -lorax-templates
181              Path to mako templates for lorax
182
183       -tmp   Top level temporary directory
184
185              Default: /var/tmp
186
187       -resultdir
188              Directory to copy the resulting images and iso into. Defaults to
189              the temporary working directory
190
191       -macboot
192              Default: True
193
194       -nomacboot
195              Default: True
196
197       -extra-boot-args
198              Extra  arguments  to add to the bootloader kernel cmdline in the
199              templates
200
201              Default: ""
202
203       -title Substituted for @TITLE@ in bootloader config files
204
205              Default: "Linux Live Media"
206
207       -project
208              substituted for @PROJECT@ in bootloader config files
209
210              Default: "Linux"
211
212       -releasever
213              substituted for @VERSION@ in bootloader config files
214
215              Default: "29"
216
217       -volid volume id
218
219       -squashfs_args
220              additional squashfs args
221
222       -timeout
223              Cancel installer after X minutes
224
225       V      show program's version number and exit
226
227   disk/fs image arguments
228       -disk-image
229              Path to existing disk image to use for creating final image.
230
231       -keep-image
232              Keep raw disk image after .iso creation
233
234              Default: False
235
236       -fs-image
237              Path to existing filesystem image  to  use  for  creating  final
238              image.
239
240       -image-name
241              Name  of output file to create. Used for tar, fs and disk image.
242              Default is a random name.
243
244       -tar-disk-name
245              Name of the archive member for make-tar-disk.
246
247       -fs-label
248              Label to set on fsimage, default is 'Anaconda'
249
250              Default: "Anaconda"
251
252       -image-size-align
253              Create a disk image with a size that is a multiple of this value
254              in MiB.
255
256              Default: 0
257
258       -image-type
259              Create an image with qemu-img. See qemu-img --help for supported
260              formats.
261
262       -qemu-arg
263              Arguments to pass to qemu-img. Pass once for each argument, they
264              will be used for ALL calls to qemu-img.
265
266              Default: []
267
268       -qcow2 Create  qcow2 image instead of raw sparse image when making disk
269              images.
270
271              Default: False
272
273       -qcow2-arg
274              Arguments to pass to qemu-img. Pass once for each argument, they
275              will be used for ALL calls to qemu-img.
276
277              Default: []
278
279       -compression
280              Compression  binary  for make-tar. xz, lzma, gzip, and bzip2 are
281              supported. xz is the default.
282
283              Default: "xz"
284
285       -compress-arg
286              Arguments to pass to compression. Pass once for each argument
287
288              Default: []
289
290   appliance arguments
291       -app-name
292              Name of appliance to pass to template
293
294       -app-template
295              Path to template to use for appliance data.
296
297       -app-file
298              Appliance template results file.
299
300              Default: "appliance.xml"
301
302   qemu arguments
303       -ram   Memory to allocate for installer in megabytes.
304
305              Default: 2048
306
307       -vcpus Passed to qemu -smp command
308
309       -vnc   Passed to qemu -display command. eg. vnc=127.0.0.1:5, default is
310              to choose the first unused vnc port.
311
312       -arch  System  arch to build for. Used to select qemu-system-* command.
313              Defaults to qemu-system-<arch>
314
315       -kernel-args
316              Additional argument to pass to the installation kernel
317
318       -ovmf-path
319              Path to OVMF firmware
320
321              Default: "/usr/share/edk2/ovmf/"
322
323       -virt-uefi
324              Use OVMF firmware to boot the VM in UEFI mode
325
326              Default: False
327
328       -no-kvm
329              Skip using kvm with qemu even if it is available.
330
331              Default: False
332
333       -with-rng
334              RNG device for QEMU (none for no RNG)
335
336              Default: "/dev/random"
337
338   dracut arguments
339       -dracut-arg
340              Argument to pass to dracut when rebuilding the  initramfs.  Pass
341              this  once  for each argument. NOTE: this overrides the default.
342              (default: )
343
344   pxe to live arguments
345       -live-rootfs-size
346              Size of root filesystem of live image in GiB
347
348              Default: 0
349
350       -live-rootfs-keep-size
351              Keep the original size of root filesystem in live image
352
353              Default: False
354
355   OCI arguments
356       -oci-config
357              config.json OCI configuration file
358
359       -oci-runtime
360              runtime.json OCI configuration file
361
362   Vagrant arguments
363       -vagrant-metadata
364              optional metadata.json file
365
366       -vagrantfile
367              optional vagrantfile
368

QUICKSTART

370       Run this to create a bootable live iso:
371
372          sudo livemedia-creator --make-iso \
373          --iso=/extra/iso/boot.iso --ks=./docs/fedora-livemedia.ks
374
375       You can run it directly from the lorax git repo like this:
376
377          sudo PATH=./src/sbin/:$PATH PYTHONPATH=./src/ ./src/sbin/livemedia-creator \
378          --make-iso --iso=/extra/iso/boot.iso \
379          --ks=./docs/fedora-livemedia.ks --lorax-templates=./share/
380
381       You can observe the installation using vnc. The  logs  will  show  what
382       port  was  chosen,  or  you  can use a specific port by passing it. eg.
383       --vnc vnc:127.0.0.1:5
384
385       This is usually a good idea when testing changes to the kickstart.  lmc
386       tries  to  monitor  the logs for fatal errors, but may not catch every‐
387       thing.
388

HOW ISO CREATION WORKS

390       There are 2 stages, the install stage which produces a disk or filesys‐
391       tem  image  as  its  output, and the boot media creation which uses the
392       image as its input.  Normally you would run both stages, but it is pos‐
393       sible  to  stop  after  the install stage, by using --image-only, or to
394       skip the install stage and use a previously created disk image by pass‐
395       ing --disk-image or --fs-image
396
397       When creating an iso qemu boots using the passed Anaconda installer iso
398       and installs the system based on the kickstart. The  %post  section  of
399       the kickstart is used to customize the installed system in the same way
400       that current spin-kickstarts do.
401
402       livemedia-creator monitors the install process for problems by watching
403       the  install  logs. They are written to the current directory or to the
404       base directory specified by the --logfile command. You can also monitor
405       the install by using a vnc client. This is recommended when first modi‐
406       fying a kickstart, since there are still places where Anaconda may  get
407       stuck without the log monitor catching it.
408
409       The output from this process is a partitioned disk image. kpartx can be
410       used to mount and examine it when there is a problem with the  install.
411       It can also be booted using kvm.
412
413       When creating an iso the disk image's / partition is copied into a for‐
414       matted filesystem image which is then used as the input  to  lorax  for
415       creation of the final media.
416
417       The   final   image  is  created  by  lorax,  using  the  templates  in
418       /usr/share/lorax/live/ or the live directory below the directory speci‐
419       fied  by  --lorax-templates.  The  templates are written using the Mako
420       template system with some extra commands added by lorax.
421
422       NOTE:
423          The output from --make-iso includes the artifacts used to create the
424          boot.iso;  the  kernel, initrd, the squashfs filesystem, etc. If you
425          only want the boot.iso you can pass --iso-only and the  other  files
426          will  be  removed.  You  can  also  name the iso by using --iso-name
427          my-live.iso.
428

KICKSTARTS

430       The docs/ directory includes several example kickstarts, one to  create
431       a  live  desktop  iso using GNOME, and another to create a minimal disk
432       image. When creating your own kickstarts you should start with the min‐
433       imal  example,  it includes several needed packages that are not always
434       included by dependencies.
435
436       Or you can use existing spin kickstarts to create live media with a few
437       changes. Here are the steps I used to convert the Fedora XFCE spin.
438
439       1.  Flatten the xfce kickstart using ksflatten
440
441       2.  Add zerombr so you don't get the disk init dialog
442
443       3.  Add clearpart --all
444
445       4.  Add swap partition
446
447       5.  bootloader target
448
449       6.  Add shutdown to the kickstart
450
451       7.  Add  network  --bootproto=dhcp  --activate  to activate the network
452           This works for F16 builds but for F15 and before you need  to  pass
453           something on the cmdline that activate the network, like sshd:
454              livemedia-creator --kernel-args="sshd"
455
456       8.  Add a root password:
457
458              rootpw rootme
459              network --bootproto=dhcp --activate
460              zerombr
461              clearpart --all
462              bootloader --location=mbr
463              part swap --size=512
464              shutdown
465
466       9.  In  the  livesys  script section of the %post remove the root pass‐
467           word. This really depends on how the spin wants to work. You  could
468           add  the live user that you create to the %wheel group so that sudo
469           works if you wanted to.
470              passwd -d root > /dev/null
471
472       10. Remove /etc/fstab in %post, dracut handles mounting the rootfs
473
474           cat /dev/null > /dev/fstab
475
476           Do this only for live iso's, the filesystem will  be  mounted  read
477           only if there is no /etc/fstab
478
479       11. Don't delete initramfs files from /boot in %post
480
481       12. When creating live iso's you need to have, at least, these packages
482           in the %package section:: dracut-config-generic  dracut-live  -dra‐
483           cut-config-rescue grub2-efi memtest86+ syslinux
484
485   User created repositories
486       If  you  are  using  your  own  repositories and installing groups (eg.
487       @core) make sure you create the repodata with  groups  like  this  cre‐
488       aterepo -g /path/to/groups.xml /path/to/rpms
489
490   Using a Proxy with repos
491       One  drawback to using qemu is that it pulls the packages from the repo
492       each time you run it. To speed things up you either need a local mirror
493       of the packages, or you can use a caching proxy. When using a proxy you
494       pass it to livemedia-creator like this:
495          --proxy=http://proxy.yourdomain.com:3128
496
497       You also need to use a specific mirror instead of mirrormanager so that
498       the packages will get cached, so your kickstart url would look like:
499          url     --url="http://dl.fedoraproject.org/pub/fedora/linux/develop
500          ment/rawhide/x86_64/os/"
501
502       You can also add an update repo, but don't name it updates. Add --proxy
503       to  it as well. You can use all of the kickstart commands in your kick‐
504       start. Make sure there is only one url command, other repos have to use
505       the repo command and cannot be named updates which is reserved for Ana‐
506       conda's use. eg.:
507
508          url --url=PRIMARY-REPO-URL --proxy=PROXY-URL
509          repo --name="repo1" --baseurl=FIRST-REPO-URL --proxy=PROXY-URL
510          repo --name="repo2" --baseurl=SECOND-REPO_URL --proxy=PROXY-URL
511

ANACONDA IMAGE INSTALL (NO-VIRT)

513       You can create images without using qemu by passing  --no-virt  on  the
514       cmdline.  This  will use Anaconda's directory install feature to handle
515       the install.  There are a couple of things to keep in mind  when  doing
516       this:
517
518       1. It  will  be most reliable when building images for the same release
519          that the host is running. Because Anaconda  has  expectations  about
520          the system it is running under you may encounter strange bugs if you
521          try to build newer or older releases.
522
523       2. It may totally trash your host. So far I haven't  had  this  happen,
524          but the possibility exists that a bug in Anaconda could result in it
525          operating on real devices. I recommend running it in a virt or on  a
526          system that you can afford to lose all data from.
527
528       The  logs  from  anaconda will be placed in an ./anaconda/ directory in
529       either the current directory or in the directory used for --logfile
530
531       Example cmdline:
532
533       sudo livemedia-creator --make-iso --no-virt --ks=./fedora-livemedia.ks
534
535       NOTE:
536          Using no-virt to create a partitioned disk image (eg. --make-disk or
537          --make-vagrant)  will  only create disks usable on the host platform
538          (BIOS or UEFI). You can create BIOS partitioned disk images on  UEFI
539          by using virt.
540
541       NOTE:
542          As  of  version  30.7  SELinux  can be set to Enforcing. The current
543          state is logged for debugging purposes  and  if  there  are  SELinux
544          denials they should be reported as a bug.
545

AMI IMAGES

547       Amazon  EC2 images can be created by using the --make-ami switch and an
548       appropriate kickstart file. All of the work to customize the  image  is
549       handled  by the kickstart.  The example currently included was modified
550       from the cloud-kickstarts version so that it would  work  with  liveme‐
551       dia-creator.
552
553       Example cmdline:
554
555       sudo      livemedia-creator      --make-ami     --iso=/path/to/boot.iso
556       --ks=./docs/fedora-livemedia-ec2.ks
557
558       This will produce an ami-root.img file in the working directory.
559
560       At this time I have not tested the image with EC2.  Feedback  would  be
561       welcome.
562

APPLIANCE CREATION

564       livemedia-creator   can   now  replace  appliance-tools  by  using  the
565       --make-appliance switch. This will create the  partitioned  disk  image
566       and  an  XML  file  that can be used with virt-image to setup a virtual
567       system.
568
569       The   XML   is    generated    using    the    Mako    template    from
570       /usr/share/lorax/appliance/libvirt.xml You can use a different template
571       by passing --app-template <template path>
572
573       Documentation on the Mako template system can be found at the Mako site
574
575       The name of the final output XML is appliance.xml, this can be  changed
576       with --app-file <file path>
577
578       The following variables are passed to the template:
579
580          disks  A list of disk_info about each disk.  Each entry has the fol‐
581                 lowing attributes:
582                     name base name of the disk image file
583
584                     format "raw"
585
586                     checksum_type "sha256"
587
588                     checksum sha256 checksum of the disk image
589
590          name Name of appliance, from --app-name argument
591
592          arch Architecture
593
594          memory Memory in KB (from --ram)
595
596          vcpus from --vcpus
597
598          networks list of networks from the kickstart or []
599
600          title from --title
601
602          project from --project
603
604          releasever from --releasever
605
606       The created image can be imported into libvirt using:
607          virt-image appliance.xml
608
609       You can also create qcow2 appliance  images  using  --image-type=qcow2,
610       for example:
611
612          sudo livemedia-creator --make-appliance --iso=/path/to/boot.iso --ks=./docs/fedora-minimal.ks \
613          --image-type=qcow2 --app-file=minimal-test.xml --image-name=minimal-test.img
614

FILESYSTEM IMAGE CREATION

616       livemedia-creator can be used to create un-partitined filesystem images
617       using the --make-fsimage option. As of version  21.8  this  works  with
618       both qemu and no-virt modes of operation. Previously it was only avail‐
619       able with no-virt.
620
621       Kickstarts should have a single / partition with no extra mountpoints.
622          livemedia-creator       --make-fsimage       --iso=/path/to/boot.iso
623          --ks=./docs/fedora-minimal.ks
624
625       You  can name the output image with --image-name and set a label on the
626       filesystem with --fs-label
627

TAR FILE CREATION

629       The --make-tar command can be used to create a tar of the root filesys‐
630       tem.  By  default  it  is  compressed using xz, but this can be changed
631       using the --compression and --compress-arg options. This  option  works
632       with both virt and no-virt install methods.
633
634       As  with  --make-fsimage  the kickstart should be limited to a single /
635       partition.
636
637       For example:
638
639          livemedia-creator --make-tar --iso=/path/to/boot.iso --ks=./docs/fedora-minimal.ks \
640          --image-name=fedora-root.tar.xz
641

LIVE IMAGE FOR PXE BOOT

643       The --make-pxe-live command will produce squashfs image containing live
644       root  filesystem  that can be used for pxe boot. Directory with results
645       will contain the live image, kernel image, initrd image and template of
646       pxe configuration for the images.
647

ATOMIC LIVE IMAGE FOR PXE BOOT

649       The   --make-ostree-live  command  will  produce  the  same  result  as
650       --make-pxe-live for installations of Atomic  Host.   Example  kickstart
651       for  such  an  installation  using Atomic installer iso with local repo
652       included in the image can be found in docs/rhel-atomic-pxe-live.ks.
653
654       The PXE images can also be created with --no-virt by using the  example
655       kickstart  in  docs/fedora-atomic-pxe-live-novirt.ks.  This  also works
656       inside the mock environment.
657

USING MOCK AND --NO-VIRT TO CREATE IMAGES

659       As of lorax version 22.2 you can  use  livemedia-creator  and  anaconda
660       version  22.15 inside of a mock chroot with --make-iso and --make-fsim‐
661       age.
662
663       NOTE:
664          As of mock 1.3.4 you need to use --old-chroot with  mock.  Mock  now
665          defaults to using systemd-nspawn which cannot create the needed loop
666          device nodes. Passing --old-chroot will use  the  old  system  where
667          /dev/loop* is setup for you.
668
669       On the host system:
670
671       1. yum install -y mock
672
673       2. Add a user to the mock group to use for running mock. eg. builder
674
675       3. Create  a  new  /etc/mock/  config file based on the rawhide one, or
676          modify the existing one so that the following options are setup:
677
678             config_opts['chroot_setup_cmd'] = 'install @buildsys-build anaconda-tui lorax'
679
680             # build results go into /home/builder/results/
681             config_opts['plugin_conf']['bind_mount_opts']['dirs'].append(('/home/builder/results','/results/'))
682
683          If you are creating images for a  branched  release  of  Fedora  you
684          should  also  enable  the updates-testing repository so that you get
685          the latest builds in your mock chroot.
686
687       The following steps are run as the builder user who is a member of  the
688       mock group.
689
690       4. Make  a  directory  for  results matching the bind mount above mkdir
691          ~/results/
692
693       5. Copy the example kickstarts cp /usr/share/docs/lorax/*ks .
694
695       6. Make sure tar and dracut-network are in the  %packages  section  and
696          that the url points to the correct repo
697
698       7. Init the mock mock -r fedora-rawhide-x86_64 --old-chroot --init
699
700       8. Copy  the  kickstart  inside  the mock mock -r fedora-rawhide-x86_64
701          --old-chroot --copyin ./fedora-minimal.ks /root/
702
703       9. Make a minimal iso:
704
705             mock -r fedora-rawhide-x86_64 --old-chroot --chroot -- livemedia-creator --no-virt \
706             --resultdir=/results/try-1 --logfile=/results/logs/try-1/try-1.log \
707             --make-iso --ks /root/fedora-minimal.ks
708
709       Results will be in ./results/try-1 and logs under  /results/logs/try-1/
710       including anaconda logs and livemedia-creator logs. The new iso will be
711       located at ~/results/try-1/images/boot.iso,  and  the  ~/results/try-1/
712       directory tree will also contain the vmlinuz, initrd, etc.
713

USING MOCK AND QEMU TO CREATE IMAGES

715       Version  25.0  of livemedia-creator switches to using qemu for virtual‐
716       ization.  This allows creation of all image types, and use of  the  KVM
717       on the host if /dev/kvm is present in the mock environment.
718
719       On the host system:
720
721       1. yum install -y mock
722
723       2. Add a user to the mock group to use for running mock. eg. builder
724
725       3. Create  a  new  /etc/mock/  config file based on the rawhide one, or
726          modify the existing one so that the following options are setup:
727
728             config_opts['chroot_setup_cmd'] = 'install @buildsys-build lorax qemu'
729
730             # build results go into /home/builder/results/
731             config_opts['plugin_conf']['bind_mount_opts']['dirs'].append(('/home/builder/results','/results/'))
732
733          If you are creating images for a  branched  release  of  Fedora  you
734          should  also  enable  the updates-testing repository so that you get
735          the latest builds in your mock chroot.
736
737       The following steps are run as the builder user who is a member of  the
738       mock group.
739
740       4. Make  a  directory  for  results matching the bind mount above mkdir
741          ~/results/
742
743       5. Copy the example kickstarts cp /usr/share/docs/lorax/*ks .
744
745       6. Make sure tar and dracut-network are in the  %packages  section  and
746          that the url points to the correct repo
747
748       7. Init the mock mock -r fedora-rawhide-x86_64 --old-chroot --init
749
750       8. Copy  the  kickstart  inside  the mock mock -r fedora-rawhide-x86_64
751          --old-chroot --copyin ./fedora-minimal.ks /root/
752
753       9. Copy   the   Anaconda   boot.iso   inside   the   mock    mock    -r
754          fedora-rawhide-x86_64 --old-chroot --copyin ./boot.iso /root/
755
756       10.
757          Make a minimal iso:
758
759             mock -r fedora-rawhide-x86_64 --old-chroot --chroot -- livemedia-creator \
760             --resultdir=/results/try-1 --logfile=/results/logs/try-1/try-1.log \
761             --make-iso --ks /root/fedora-minimal.ks --iso /root/boot.iso
762
763       Results  will be in ./results/try-1 and logs under /results/logs/try-1/
764       including anaconda logs and livemedia-creator logs. The new iso will be
765       located  at  ~/results/try-1/images/boot.iso,  and the ~/results/try-1/
766       directory tree will also contain the vmlinuz, initrd, etc.
767
768       This will run qemu without kvm support, which is going to be very slow.
769       You  can  add mknod /dev/kvm c 10 232; to create the device node before
770       running lmc.
771

OPENSTACK IMAGE CREATION

773       OpenStack supports partitioned disk images so --make-disk can  be  used
774       to  create  images for importing into glance, OpenStack's image storage
775       component.  You need to have  access  to  an  OpenStack  provider  that
776       allows image uploads, or setup your own using the instructions from the
777       RDO Project.
778
779       The example kickstart, fedora-openstack.ks, is only slightly  different
780       than   the   fedora-minimal.ks   one.    It  adds  the  cloud-init  and
781       cloud-utils-growpart packages. OpenStack supports setting up the  image
782       using  cloud-init,  and cloud-utils-growpart will grow the image to fit
783       the instance's disk size.
784
785       Create a qcow2 image using the kickstart like this:
786          sudo    livemedia-creator    --make-disk     --iso=/path/to/boot.iso
787          --ks=/path/to/fedora-openstack.ks --image-type=qcow2
788
789       NOTE:
790          On  the  RHEL7  version of lmc --image-type isn't supported. You can
791          only create a bare partitioned disk image.
792
793       Import the resulting disk image into the OpenStack system,  either  via
794       the web UI, or glance on the cmdline:
795
796          glance image-create --name "fedora-openstack" --is-public true --disk-format qcow2 \
797          --container-format bare --file ./fedora-openstack.qcow2
798
799       If qcow2 wasn't used then --disk-format should be set to raw.
800

DOCKER IMAGE CREATION

802       Use  lmc to create a tarfile as described in the TAR File Creation sec‐
803       tion, but  substitute  the  fedora-docker.ks  example  kickstart  which
804       removes the requirement for core files and the kernel.
805
806       You can then import the tarfile into docker like this (as root):
807          cat /var/tmp/fedora-root.tar.xz | docker import - fedora-root
808
809       And then run bash inside of it:
810          sudo docker run -i -t fedora-root /bin/bash
811

OPEN CONTAINER INITIATIVE IMAGE CREATION

813       The  OCI  is a new specification that is still being worked on. You can
814       read more about it at the Open Container Initiative  website.  You  can
815       create OCI images using the following command:
816
817          sudo livemedia-creator --make-oci --oci-config /path/to/config.json --oci-runtime /path/to/runtime.json \
818          --iso=/path/to/boot.iso --ks=/path/to/fedora-minimal.ks
819
820       You  must provide the config.json and runtime.json files to be included
821       in the bundle, their specifications can be  found  on  the  OCI  github
822       project  output will be in the results directory with a default name of
823       bundle.tar.xz
824
825       This will work with --no-virt and inside a mock since  it  doesn't  use
826       any partitioned disk images.
827

VAGRANT IMAGE CREATION

829       Vagrant images can be created using the following command:
830
831          sudo livemedia-creator --make-vagrant --vagrant-metadata /path/to/metadata.json \
832          --iso=/path/to/boot.iso --ks=/path/to/fedora-vagrant.ks
833
834       The image created is a vagrant-libvirt provider image and needs to have
835       vagrant setup with libvirt before you can use it.
836
837       The --vagrant-metadata file is optional, it will create a  minimal  one
838       by  default,  and  if one is passed it will make sure the disk size  is
839       setup correctly.  If  you  pass  a  --vagrant-vagrantfile  it  will  be
840       included in the image verbatim. By default no vagrantfile is created.
841
842       There  is  an example Vagrant kickstart file in the docs directory that
843       sets up the vagrant user with the default insecure SSH pubkey and a few
844       useful utilities.
845
846       This  also works with --no-virt, but will not work inside a mock due to
847       its use of partitioned disk images and qcow2.
848

CREATING UEFI DISK IMAGES WITH VIRT

850       Partitioned disk images can only be created for the  same  platform  as
851       the  host system (BIOS or UEFI). You can use virt to create BIOS images
852       on UEFI systems, and it is also possible to create UEFI images on  BIOS
853       systems using OVMF firmware and qemu.
854
855       Install the lorax-lmc-virt package, this will install qemu and the OVMF
856       firmware files.
857
858       Now you can run livemedia-creator with --virt-uefi to boot and  install
859       using UEFI:
860
861          sudo livemedia-creator --make-disk --virt-uefi --iso=/path/to/boot.iso \
862          --ks=/path/to/fedora-minimal.ks
863
864       Make  sure  that the kickstart you are using creates a /boot/efi parti‐
865       tion by including this:
866
867          part /boot/efi --fstype="efi" --size=500
868
869       Or use reqpart in the kickstart and Anaconda will create  the  required
870       partitions.
871
872       NOTE:
873          The  --virt-uefi  method  is  currently only supported on the x86_64
874          architecture.
875

DEBUGGING PROBLEMS

877       Sometimes an installation will get stuck. When using qemu the logs will
878       be written to ./virt-install.log and most of the time any problems that
879       happen will be near the end of the file. lmc  tries  to  detect  common
880       errors  and  will  cancel  the  installation  when they happen. But not
881       everything can be caught.  When creating a new kickstart it is  helpful
882       to  use vnc so that you can monitor the installation as it happens, and
883       if it gets stuck without lmc detecting the problem you  can  switch  to
884       tty1 and examine the system directly.
885
886       If  you  suspect  problems with %pre or %post sections you can redirect
887       the output to the terminal and examine it by logging into the VM. eg.:
888
889          %pre
890          chvt
891          exec < /dev/tty3 > /dev/tty3 2>/dev/tty3
892          #do stuff
893          echo hello world
894          %end
895
896       If it does get stuck the best way to cancel is to use kill  -9  on  the
897       qemu pid, lmc will detect that the process died and cleanup.
898
899       If  lmc  didn't  handle the cleanup for some reason you can do this: 1.
900       sudo umount /tmp/lmc-XXXX to unmount the iso from its  mountpoint.   2.
901       sudo  rm -rf /tmp/lmc-XXXX 3. sudo rm /var/tmp/lmc-disk-XXXXX to remove
902       the disk image.
903
904       Note that lmc uses the lmc- prefix for all of its temporary  files  and
905       directories to make it easier to find and clean up leftovers.
906
907       The  logs  from  the qemu run are stored in virt-install.log, logs from
908       livemedia-creator are in livemedia.log and program.log
909
910       You can add --image-only to skip the  .iso  creation  and  examine  the
911       resulting  disk  image.  Or you can pass --keep-image to keep it around
912       after the iso has been created.
913
914       Cleaning up aborted --no-virt installs can sometimes be accomplished by
915       running  the  anaconda-cleanup  script.  As  of  Fedora  18 anaconda is
916       multi-threaded and it can sometimes become stuck and  refuse  to  exit.
917       When  this  happens  you can usually clean up by first killing the ana‐
918       conda process then running anaconda-cleanup.
919

HACKING

921       Development on this will take place as part of the lorax  project,  and
922       on the anaconda-devel-list mailing list, and on github
923
924       Feedback,  enhancements  and bugs are welcome.  You can use bugzilla to
925       report bugs against the lorax component.
926

AUTHOR

928       Weldr Team
929
931       2018, Red Hat, Inc.
932
933
934
935
93630.19                            May 06, 2019             LIVEMEDIA-CREATOR(1)
Impressum