RED HAT ENTERPRISE LINUX

Installation & Kickstart

Installing RHEL Interactively and Automatically

College-Level Course Module | RHEL System Administration

Learning Objectives

1
Understand RHEL installation methods

Boot media, installation sources, and deployment options

2
Perform interactive installation

Navigate Anaconda installer, configure storage and packages

3
Create Kickstart configuration files

Automate installations with ks.cfg files

4
Deploy systems using Kickstart

Boot with Kickstart files from various sources

Installation Overview

RHEL Installation uses the Anaconda installer to deploy the operating system. It can run interactively with a GUI or automatically using Kickstart configuration files.

Interactive Installation

Administrator makes choices through GUI screens. Good for unique systems, learning, or when requirements are unclear.

Kickstart Installation

Configuration file provides all answers. Good for deploying many identical systems, ensuring consistency, automation.

Boot Media
Anaconda
Configure
Install Packages
Reboot

Installation Media

RHEL installation requires boot media and package sources. These can be the same (DVD) or separate (network boot + network repository).

Media TypeDescriptionUse Case
DVD ISO Full installation image (~10GB), contains all packages Standalone installations, no network needed
Boot ISO Minimal boot image (~800MB), packages from network Network installations, always get latest packages
USB Drive DVD or Boot ISO written to USB Physical servers, no optical drive
PXE Boot Network boot, no local media needed Data center deployments, automation
# Create bootable USB from ISO (Linux)
[root@workstation ~]# dd if=rhel-9.3-x86_64-dvd.iso of=/dev/sdb bs=4M status=progress
# Warning: This destroys all data on /dev/sdb!

# Verify USB device name first
[root@workstation ~]# lsblk

Booting the Installer

RHEL 9.3 Installation
Install Red Hat Enterprise Linux 9.3
Test this media & install Red Hat Enterprise Linux 9.3
Troubleshooting >

Press Tab to edit options, Press e to edit the whole command
# Boot menu options:
# - Install: Start installation immediately
# - Test & Install: Verify media integrity first (recommended)
# - Troubleshooting: Rescue mode, memory test

# Press Tab to add boot options:
vmlinuz initrd=initrd.img inst.stage2=hd:LABEL=RHEL-9-3 quiet

# Add Kickstart location:
vmlinuz ... inst.ks=http://server/ks.cfg

# Common boot options:
# inst.ks=URL          - Kickstart file location
# inst.repo=URL        - Package repository location
# inst.vnc             - Enable VNC for remote installation
# inst.text            - Text mode installation

Anaconda Summary Screen

The Installation Summary screen is the hub of interactive installation. Configure each category, then begin installation when all items show complete.

INSTALLATION SUMMARY
LOCALIZATION
Keyboard: English (US)
Language Support: English
Time & Date: America/New_York
SOFTWARE
Installation Source ⚠
Software Selection: Server
SYSTEM
Installation Destination ⚠
Network & Host Name
USER SETTINGS
Root Password ⚠
User Creation
Begin Installation (disabled until required items configured)

Installation Destination

Installation Destination configures disk partitioning. You can use automatic partitioning or create custom layouts with standard partitions, LVM, or Btrfs.

# Automatic partitioning creates:
/boot      - 1 GB (ext4 or xfs)
/boot/efi  - 600 MB (UEFI systems only, vfat)
/          - Remaining space (xfs, in LVM)
swap       - Based on RAM (in LVM)

# Recommended minimum partitions:
/boot      - 1 GB minimum, outside LVM
/          - Root filesystem, 10+ GB
swap       - Equal to RAM for hibernation, or 50% RAM

# Optional separate partitions:
/home      - User data, survives reinstalls
/var       - Logs, databases, growing data
/tmp       - Temporary files, can add noexec
RHEL 9 default: Automatic partitioning uses LVM with XFS filesystems. This provides flexibility to resize volumes later.

Software Selection

Software Selection determines which packages are installed. Choose a base environment and optional add-ons for your intended use case.

Base EnvironmentDescriptionPackages
Server with GUI Full graphical server environment ~1400 packages
Server Command-line server, common services ~400 packages
Minimal Install Bare minimum for running system ~300 packages
Workstation Desktop with development tools ~1800 packages
Custom Operating System Only core packages, you select everything ~250 packages
Virtualization Host KVM hypervisor and management tools ~500 packages
Best practice: Start minimal and add packages later with dnf. This reduces attack surface and installation time.

Network Configuration

# Network & Host Name screen allows:
# - Enable/disable network interfaces
# - Configure IPv4/IPv6 (DHCP or static)
# - Set hostname

# For static IP configuration:
IPv4 Method: Manual
Address:     192.168.1.100
Netmask:     255.255.255.0  (or /24)
Gateway:     192.168.1.1
DNS:         192.168.1.1, 8.8.8.8

# Hostname examples:
server1.example.com    (FQDN recommended)
webserver01            (short name)

# Network is needed during installation for:
# - Network installation source (Boot ISO)
# - Red Hat subscription registration
# - Time synchronization
# - Kickstart file retrieval
Note: Network interfaces are disabled by default during installation. Enable and configure them here, especially for network installations or subscription registration.

User Configuration

Root Password

Set the root account password. Can optionally lock root account if admin user is created.

# Strong password requirements:
# - At least 8 characters
# - Mix of cases, numbers, symbols
# - Not a dictionary word

# Options:
[ ] Lock root account
[x] Allow root SSH login

User Creation

Create a regular user account. Can grant administrator privileges (wheel group).

# User account fields:
Full name: Alice Admin
User name: alice
Password:  ********

# Options:
[x] Make administrator
    (adds to wheel group)
Security practice: Create an administrator user and optionally lock root. This provides accountability through individual logins and sudo logging.

Begin Installation

Configure All
Begin Install
Package Install
Reboot
# Once Begin Installation is clicked:
# 1. Disk partitioning is applied (destructive!)
# 2. Filesystems are created and formatted
# 3. Packages are installed from source
# 4. Bootloader (GRUB2) is installed
# 5. Initial configuration is applied
# 6. System is ready to reboot

# Progress shows:
Installing package 234 of 456: httpd-2.4.53...
Performing post-installation setup tasks...

# After completion:
[Reboot System]

# Remove installation media before reboot!
Point of no return: Once you click Begin Installation, disk changes are applied. Existing data on selected disks will be destroyed.

Introduction to Kickstart

Kickstart automates RHEL installation by providing answers to all installer questions in a configuration file. The system installs without human intervention.

Manual Installation

Click through screens
Make decisions interactively
Good for 1-5 systems
Each install may differ slightly

Kickstart Installation

Configuration file provides answers
Completely automated
Good for many systems
Guaranteed identical installs

Benefits: Consistency across deployments, faster installation, reduced human error, repeatable process, enables Infrastructure as Code practices.

Kickstart Structure

# Kickstart file sections:

# 1. Command Section - Installation settings
text                           # Text mode install
url --url="http://repo/rhel9" # Package source
keyboard --vckeymap=us        # Keyboard layout
lang en_US.UTF-8              # Language
timezone America/New_York     # Timezone
rootpw --iscrypted $6$...    # Root password (encrypted)

# 2. Disk Configuration
clearpart --all --initlabel   # Clear existing partitions
autopart                       # Automatic partitioning
bootloader --location=mbr     # Bootloader location

# 3. Package Section
%packages
@^minimal-environment         # Base environment
vim-enhanced                   # Individual package
-plymouth                      # Exclude package
%end

# 4. Scripts Section (optional)
%post
echo "Post-install script"
%end

Essential Commands

# Installation source
url --url="http://server/rhel9/BaseOS"
cdrom                          # Use attached DVD/ISO
nfs --server=nfs.example.com --dir=/exports/rhel9

# Network configuration
network --bootproto=dhcp --device=eth0 --activate
network --bootproto=static --ip=192.168.1.100 --netmask=255.255.255.0 --gateway=192.168.1.1 --nameserver=8.8.8.8 --hostname=server1.example.com

# User accounts
rootpw --plaintext redhat123  # Plain text (not recommended)
rootpw --iscrypted $6$rounds=... # Encrypted (use this)
rootpw --lock                 # Lock root account
user --name=alice --password=$6$... --iscrypted --groups=wheel

# Installation behavior
text                           # Text mode
graphical                      # GUI mode
reboot                         # Reboot after install
poweroff                       # Shut down after install
firstboot --disabled          # Skip first-boot wizard

Disk Configuration

# Clear and initialize disk
zerombr                        # Clear MBR if invalid
clearpart --all --initlabel   # Remove all partitions
clearpart --drives=sda        # Clear specific disk only

# Automatic partitioning
autopart                       # Default LVM layout
autopart --type=lvm           # Explicitly use LVM
autopart --type=plain         # Standard partitions, no LVM

# Manual partition layout
part /boot --fstype=xfs --size=1024
part /boot/efi --fstype=efi --size=600  # UEFI systems
part pv.01 --size=1 --grow    # LVM physical volume

volgroup rhel pv.01           # Volume group
logvol / --vgname=rhel --name=root --fstype=xfs --size=10240
logvol /home --vgname=rhel --name=home --fstype=xfs --size=5120
logvol swap --vgname=rhel --name=swap --size=2048

# Bootloader
bootloader --location=mbr --boot-drive=sda

Package Selection

%packages
# Environment group (base installation)
@^minimal-environment         # Minimal install
@^server-product-environment  # Server
@^graphical-server-environment # Server with GUI

# Package groups
@development                   # Development Tools group
@system-tools                  # System administration tools
@security-tools                # Security tools

# Individual packages
vim-enhanced
tmux
git
httpd
firewalld

# Exclude packages (prefix with -)
-plymouth                      # Remove boot splash
-iwl*firmware                  # Remove wireless firmware

%end
List available groups: dnf group list --hidden shows all package groups. Environment groups use @^ prefix, regular groups use @.

%pre and %post Scripts

%pre
# Runs BEFORE installation, limited environment
# Useful for dynamic disk selection, logging
echo "Starting installation at $(date)" > /tmp/install.log
%end

%post
# Runs AFTER installation, full system available
# Runs in chroot of installed system by default

# Configure services
systemctl enable httpd
systemctl enable firewalld

# Create files
cat > /etc/motd << EOF
Deployed via Kickstart on $(date)
EOF

# Run commands
dnf -y update
subscription-manager register --username=user --password=pass
%end

%post --nochroot
# Access installation environment, not installed system
cp /tmp/install.log /mnt/sysimage/root/
%end

Creating Kickstart Files

Create Kickstart files from scratch, from the system-config-kickstart tool, or by copying and modifying the anaconda-ks.cfg from a completed installation.

# Every RHEL installation creates a Kickstart file recording what was done
[root@server ~]# cat /root/anaconda-ks.cfg
# Generated by Anaconda 34.25.0.20
# System timezone
timezone America/New_York --utc
# Root password
rootpw --iscrypted $6$...
...

# Copy and customize for future installs
[root@server ~]# cp /root/anaconda-ks.cfg /var/www/html/ks.cfg
[root@server ~]# vi /var/www/html/ks.cfg

# Validate Kickstart syntax
[root@server ~]# dnf install pykickstart
[root@server ~]# ksvalidator /var/www/html/ks.cfg
(no output means valid)

# Compare two Kickstart files
[root@server ~]# ksdiff ks1.cfg ks2.cfg

Using Kickstart Files

# Boot option to specify Kickstart location
inst.ks=URL

# Kickstart from HTTP server
inst.ks=http://192.168.1.10/ks.cfg
inst.ks=http://server.example.com/kickstart/webserver.cfg

# Kickstart from NFS
inst.ks=nfs:server.example.com:/exports/ks.cfg

# Kickstart from USB or DVD
inst.ks=hd:sdb1:/ks.cfg
inst.ks=cdrom:/ks.cfg

# At boot menu, press Tab and add:
vmlinuz initrd=initrd.img inst.stage2=... inst.ks=http://server/ks.cfg

# Combine with repository location if using Boot ISO
inst.ks=http://server/ks.cfg inst.repo=http://server/rhel9/
HTTP is most common: Host Kickstart files on a web server. Easy to update, version control, and serve multiple configurations.

Complete Example

# Minimal web server Kickstart
text
url --url="http://repo.example.com/rhel9/BaseOS"
repo --name="AppStream" --baseurl="http://repo.example.com/rhel9/AppStream"

keyboard --vckeymap=us
lang en_US.UTF-8
timezone America/New_York --utc

network --bootproto=dhcp --device=eth0 --activate
network --hostname=webserver1.example.com

rootpw --iscrypted $6$rounds=4096$salt$hashedpassword
user --name=admin --groups=wheel --iscrypted --password=$6$...

zerombr
clearpart --all --initlabel
autopart
bootloader --location=mbr

firewall --enabled --service=ssh --service=http --service=https
selinux --enforcing
firstboot --disabled
reboot

%packages
@^minimal-environment
httpd
mod_ssl
vim-enhanced
%end

%post
systemctl enable httpd
%end

Key Takeaways

1

Interactive Install: Boot from media, configure through Anaconda GUI screens. Good for unique systems and learning.

2

Key Decisions: Disk partitioning (auto or custom), software selection (minimal to full), network, and user accounts.

3

Kickstart: Text file with all installation answers. Use inst.ks=URL at boot. Enables consistent automated deployment.

4

Kickstart Sources: Copy /root/anaconda-ks.cfg from existing install. Validate with ksvalidator.

LAB EXERCISES

  • Perform interactive RHEL installation in a VM
  • Use custom partitioning with separate /home
  • Copy and examine anaconda-ks.cfg from completed install
  • Create Kickstart for minimal server with specific packages
  • Deploy VM using Kickstart from HTTP server
  • Add %post script to enable services and create files

Next: Managing Software with DNF and Repositories