# Use network installation url --url="ftp://pxe_server_ip/pub/pxe/Rocky-9.3-x86_64/BaseOS/" repo --name="AppStream" --baseurl="ftp://pxe_server_ip/pub/pxe/Rocky-9.3-x86_64/AppStream/" # Disable Initial Setup on first boot firstboot --disable
# Use text mode install text # Keyboard layouts keyboard --vckeymap=gb --xlayouts='gb' # System language lang en_GB.UTF-8 # SELinux configuration selinux --enforcing # Firewall configuration firewall --enabled --ssh # Do not configure the X Window System skipx
%packages # dnf group info minimal-environment @^minimal-environment sudo qemu-guest-agent openssh-server # Alsa not needed in a VM -alsa* # Microcode updates cannot work in a VM -microcode_ctl # Firmware packages are not needed in a VM -iwl*firmware # Don't build rescue initramfs -dracut-config-rescue -plymouth %end
%post sed -i 's/^.*requiretty/#Defaults requiretty/' /etc/sudoers sed -i 's/rhgb //' /etc/default/grub # SSHD PermitRootLogin and enable the service sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config /usr/bin/systemctl enable sshd # Update all packages # /usr/bin/yum -y update
# vim /var/lib/tftpboot/pxelinux.cfg/default default menu.c32 prompt 0 timeout 50 menu title Homelab PXE Menu label Install Rocky Linux 9 Server kernel /networkboot/Rocky-9.3-x86_64/vmlinuz append initrd=/networkboot/Rocky-9.3-x86_64/initrd.img inst.repo=ftp://pxe_server_ip/pub/pxe/Rocky-9.3-x86_64/ inst.ks=ftp://pxe_server_ip/pub/pxe/Rocky-9.3-x86_64.cfg