WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud
  • Tanzu
    • Application Modernization
    • Tanzu services
    • Tanzu Community Edition
    • Tanzu Kubernetes Grid
    • vSphere with Tanzu
  • Home Lab
  • Nested Virtualization
  • Apple
You are here: Home / Automation / How to create custom ESXi boot menu to support multiple Kickstart files?

How to create custom ESXi boot menu to support multiple Kickstart files?

06.11.2015 by William Lam // 27 Comments

I recently received a question from one of my readers who was looking to migrate from ESXi 4.1 to newer version and one of the challenges they faced was around their ESXi scripted installs, better known as ESXi Kickstart. Previously, they had relied on using a custom syslinux boot menu to be able to select a specific Kickstart configuration file that resided locally on a bootable ESXi Image (USB, ISO or CDROM) as a PXE/DHCP environment was not allowed in their environment. There was a small change to how ESXi boot files were reference between ESXi 4.x and ESXi 5.x/6.x and a new boot.cfg configuration is now used which I had written about here with respect to scripted installs when ESXi 5.0 was first released.

Luckily, even with these changes one can still use a custom menu with ESXi 5.x/6.x and be able to select a specific Kickstart configurations based on user input. Here is a screenshot example of a custom ESXi Image that I built providing three different install options that could be selected which would map to three different Kickstart configurations which can be either local to the boot media or can also be retrieved remotely.

bootable-esxi-image-with-multiple-kickstart-option
The first thing you should be aware of if you plan to boot the custom ESXi Image from local media such as USB, CDROM or ISO is that the path to the Kickstart file must be in all UPPER CASE which is mentioned in this VMware KB 1026373. The next caveat that I found in my testing is that if you plan to store the local Kickstart files inside of a directory within the ESXi Image, the name of the directory can not be too long. I would recommend using "ks" as "kickstart" apparently was too long.

After you have extracted the contents of an ESXi ISO which you have downloaded, you will want to create a root directory called "ks" which will contain the different Kickstart configuration files. Here is an example of what structure look like:

ks
├── ks1.cfg
├── ks2.cfg
└── ks3.cfg

Next, you will need to edit the isolinux.cfg file which comes by default within the ESXi ISO. This is where you will add the different Kickstart options that a user will be able to select from. In this first example, we will look at referencing the Kickstart files locally on the media which can be either USB or CDROM and you will need to ensure you specify the right boot option as shown here in the VMware documentation. The path to the Kickstart file needs to be appended to the line that contains boot.cfg reference and you must ensure you include "+++" at the end of that line.

Here is an example of referencing a Kickstart file that lives on a USB device under this path /ks/ks.cfg:

APPEND -c boot.cfg ks=usb:/KS/KS.CFG +++

Here is an example of my isolinux.cfg for the boot menu that I have shown above which provides three different options mapping to three different Kickstart configuration files:

DEFAULT menu.c32
MENU TITLE vGhetto Custom ESXi 6.0 Boot Menu
NOHALT 1
PROMPT 0
TIMEOUT 80
LABEL Ghetto Install
  KERNEL mboot.c32
  APPEND -c boot.cfg ks=cdrom:/KS/KS1.CFG +++
  MENU LABEL ^1 Ghetto Install
LABEL A bit More Ghetto Install
  KERNEL mboot.c32
  APPEND -c boot.cfg ks=cdrom:/KS/KS2.CFG +++
  MENU LABEL ^2 A bit More Ghetto Install
LABEL Super Ghetto ESXi Install
  KERNEL mboot.c32
  APPEND -c boot.cfg ks=cdrom:/KS/KS3.CFG +++
  MENU LABEL ^3 Super Ghetto ESXi Install
LABEL hddboot
  LOCALBOOT 0x80
  MENU LABEL ^Boot from local disk

As I mentioned earlier, the Kickstart configuration file can either be retrieved locally or it can also be retireved remotely using one of the following supported protocols: http, https, ftp & nfs as shown here in the VMware documentation.

Here is an example of isolinux.cfg for a boot menu which references both a local kickstart as well as one that remotely lives on a web server:

DEFAULT menu.c32
MENU TITLE vGhetto Custom ESXi 6.0 Boot Menu
NOHALT 1
PROMPT 0
TIMEOUT 80
LABEL Ghetto Install
  KERNEL mboot.c32
  APPEND -c boot.cfg ks=cdrom:/KS/KS1.CFG +++
  MENU LABEL ^1 Ghetto Install
LABEL A bit More Ghetto Install
  KERNEL mboot.c32
  APPEND -c boot.cfg ks=http://172.30.0.108/ks/ks2.cfg +++
  MENU LABEL ^2 A bit More Ghetto Install
LABEL Super Ghetto ESXi Install
  KERNEL mboot.c32
  APPEND -c boot.cfg ks=http://172.30.0.108/ks/ks3.cfg +++
  MENU LABEL ^3 Super Ghetto ESXi Install
LABEL hddboot
  LOCALBOOT 0x80
  MENU LABEL ^Boot from local disk

For additional ESXi Kickstart resources and example, be sure to check out my pages here.

More from my site

  • How to prompt for user input during an interactive or scripted install of ESXi?
  • How to prevent physical CD-ROM from ejecting after installing or upgrading ESXi?
  • Automated ESXi Installation to USB using Kickstart
  • Revisiting prompting for user input during an interactive or scripted install of ESXi
  • How to Netboot install ESXi onto Apple Mac Hardware?

Categories // Automation, ESXi, vSphere 5.5, vSphere 6.0 Tags // boot.cfg, esxi, esxi 5, esxi 5.5, esxi 6.0, kickstart, ks.cfg, pxelinux

Comments

  1. Scott says

    06/11/2015 at 5:15 pm

    Would it be possible to create an iso and pull the install files from a http server? I want to have one boot iso and just update that to pull the different version of esxi.

    Reply
  2. William Lam says

    06/11/2015 at 5:39 pm

    Yes, this is the exact use case for the second example 🙂 Where the Kickstart file is pulled from a remote host. If you want it to be even more generic which wasn't the point of this blog post, then you can do so by taking a look at the solution here http://www.virtuallyghetto.com/2011/05/semi-interactive-automated-esxi.html

    Reply
  3. Darren says

    06/11/2015 at 7:33 pm

    Hi
    Would it be possible to have an ISO image with kickstart.cfg files which are selected automatically based on the MAC address of the esx host that was to be built. I know it can be done through pxe booting, but I can't use pxe unfortunately.

    Reply
    • William Lam says

      06/11/2015 at 7:38 pm

      Sure! Selecting it isn't the difficult part ... unlike specifying a DHCP Reservation and associating that to a particular MAC Address which has all of that information centralized in the DHCP conf, you would need to ensure you have that mapping as part of the ISO. If you have that, then its merely parsing out the MAC and then calling into a specific set of KS configurations. The way I can see this working is you have a generic KS that runs, but within that you'll have bunch if/else statements that'll execute based on the rules you've setup for the MAC Address

      Reply
  4. JM says

    06/11/2015 at 8:58 pm

    Just making sure you all know about the Ultimate Deployment Appliance 😉 http://www.ultimatedeployment.org/

    Reply
    • William Lam says

      06/11/2015 at 9:07 pm

      I'm well aware 🙂 However, for many customers PXE install is NOT an option and this post is specifically for such customers that require a deployment via USB/CDROM/ISO

      Reply
  5. Arjun says

    06/16/2015 at 7:28 am

    Great Post !

    Reply
  6. Dmitry says

    08/27/2015 at 12:16 am

    William, thanks so much for all your posts on kikstart. They helped quite a lot. But there is one last thing i am strugling and this is exactly this scenario. I have the multi-KS menu (same iso - different environments - no possibility for pixboot ) and providing static IP configuration via appending to the boot option. However, while it boots and applies the network configuration (i can ping the IP once everything loads) it does not download the KS file. Just times out. Here is how the string looks like in ISOLINUX.CFG of the 5.5 install:

    KERNEL mboot.c32
    APPEND -c boot.cfg hostname= ip= netmask= gateway= nameserver= vlanid= netdevice=vmnic5 vmotion= iSCSI1= iSCSI2= ks=http://192.168.10.20/ks/ksi.cfg +++

    The BOOT.CFG is plain like this

    bootstate=0
    title=Loading ESXi installer
    kernel=/tboot.b00
    modules=/b.b00 --- --- /imgpayld.tgz
    build=
    updated=0

    Pretty sure i am missing something simple, yet unable to pinpoint it. Any pointers? Oh, and i have noticed that it tries to download the ks file a few seconds (1-2) before the interface starts to respond to ping. Could it be the process needs to wait for interface? But then i am not sure how to make the download of KS file waitime.

    Reply
    • Dmitry says

      08/28/2015 at 2:51 am

      🙂 Never mind - our Network team is playing on the wrong side and put the firewall ACLs between ESX infrastructure and other hosts... Sometimes it is that simple

      Reply
  7. Tim Ye says

    09/03/2015 at 3:00 am

    great post! i modified the isolinux.cfg under my usb bootable drive, but it went straight into the normal installation page. no custom menu displayed! i was booting from usb thru HP iLo4. the custom menu will show up if i booting my laptop from the usb. i guess kickstart does not work well with HP ILO. do you have experience booting esxi from usb thru HP ILO? maybe something else i need to do?

    Reply
  8. Tim Ye says

    09/03/2015 at 6:09 pm

    i found out the problem is i was using uefi to boot instead of legacy bio. do you know what to do for custom ESXi boot menu under uefi?

    Reply
    • Lolo says

      03/07/2016 at 3:51 am

      Hi I have the same issue to create a bootable USB with ks option on HPO servers using UEFI boot and iLO4.
      Have you resolve this ?
      Do I need to use syslinux instead of isolinux ?
      What's the format and location of the .cfg file ?
      Tks for your help
      And tks for all ths posts..very very helpfull

      Reply
  9. Michael Rebmann says

    02/19/2016 at 12:12 am

    William, nice article! I always used the manual way or Auto Deploy - so, I'm new to scripted installations.
    In my lab I'm trying to get familiar with the syntax and the options and I set up the files according to your article.
    But I always get this error: "cannot find kickstart file on cd-rom with path -- /KS.CFG".

    The boot.cfg is default and this is my isolinux.cfg:
    DEFAULT menu.c32
    MENU TITLE Custom ESXi-6.0.0U1 Boot Menu
    NOHALT 1
    PROMPT 0
    TIMEOUT 80
    LABEL Kickstart1 Installer
    KERNEL mboot.c32
    APPEND -c boot.cfg ks=cdrom:/KS.CFG +++
    MENU LABEL ^1 Kickstart1 Installer

    What am I missing here?

    Reply
    • Michael Rebmann says

      02/19/2016 at 1:29 am

      Make sure your ESXi host hast at least 4GB of RAM... 🙂

      Reply
    • Lolo says

      03/08/2016 at 12:43 am

      Hi
      Did you try this auto deploy on server supoorting the UEFI ? It seems the script will be differents.
      Tks

      Reply
  10. Don says

    05/12/2016 at 11:33 am

    Great process and would love to use it but like others have posted newer HP servers and UEFI is a show stopper. Would be great if you could give us some guidance on if there is a workaround or a fix coming in a up coming release.

    Reply
    • William Lam says

      05/13/2016 at 9:55 am

      I would recommend file an SR with VMware Support for further guidance

      Reply
  11. raj says

    08/05/2016 at 1:17 am

    Hi William Lam,

    I am using windows WDS. trying to install esxi 6 from pxe boot also using kick start ..my vmk0 not comes up.

    Reply
  12. Totie Bash says

    01/04/2018 at 1:51 pm

    Hi William, I can't get to the Custom Boot Menu and it bypasses the isolinux.cfg at all. So I took the the latest ESXi6.iso installer and I ran Rufus to save it to a USB thumbdrive. My isolinux.cfg:
    DEFAULT menu.c32
    MENU TITLE Custom KickStart Boot Menu
    NOHALT 1
    PROMPT 0
    TIMEOUT 80
    LABEL Install ESXi101.lab.local
    KERNEL mboot.c32
    APPEND -c boot.cfg ks=usb:/KS/KS1.CFG +++
    MENU LABEL ^1 Install ESXi101.lab.local
    LABEL Install ESXi102.lab.local
    KERNEL mboot.c32
    APPEND -c boot.cfg ks=ub:/KS/KS2.CFG +++
    MENU LABEL ^2 Install ESXi102.lab.local
    LABEL Install ESXi103.lab.local
    KERNEL mboot.c32
    APPEND -c boot.cfg ks=usb:/KS/KS3.CFG +++
    MENU LABEL ^3 Install ESXi103.lab.local
    LABEL hddboot
    LOCALBOOT 0x80
    MENU LABEL ^Boot from local disk

    Reply
  13. Sagi says

    01/08/2018 at 2:43 am

    "APPEND -c boot.cfg ks=ub:/KS/KS2.CFG +++"
    you missed the s of the usb...

    Reply
  14. Todor JR says

    12/12/2018 at 6:28 am

    Hi I need assistance,

    This is my isolinux.cfg file content I am trying to do kickstart installation with NFS protocol.

    Example 1:

    DEFAULT menu.c32
    MENU TITLE BRAVO Team ESXi 6.0 Boot Menu
    NOHALT 1
    PROMPT 0
    TIMEOUT 80
    LABEL MSV-DELL-CustomISO-ESXi1
    KERNEL mboot.c32
    APPEND -c boot.cfg ks=nfs://1.1.1.1/KickStart/KickStart.cfg bootproto=static netdevice=vmnic10 ip=2.2.2.2 vlanid=2
    MENU LABEL ^1 BRAVO-DELL-CustomISO-ESXi1

    LABEL Bravo-DELL-CustomISO-ESXi2
    KERNEL mboot.c32
    APPEND -c boot.cfg ks=nfs://1.1.1.1/KickStart/KickStart2.cfg bootproto=static netdevice=vmnic10 ip=2.2.2.2 vlanid=116
    MENU LABEL ^2 Bravo-DELL-CustomISO-ESXi2

    LABEL hddboot
    LOCALBOOT 0x80
    MENU LABEL ^Boot from local disk

    Example 2:

    DEFAULT menu.c32
    MENU TITLE BRAVO Team ESXi 6.0 Boot Menu
    NOHALT 1
    PROMPT 0
    TIMEOUT 80
    LABEL MSV-DELL-CustomISO-ESXi1
    KERNEL mboot.c32
    APPEND -c boot.cfg ks=nfs://1.1.1.1/KickStart/KickStart.cfg bootproto=static netdevice=vmnic10 ip=2.2.2.2 vlanid=2 +++
    MENU LABEL ^1 BRAVO-DELL-CustomISO-ESXi1

    LABEL Bravo-DELL-CustomISO-ESXi2
    KERNEL mboot.c32
    APPEND -c boot.cfg ks=nfs://1.1.1.1/KickStart/KickStart2.cfg bootproto=static netdevice=vmnic10 ip=2.2.2.2 vlanid=2 +++
    MENU LABEL ^2 Bravo-DELL-CustomISO-ESXi2

    LABEL hddboot
    LOCALBOOT 0x80
    MENU LABEL ^Boot from local disk

    On both example Image is not able to load at all.

    Reply
  15. Stacey says

    11/12/2019 at 7:02 pm

    I'm a little late to the party on this one. Just wanted to give a heads up. I was using this method to deploy ESXi to 120 nodes. I was running an http server on my laptop. I ran a script to mount the ESXi iso via idrac and the boot once to the VCD-DVD. I had all the ks.cfg scripts for each node on my http server and a menu item for each in my isolinux.cfg. When the ESXi setup attempts to retrieve the ks.cfg from the http server the installer fails. The FYI / takeaway from this is that you can mount the .iso image via http on the idrac, but when it goes to retrieve the ks.cfg via http, it does that over the network and needs DHCP enabled to get a network address. I ended up copying all the ks.cfg to the .iso image and changing my isolinux.cfg from ks=http://xxx.xxx.xxx.xxx/ks.cfg +++ to ks=cdrom:/KS/KS.CFG +++.

    Reply
  16. Przemysław says

    10/27/2020 at 12:51 pm

    Hello
    Any update for menu under BIOS in UEFI mode?
    I'm fighting with no success

    Reply
    • Liron says

      12/07/2021 at 1:55 am

      Hi Przemysław ,

      Have you won the fight? im currently in the middle of the battle with little-to-no hope..

      Reply
    • Don says

      02/02/2022 at 1:59 pm

      Same issue here... any luck on making this work with uefi?

      Reply
      • Jonathan G says

        10/24/2022 at 8:30 am

        Since I couldn't find anyone that had done this either with UEFI and secure boot, I figured it out for me and took some notes for other folks. It would be really neat to see it converted to a more formal post someday.

        https://gist.github.com/jhg03a/7eed0b0f97c91a46b9cf65e22da7ab9f

        Reply
        • Donn Locas says

          10/24/2022 at 9:28 am

          Thanks - we actually got a preliminary ISO of it working with rEFInd. Company's concern is it being 3rd party and whether or not it would be vendor supported. Doesn't seem like there is a built in way of doing it with ESXi and UEFI. Was straight forward when doing it for just BIOS.

          Reply

Thanks for the comment! Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Author

William Lam is a Senior Staff Solution Architect working in the VMware Cloud team within the Cloud Infrastructure Business Group (CIBG) at VMware. He focuses on Cloud Native technologies, Automation, Integration and Operation for the VMware Cloud based Software Defined Datacenters (SDDC)

Connect

  • Email
  • GitHub
  • LinkedIn
  • RSS
  • Twitter
  • Vimeo

Recent

  • Changing the default HTTP(s) Reverse Proxy Ports on ESXi 8.0 03/22/2023
  • Quick Tip - How to download ESXi ISO image for all releases including patch updates? 03/15/2023
  • SSD with multiple NVMe namespaces for VMware Homelab 03/14/2023
  • Is my vSphere Cluster managed by vSphere Lifecycle Manager (vLCM) as a Desired Image or Baseline? 03/10/2023
  • Interesting VMware Homelab Kits for 2023 03/08/2023

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2023

 

Loading Comments...