Red Hat Training

A Red Hat training course is available for Red Hat Linux

4.2. Automatic Installation

This section describes a simple procedure on how to add a Kickstart file to the installation USB drive, which automatically installs and registers Red Hat Enterprise Linux. You can use this procedure to deploy Red Hat Enterprise Linux on multiple machines.

Generating the USB Boot Media

  1. Record an installation in a Kickstart file:
    1. Manually install Red Hat Enterprise Linux once. For details see Section 4.1, “Interactive Installation”.
    2. Boot the installed system. During the installation, Anaconda created a Kickstart file with the settings in the /root/anaconda-ks.cfg file.
  2. Download the Red Hat Enterprise Linux installation DVD ISO file to the /tmp/ directory.
  3. Mount the installation ISO file to the /mnt/ directory. For example:
    # mount -o loop /tmp/rhel-server-7.3-x86_64-dvd.iso /mnt/
  4. Create a working directory and copy the DVD content to it. For example:
    # mkdir /root/rhel-install/
    # shopt -s dotglob
    # cp -avRf /mnt/* /root/rhel-install/
  5. Unmount the ISO file:
    # umount /mnt/
  6. Copy the Kickstart file generated during the installation to the working directory:
    # cp /root/anaconda-ks.cfg /root/rhel-install/
  7. To register Red Hat Enterprise Linux after the installation automatically and attach a subscription, append the following to the /root/rhel-install/anaconda-ks.cfg file:
    %post
    subscription-manager register --auto-attach --username=user_name --password=password
    %end
  8. Display the installation DVD volume name:
    # isoinfo -d -i rhel-server-7.3-x86_64-dvd.iso | grep "Volume id" | \
    sed -e 's/Volume id: //' -e 's/ /\\x20/g'
    RHEL-7.3\x20Server.x86_64
  9. Add a new menu entry to the boot /root/rhel-install/isolinux/isolinux.cfg file that uses the Kickstart file. For example:
    #######################################
    label kickstart
    menu label ^Kickstart Installation of RHEL7.3
    kernel vmlinuz
    append initrd=initrd.img inst.stage2=hd:LABEL=RHEL-7.3\x20Server.x86_64 inst.ks=cdrom:/anaconda-ks.cfg
    #######################################

    Note

    Set the inst.stage2=hd:LABEL= option to the DVD volume name retrieved in the previous step.
  10. Create the /root/rhel-ks.iso file from the working directory:
    # mkisofs -J -T -o /root/rhel-ks.iso -b isolinux/isolinux.bin \
    -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table \
    -R -m TRANS.TBL -graft-points -V "RHEL-7.3 Server.x86_64" \
    /root/rhel-install/

    Note

    Set the -V option to the DVD volume name retrieved in an earlier step and replace \x20 in the string with a space.
  11. Create an installation USB drive. For details, see Section 3.2.1, “Making Installation USB Media on Linux”.

Install Red Hat Enterprise Linux Using the Kickstart File

  1. Select the entry, that contains the Kickstart configuration, you created in the section called “Generating the USB Boot Media”.