Custom UEFI Boot Menu for ESXi 9.0 with rEFInd: One USB Stick, Multiple Kickstart Installs (Lab Only)

Build a rEFInd UEFI boot menu on one USB stick to install several ESXi 9.0 hosts with per-host Kickstart files. Lab technique, not supported.

Short answer: You can put the rEFInd boot manager on a FAT32 USB stick as EFI/BOOT/bootx64.efi, copy the ESXi 9.0 ISO into a subfolder, and add one menuentry per host that loads the ESXi UEFI bootloader with a different ks=usb:/... Kickstart file. One stick then installs many hosts unattended. This is a lab technique described by William Lam. It is not a Broadcom-supported installation method.

When a custom ESXi boot menu helps

A USB stick with one embedded Kickstart file installs exactly one host configuration. For a homelab or a small VCF test bed with three or four hosts, you would otherwise rebuild the stick for each host or set up PXE/HTTP boot. A UEFI boot menu lets you pick the host (and, if you want, the ESXi version) at boot time, with no network dependency.

It only works with UEFI. Broadcom KB 84233 explains that legacy BIOS support is being removed from vSphere and that vSphere 8.0 drops it for new server platforms. If your host still boots in legacy mode, switch it to UEFI first.

USB layout

Path on USBContent
/EFI/BOOT/bootx64.efirefind_x64.efi from the rEFInd package, renamed
/EFI/BOOT/refind.confMenu definition
/esx9/Full contents of the ESXi 9.0 ISO
/kickstart/One Kickstart file per host, file names in UPPERCASE

Step by step

  1. Format the stick with an MBR partition table and a single FAT32 partition. On macOS, for example: diskutil partitionDisk /dev/diskN 1 MBRFormat "MS-DOS" VCF R (check the disk number first, because this erases it).
  2. Create EFI/BOOT, esx9 and kickstart on the stick.
  3. Extract the ESXi 9.0 ISO into esx9/.
  4. Edit esx9/EFI/BOOT/BOOT.CFG (details below).
  5. Download rEFInd from its official site and copy refind_x64.efi to EFI/BOOT/bootx64.efi.
  6. Write EFI/BOOT/refind.conf and copy your Kickstart files to kickstart/.

Why boot.cfg must change

The ESXi boot.cfg on the ISO lists modules with absolute paths such as /jumpstrt.gz, which assume the installer sits at the root of the media. According to the boot.cfg reference, prefix= is prepended only to paths that do not start with /. So you need to do both of these:

  • set prefix=/esx9/
  • remove the leading / from kernel= and from every entry in modules=

Edit only those two things and keep the module list from your own ISO. The result is that the ESXi bootloader, started from /esx9/efi/boot/bootx64.efi, finds its kernel and modules under /esx9/ and not at the root of the stick.

refind.conf

timeout 30
textonly
scanfor manual
showtools shell, reboot

menuentry "ESXi 9.0 - esx01" {
    loader /esx9/efi/boot/bootx64.efi
    options "ks=usb:/kickstart/KS-ESX01.CFG"
}

menuentry "ESXi 9.0 - esx02" {
    loader /esx9/efi/boot/bootx64.efi
    options "ks=usb:/kickstart/KS-ESX02.CFG"
}

scanfor manual tells rEFInd to show only your stanzas and not auto-detected loaders. The syntax is described in the rEFInd configuration docs. The options string is handed to the ESXi UEFI bootloader as boot options, just like options typed after Shift+O at the ESXi boot prompt. To offer several ESXi versions, extract each ISO into its own folder (esx9, esx91, and so on), each with its own prefix, and point extra menu entries at them.

Caveats

  • Unsupported: the vSphere documentation (Create a USB Flash Drive to Store the ESX Installation Script) says not to store the Kickstart file on the same USB flash drive that boots the installer. This setup does exactly that. It works in labs, but for production use a supported method such as a separate USB drive, CD-ROM, or HTTP/PXE Kickstart.
  • Secure Boot: rEFInd’s own documentation covers the Secure Boot options (shim or your own keys). In a lab, the simplest approach is to disable Secure Boot for the install.
  • The original post notes that Kickstart file names must be UPPERCASE for ks=usb: to find them.
  • Make sure the install target in each Kickstart file matches that host’s boot disk. A wrong --firstdisk or --disk value wipes the wrong device.

After installation, the esxcli command reference helps with verifying the host config. The minimal VCF 9.0 lab post shows where multi-host Kickstart pays off.

Further reading

Author: Daniel Micanek

Senior Service Architect, SAP/TDL Platform Services Team at Vivicta | vExpert ⭐⭐⭐⭐⭐⭐⭐ | Broadcom Knight: vSphere Kubernetes Service, VCF Networking (NSX), VCF Automation | Broadcom Software Knight: vSphere | Cisco Champion. Notes from running about 1,000 ESXi hosts on Cisco UCS, VCF 9 and SAP HANA on vSphere.