I am trying to avoid answering user configuration data during a VM installation via virtg-install. Trying kickstart option with the following procedure:
'''HOSTNAME=css_vm1BRIDGE="br-control"ISO_FQN="/root/ubuntu/ubuntu-22.04.4-live-server-amd64.iso,kernel=casper/vmlinuz,initrd=casper/initrd"KS_FILE="/root/ubuntu/ks_merged.cfg"VCPUS=2VM_IMAGE_PATH="/var/lib/libvirt/images/ubuntu-vm1.qcow2"DISK_SIZE=10RAM_SIZE=4096
virt-install
--name "${HOSTNAME}"
--network bridge="${BRIDGE}"
--disk size=${DISK_SIZE},path=${VM_IMAGE_PATH},format=qcow2
--ram "${RAM_SIZE}"
--vcpus "${VCPUS}"
--os-type linux
--os-variant ubuntu22.04
--extra-args="ks=file:/${KS_FILE} console=tty0 console=ttyS0,115200n8 serial"
--graphics=none
--noautoconsole
--debug
--location "${ISO_FQN}"'''
The kickstart file is the one that I generated from ubuntu GUI using kickstart generator amd it looks like the following:
'''
#cat ks_merged.cfg
#Generated by Kickstart Configurator
#platform=x86
#System language
lang en_US
#Language modules to install
langsupport en_US
#System keyboard
keyboard us
#System mouse
mouse
#System timezone
timezone --utc Etc/UTC
#Root password
rootpw --iscrypted $1$pso.SRUz$3CigNdJOEzSlLpr/yjv0m/
#Initial user
user css --fullname "CSS" --iscrypted --password 1$IoisLw0t$biurHVhzlndQWuiPbGi3K1
#Reboot after installation
reboot
#Use text mode install
text
#Install OS instead of upgrade
install
#Use CDROM installation media
cdrom
#System bootloader configuration
bootloader --location=mbr
#Clear the Master Boot Record
zerombr yes
#Partition clearing information
clearpart --all --initlabel
#Disk partitioning information
part swap --size 200 --asprimary
part / --fstype ext4 --size 1 --grow --asprimary
#System authorization infomation
auth --useshadow --enablemd5
#Network information
network --bootproto=static --ip=192.168.10.10 --netmask=255.255.255.248 --gateway=192.168.10.8 --nameserver=192.168.10.14 --device=enp1s0
#Firewall configuration
firewall --disabled
#Do not configure the X Window System
skipx
#Package install information
%packages
@ ubuntu-server
%post --nochroot
apt-get update -y
'''
I still see the questions being asked at the console, as if the file is not being read at all. I don't want to embed the file ISO as it has a hardcoded interface name, somethings in the file might need dynamic change from environment to environment, like interface name, disk name etc. I need this to work to be able to avoid effort in manual configurations of VMs during installation, and would appreciate a quick response.