Kickstart with virt-install for Rocky 9

So I think I’ve solved this. I think part of my problem was pointing specifically to 9.0 (and not “9”) and using the wrong repo mirror entry.

So this is how the install is kicked off

virt-install --noreboot -n test9 -r 3073 '--vcpus=1' '--os-variant=rhel7.0' --accelerate -v '--network=bridge=br-lan,target=v-test9' --disk path=/dev/Raid68/vm.test9 -l https://dl.rockylinux.org/pub/rocky/9/BaseOS/x86_64/kickstart/ --nographics -x 'inst.ks=http://10.0.0.137/CentOS/kickstart/rocky9.cfg ksdevice=ens2 ip=dhcp console=ttyS0,9600'

The LV it points to is 10Gb in size (which is smaller than the docs says is needed, but it seems to work). The bridge is for my LAN.

After that completes, I then do a couple of virsh commands to reduce memory (down to 512Mb; Rocky 9 runs in that easily, it just won’t install in it), then restart.

Afterwards:

$ free -h
               total        used        free      shared  buff/cache   available
Mem:           453Mi        72Mi       262Mi       2.0Mi       132Mi       380Mi
Swap:          1.0Gi          0B       1.0Gi

$ sudo fdisk -l
Disk /dev/vda: 10 GiB, 10737418240 bytes, 20971520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x2b9be1ea

Device     Boot   Start      End  Sectors Size Id Type
/dev/vda1  *       2048  2099199  2097152   1G 83 Linux
/dev/vda2       2099200  4196351  2097152   1G 82 Linux swap / Solaris
/dev/vda3       4196352 20971519 16775168   8G 83 Linux

$ df -h /
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda3       7.8G  957M  6.5G  13% /

And the complete kickstart file. It doesn’t look like I can do a mirrorlist in the url line, so have to hard-code a server.

text
url --url https://dl.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os
# url --mirrorlist https://mirrors.rockylinux.org/mirrorlist?repo=BaseOS-9&arch=x86_64
repo --name=AppStream --mirrorlist https://mirrors.rockylinux.org/mirrorlist?repo=AppStream-9&arch=x86_64

poweroff

lang en_US.UTF-8
keyboard us

network --onboot yes --device eth0 --bootproto dhcp --ipv6 auto

rootpw  --iscrypted Wouldntyouwanttoknow

firewall --disabled
selinux --disabled

timezone --utc America/New_York

zerombr
clearpart --all --initlabel
part /boot --fstype=ext4 --asprimary --size=1024
part swap --asprimary --size=1024
part / --fstype=ext4 --asprimary --grow --size=1

%packages
@^minimal-environment
wget
ksh
dos2unix
logwatch
tar
postfix
bind-utils
bc
-iw*-firmware
%end

%addon com_redhat_kdump --disable --reserve-mb='auto'
%end
1 Like