Complete PXE and kickstart configuration

Install needed packages and create need directory

yum install pykickstart
mkdir -p /var/lib/tftpboot/pxelinux/pxelinux.cfg

Copy current Anaconda file to be the new kickstart file

cp /root/anaconda-ks.cfg /centos7_x64/kickstart.ks

Edit kickstart file as needed (mine listed)

#version=RHEL7
# System authorization information
auth --enableshadow --passalgo=sha512

# Use NFS installation location
nfs --server=192.168.100.2 --dir=/centos7_x64

# Use graphical install
graphical
# Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=vda
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
# System language
lang en_US.UTF-8

# Network information
network --bootproto=dhcp --device=eth0 --onboot=yes --hostname=localhost.localdomain --noipv6 
# Root password
rootpw --iscrypted *****
# System timezone
timezone America/New_York --isUtc
# System bootloader configuration
bootloader --location=mbr --boot-drive=vda
autopart --type=plain
# Partition clearing information
clearpart --drives=vda --all
reboot
%packages
@core

%end

Validate kickstart file – should produce no output

ksvalidator /centos7_x64/kickstart.ks

Set permissions on kickstart.ks file

chmod 644 /centos7_x64/kickstart.ks

Create auto install PXE default file at /var/lib/tftpboot/pxelinux/pxelinux.cfg/default (mine listed, change as needed)

default vesamenu.c32
prompt 1
timeout 60

display boot.msg

label linux
  menu label ^Install CentOS 7
  menu default
  kernel vmlinuz
  append initrd=initrd.img ip=dhcp inst.ks=nfs:192.168.100.2:/centos7_x64/kickstart.ks

Copy needed files to the pxelinux directory

cd ~
cp /centos7_64/Packages/syslinux-4* ./
rpm2cpio syslinux-4* | cpio -dim
cp ./usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/pxelinux/
cp ./usr/share/syslinux/vesamenu.c32 /var/lib/tftpboot/pxelinux/
cp /centos7_64/images/pxeboot/vmlinuz /var/lib/tftpboot/pxelinux/
cp /centos7_64/images/pxeboot/initrd.img /var/lib/tftpboot/pxelinux/
echo "Install CentOS 7" > /var/lib/tftpboot/pxelinux/boot.msg

Leave a Reply

Don't like what I say? Leave!