Personal quick-reference notes. See Kickstart for the full guide these are drawn from and expand on — that page covers file syntax,
%packages/%post, pykickstart tooling, and all the delivery methods below in more depth. This page is the condensed "what do I actually type" version.
Preferred delivery method: PXE¶
For anything beyond a one-off VM, PXE is the right approach — see PXE/netboot for building one. Skip straight to that page rather than the ISO/floppy/HTTP-by-hand methods below for anything you'll do more than once.
Quick delivery one-liners¶
# HTTP-hosted
linux inst.ks=http://<server>/kickstart/<file>.cfg ip=dhcp
# Git raw file (public repo)
linux inst.ks=https://git.example.com/<user>/kickstart/raw/master/server_ks.cfg ip=dhcp
# CD/DVD
linux inst.ks=cdrom:/dev/cdrom:/ks/<file>.cfg ip=dhcp
# Bonded NIC target
linux inst.ks=http://<server>/ks/<file>.cfg ip=dhcp bond=bond0:ens160,ens192:mode=802.3ad,primary=ens160
Custom ISO build¶
KS_DIR="/build/RHEL/isolinux/ks"
mkdir -p "$KS_DIR" && cp <file>.cfg "$KS_DIR/ks.cfg"
sudo mkisofs -o <hostname>.iso -b isolinux.bin -c boot.cat -no-emul-boot \
-V 'RHEL x86_64' -boot-load-size 4 -boot-info-table -R -J -v -T /build/RHEL/isolinux/
SSH into a running install to debug it¶
# 1. snapshot leases before boot
arp -an > /tmp/before.txt
# 2. add inst.sshd=1 to the boot args, e.g. via virt-install --extra-args:
# "console=ttyS0,115200n8 inst.sshd=1 inst.ks=http://<server>:8000/ks.cfg ip=dhcp"
# 3. once past DHCP, diff leases
arp -an > /tmp/after.txt
diff /tmp/before.txt /tmp/after.txt
# 4. connect — no password required inside the installer environment
ssh root@<installer_ip>
virsh net-dhcp-leases <network> is a more direct source of the lease on libvirt than diffing ARP tables, if the VM is on a libvirt-managed network.
Tooling¶
sudo dnf install pykickstart
ksvalidator my.ks # lint before using
ksverdiff -f rhel7 -t rhel8 # command changes between major versions
Reference links¶
- Anaconda source —
pyanaconda/core/kickstart/commands.pyis the ground truth for every available command - Red Hat's Kickstart generator (subscriber login)
- Complex partitioning examples
- Anaconda boot options — networking