User:Djflux/rocky9-gui-vbox-kickstart

lang en_US keyboard us timezone America/New_York --utc rootpw abc123 reboot url --url=https://ord.mirror.rackspace.com/rocky/9/BaseOS/x86_64/os bootloader --append="rhgb quiet crashkernel=auto" zerombr clearpart --all --initlabel autopart auth --passalgo=sha512 --useshadow selinux --enforcing firewall --enabled --http --ssh firstboot --disable %packages @^workstation-product-environment @network-tools git vim-enhanced net-tools bzip2 elfutils-libelf-devel gcc kernel-devel kernel-headers make perl tar %end
 * 1) Add inst.ks=https://www.mediawiki.org/w/index.php?title=User:Djflux/rocky9-vbox-kickstart&action=raw to the boot statement
 * 2) See https://github.com/pykickstart/pykickstart/blob/master/docs/kickstart-docs.rst for kickstart documentation
 * 3) Use this Kickstart File for testing Meza version:
 * 4) https://github.com/djflux/meza/tree/39.x
 * 5) https://github.com/djflux/meza/tree/39.x-dev
 * 6) Usage: Download the Rocky Boot ISO at https://rockylinux.org/download/ and
 * 7) boot your VM with the ISO. Press the Tab key at boot time and edit the boot
 * 8) command line and add the following text:
 * 9)  inst.ks=https://www.mediawiki.org/w/index.php?title=User:Djflux/rocky9-min-vbox-kickstart&action=raw
 * 10) This kickstart file will install a Rocky Linux 9 Workstation environment on
 * 11) any machine. It is specifically designed to install git so that the admin
 * 12) may git clone meza and start a monolith installation on the machine.
 * 13) This file is specifically designed for virtual machines running on
 * 14) VirtualBox virtualization software. During the kickstart pre-installation
 * 15) phase the script will determine the most current stable version of
 * 16) VirtualBox and then prompt the admin to input which version of VirtualBox is
 * 17) hosting this VM. Pressing ENTER at the prompt will default to using the most
 * 18) recent stable version of VB and download and install/compile the VB Guest
 * 19) Additions.
 * 1) phase the script will determine the most current stable version of
 * 2) VirtualBox and then prompt the admin to input which version of VirtualBox is
 * 3) hosting this VM. Pressing ENTER at the prompt will default to using the most
 * 4) recent stable version of VB and download and install/compile the VB Guest
 * 5) Additions.
 * 1) platform x86_64
 * 1) Needed for compiling VirtualBox Guest Additions

%pre iotty=`tty` exec > $iotty 2> $iotty VB_CURR=`curl -s http://download.virtualbox.org/virtualbox/LATEST-STABLE.TXT` echo echo echo -n "Enter your version of VirtualBox (press ENTER for latest version: ${VB_CURR}): " read USER_VB

if [ ! "x"${USER_VB} == "x" ]; then VBOX_VERSION=${USER_VB} else VBOX_VERSION=${VB_CURR} fi

echo -n $VBOX_VERSION > /tmp/vbox_version.txt

cat >> /tmp/vbox_guest.sh << EOF VBOX_VERSION=`cat /tmp/vbox_version.txt`

cd /tmp curl -O http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
 * 1) Change to temp directory and download VboxGuestAdditions

mkdir -p /mnt/vbox mount -o loop,ro VBoxGuestAdditions_$VBOX_VERSION.iso /mnt/vbox sh /mnt/vbox/VBoxLinuxAdditions.run
 * 1) Mount and run iso

umount /mnt/vbox rm /tmp/VBoxGuestAdditions_$VBOX_VERSION.iso EOF
 * 1) Cleanup

%end

%post --nochroot --log=/mnt/sysimage/var/log/ks-post.log cat >> /mnt/sysimage/etc/profile.d/mystuff.sh << EOF alias dir='ls --color -la | more' alias cls=clear alias vi=vim

export PS1="[\u@\h \w]\\\\$ " EOF

cp /tmp/vbox_guest.sh /mnt/sysimage/tmp/vbox_guest.sh chroot /mnt/sysimage /bin/sh /tmp/vbox_guest.sh %end