Sample Header Ad - 728x90

Make custom Kali ISO launch into unattended installer immediately

2 votes
0 answers
1203 views
So I built a custom Kali ISO, which is based on Debian 10, with the help of the documentation here: https://www.kali.org/docs/development/dojo-mastering-live-build/ . They use the following repo as a base: https://gitlab.com/kalilinux/build-scripts/live-build-config . I added an option for an unattended/automated install and custom packages through a preseed file, which is working as expected. My goal now is that the ISO should always select my custom option when booting up, so the whole setup will run without any user input when I create a new VM in VMWare. I have tried two approaches: 1. Modify grub.cfg at kali-config/common/bootloaders/grub-pc and remove config.cfg. The contents of my custom grub.cfg were as follows:
# Live Image (UEFI boot)
set default=0
set timeout=1

loadfont $prefix/dejavu-bold-16.pf2
loadfont $prefix/dejavu-bold-14.pf2
loadfont $prefix/unicode.pf2
set gfxmode=auto
insmod all_video
insmod gfxterm
insmod png

source /boot/grub/theme.cfg

terminal_output gfxterm

# Comment these two lines out to disable the beep on boot
insmod play
play 960 440 1 0 4 440 1


menuentry "Unattended Install" {
	linux /install/vmlinuz vga=788 -- quiet file=/cdrom/install/preseed.cfg locale=en_US keymap=de hostname=kali domain=bufu-sec.local
	/install/initrd.gz
}
This did not change anything in the boot menu, it simply fell back to the default boot menu. 2. Modify the files at kali-config/common/includes.binary/isolinux. This worked better, as the boot menu now only showed my custom boot option. I divided my configuration into four files while also placing the splash.png for the background in the same folder: **syslinux.cfg**
PROMPT 0
TIMEOUT 0
NOESCAPE 1
DEFAULT install

INCLUDE menu.cfg
**menu.cfg**
MENU hshift 0
MENU width 82

MENU title Boot menu
INCLUDE stdmenu.cfg
INCLUDE install.cfg
MENU clear
**install.cfg**
LABEL install
    MENU label ^Unattended Install
    LINUX /install/vmlinuz
    INITRD /install/initrd.gz
    APPEND vga=788 -- quiet file=/cdrom/install/preseed.cfg locale=en_US keymap=de hostname=kali domain=bufu-sec.local
**stdmenu.cfg**
MENU background     splash.png
MENU color title        * #FFFFFFFF *
MENU color border       * #00000000 #00000000 none
MENU color sel          * #ffffffff #76a1d0ff *
MENU color hotsel       1;7;37;40 #ffffffff #76a1d0ff *
MENU color tabmsg       * #ffffffff #00000000 *
MENU color help         37;40 #ffdddd00 #00000000 none
MENU vshift 10
MENU hshift 4
MENU width 70
MENU margin 5
MENU rows 10
MENU helpmsgrow 15
# The command line must be at least one line from the bottom.
MENU cmdlinerow 16
MENU timeoutrow 16
MENU tabmsgrow 18
MENU tabmsg Press ENTER to boot or TAB to edit a menu entry
This correctly display only my custom boot option, but still stops at the boot menu dispite me setting PROMPT 0, TIMEOUT 0 and NOESCAPE 1 in syslinux.cfg. An issue I encountered with this version was that if I placed all of the config in syslinux.cfg, it would also default back to the initial boot menu and not show my custom option at all. I have also tried to combine both of the above methods, meaning that I included both configurations and then built the ISO, but also no luck. If anyone wants to try reproducing my error, I have uploaded all of the files to a git repository here: https://github.com/xbufu/custom-kali-iso/ . It also contains the resources and documentation I used to build my config. The command I used to build the ISO was with the inlcuded build script: ./build.sh -v. I hope someone can point out where I went wrong or knows some other approach, I would greately appreciate it.
Asked by xbufu (121 rep)
Sep 10, 2021, 11:14 AM
Last activity: Sep 12, 2021, 09:48 AM