I want to write a bash script that creates a Scientific Linux 7.2 iso with a custom kickstart file, creates a new VirtualBox VM, and installs the iso onto that VM.I have two scripts, installBaseOS.sh and createKSISO.sh.  Here are both:installBaseOS.sh:#!/bin/shset -e../src/sh/createKSISO.shVM='testVM'ISO=test/boot.isoVBoxManage createhd --filename=test/$VM.vdi --size=16000 >> test/install.log 2>&1VBoxManage createvm --name=$VM --ostype=Linux_64 --register >> test/install.log 2>&1VBoxManage storagectl $VM --name SATA Controller --add sata --controller IntelAHCIVBoxManage storageattach $VM --storagectl SATA Controller --port 0 --device 0 --type hdd --medium test/$VM.vdiVBoxManage storagectl $VM --name IDE Controller --add ideVBoxManage storageattach $VM --storagectl IDE Controller --port 0 --device 0 --type dvddrive --medium $ISOVBoxManage modifyvm $VM --ioapic onVBoxManage modifyvm $VM --boot1 dvd --boot2 disk --boot3 none --boot4 noneVBoxManage modifyvm $VM --memory 1024 --vram 128VBoxManage modifyvm $VM --nic1 bridged --bridgeadapter1 wlo1VBoxHeadless -s $VM >> test/install.log 2>&1 and createKSISO.sh:#!/bin/shmkdir test/bootisosudo mount -o loop ../bin/SL-72.iso test/bootisomkdir test/bootisokscp -r test/bootiso/* test/bootisoks/sudo umount test/bootiso && rmdir test/bootisochmod -R u+w test/bootisokscp ../src/cfg/ks.cfg test/bootisoks/isolinuxsed -i 's/append\ initrd\=initrd0.img/append initrd=initrd0.img\ ks\=cdrom:\/ks.cfg/' test/bootisoks/isolinux/isolinux.cfgcd test/bootisoks && mkisofs -o ../boot.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -r -J -v -T isolinux/. .cd ../..rm -r test/bootisoksAnd finally my kickstart file ks.cfg:auth --enableshadow --enablemd5installreboot --ejecteula --agreedcmdlineignoredisk --only-use=sdakeyboard --vckeymap=us --xlayouts='us'lang en_US.UTF-8logging --level=debugrootpw testpasstimezone US/New_Yorkbootloader --location=mbr --boot-drive=sdaclearpart --all --initlabelpart pv.0 --size=1 --growvolgroup rootvg01 pv.0logvol / --fstype=ext4 --name=lv01 --vgname=rootvg01 --size=1 --growservices --enable=NetworkManager,sshd%packages@base@core%endIf I comment out the sed command in createKSISO.cfg so that the boot process isn't looking for a kickstart file, the VM boots up into the live CD without issue, so I am fairly certain that I am creating the ISO correctly (mostly).What happens if I add the ks=/ks.cfg to the boot is I get 3 lines on the boot log:[ OK ] Started Show Plymouth Boot Screen.[ OK ] Reached target Paths.[ OK ] Reached target Basic System.Then it hangs for a couple minutes before I start getting dracut-initqueue timeout warnings.  After those I get to a dracut console and it tells me to look at /run/initramfs/rdsosreport.txt.  I don't have any way to get that file off the VM, and it is several hundred lines long, but I have copied the few lines directly before the start of the dracut-initqueue warnings appear:localhost kernel: sda: unknown partition tablelocalhost kernel: sd 0:0:0:0: [sda] Attached SCSI disklocalhost systemd[1]: Received SIGRTMIN+20 from PID 357 (plymouthd)That last SIGRTMIN appears 4 times over about 3 seconds, then the timeout warnings appear about 1.5 minutes later.I think my problem is caused by either a bad kickstart file, or the file isn't being found properly.  I have tried a number of example RHEL 7 kickstart files from the web to try to figure out if it is the first issue, but haven't had any luck.  What I would like to know is either the next step to debug why the kickstart of the VM fails, or what my issue is.  Once I have something working I plan on editing the kickstart file to end up with the system I actually want, but I have to get something working first.
Kickstart file in virtualbox failing to boot
scientific linux;kickstart
It turned out to be a rather simple (stupid) mistake.  Inside the isolinux.cfg file, on the same line modified by the sed command in createKSISO.sh, there is a key/value pair root=live:CDLABEL=SL-72-x86_64-LiveCD.  In about half of the tutorials I found online on creating a kickstarted ISO, the mkisofs command included the options -V Your CD Name Here or something similar, with no explanation as to the importance of this option.  I didn't care what my CD was called since it was temporary, so I ignored this.However, for the created ISO to be bootable, the root label and the CD name must match.  If not the isolinux boot cannot find the OS to boot from the live CD.  The quick fix for this was I simply provided the name already in the isolinux.cfg to the -V option in my createKSISO script.  A more appropriate answer would be to make a custom name, then use sed to replace it in the isolinux.cfg.Changing this, the newly created ISO boots, and the modifications made elsewhere in the scripts are seen in the file system.