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.
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.
Scott says
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.
William Lam says
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
Darren says
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.
William Lam says
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
JM says
Just making sure you all know about the Ultimate Deployment Appliance 😉 http://www.ultimatedeployment.org/
William Lam says
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
Arjun says
Great Post !
Dmitry says
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.
Dmitry says
🙂 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
Tim Ye says
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?
Tim Ye says
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?
Lolo says
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
Michael Rebmann says
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?
Michael Rebmann says
Make sure your ESXi host hast at least 4GB of RAM... 🙂
Lolo says
Hi
Did you try this auto deploy on server supoorting the UEFI ? It seems the script will be differents.
Tks
Don says
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.
William Lam says
I would recommend file an SR with VMware Support for further guidance
raj says
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.
Totie Bash says
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
Sagi says
"APPEND -c boot.cfg ks=ub:/KS/KS2.CFG +++"
you missed the s of the usb...
Todor JR says
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.
Stacey says
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 +++.
Przemysław says
Hello
Any update for menu under BIOS in UEFI mode?
I'm fighting with no success
Liron says
Hi Przemysław ,
Have you won the fight? im currently in the middle of the battle with little-to-no hope..
Don says
Same issue here... any luck on making this work with uefi?
Jonathan G says
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
Donn Locas says
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.
Donn Locas says
Any chance you have the steps required to make this work using UEFI under ESXi7 and/or 8? We have used a similiar setup to the above using Legacy BIOS. However Legacy BIOS will be deprecated in 8x.
JT says
Any updates in and around using this with UEFI under ESXi8?
Also, any updates to address the shortfalls of %firstboot with secure boot enabled?
William Lam says
No
Andrea says
It's fundamentally incompatible. Firstboot works by leaving specific code around on disk for after the reboot. Secure boot on the other hand only permits execution of code that was part of the signed code of the installer. Even if that Firstboot code persisted the reboot, it couldn't run it. It's a bit of a sad thing, but necessary. vSphere at this point with secure boot on basically requires running only code at partner supportive and above. Even if you roll your own vibs at community supported, that's incompatible with secure boot as of 8.