Build a custom automated ESXi installer image

Build a custom automated ESXi installer image

by Matt Bradford

If you’re like me, you’ve probably performed more manual ESXi installs than you care to admit. It’s not just the installation of the hypervisor, but the installation of the drivers and other bundles that can easily eat into your busy day. Not to mention if you try to image many hosts at the same time there’s a good likelihood that you’ll miss something that will come back and haunt you later.

One of the benefits of working with a great vendor is that they’re usually willing to ship your hosts pre-imaged and built to your spec. In order to make my vendor’s lives easier I wanted an ISO that would install ESXi to our spec without intervention. I needed to build a custom automated ESXi installer image. It may sound complicated but it’s pretty simple and the best thing is it doesn’t take long. Your first time may take 30 minutes, but once you have everything together you will be able to create the ISO in about five. Here’s how you do it…

Download the ESXi Offline Bundle. You can use the generic or vendor provided image.



Download the driver and other offline bundles you want to pack into your image. Copy everything to a folder. (Note that offline bundles may be inside the zip file you download.)



Open PowerCLI and add the ESXi offline bundle.




Add the driver offline bundles.



We need to get the name of the image by entering…

Get-EsxImageProfile | Select Name

In this case our image name is HPE-ESXi-5.5.0-Update3-550.


We’ll take the name of the profile from the previous step and create a new image with it.

New-EsxImageProfile -CloneProfile HPE-ESXi-5.5.0-Update3-550. -Name ESXi-5.5-VMSpot-Customized

By default the acceptance level will be Partner Supported. More info available here.


Export the image to an ISO by typing…

Export-EsxImageProfile -ImageProfile ESXi-5.5-VMSpot-Customized -ExportToIso -Filepath .ESXi-5.5.0.VMSpot.iso


Launch WinISO and open the ISO.


Create a file called KS_CUST.CFG and add the following…

# Accept the VMware End User License Agreement
# Set the root password for the DCUI
rootpw VMwareR0cks!
# The install media is in the CD-ROM drive
installorupgrade --firstdisk --overwritevmfs
# Set the network to DHCP on the first network adapter
network --bootproto=dhcp --device=vmnic0
# reboots the host after the scripted installation is completed


Copy BOOT.CFG from the ISO and change the kernelopt line as such…

kernelopt=runweasel ks=cdrom:/KS_CUST.CFG


Add the KS_CUST.CFG file to the root of the ISO and overwrite BOOT.CFG. Save the ISO.


Mount the ISO to your host and boot.


The installation process will now run without any manual intervention.




It’s okay to ignore the DHCP warning. It will clear automatically after a few seconds.



The installation is finished! The host will now reboot automatically!


(Courtesy of VMSpot)

VMware Social Media Advocacy

Leave a Reply

Your email address will not be published. Required fields are marked *