Create ESXi Custom ISO

Create ESXi Custom ISO

If you are looking for a custom ISO creation process for your own automation purposes, follow the below steps.

You would need the following applications for this process

  • Powershell
  • mkisofs
  • VMware ESXi official ISO

There are following high-level steps to accomplish this requirement

  • Prepare the environment by installing the required application and downloading ISO
  • Prepare the Kickstart file
  • Extract the ISO file to the folder
  • Copy the Kickstart file to the root folder in the extract
  • Modify BOOT.CFG file
  • Create ISO from extract using mkisofs

Please refer details steps as below

Download mkisofs

Mkisofs is not easily available over the internet, you can use the following steps to download the mkisofs.

  • Download the latest cdrtfe tools zip file from https://sourceforge.net/projects/cdrtfe/files/cdrtfe/
  • Create a new folder called mkisofs_app in any of your preferred location
  • Extract ZIP file
  • Copy mkisofs.exe to folder mkisofs_app from exacted files, you can locate this file in folder \tools\cdrtools\
  • There are dependencies which you would need to copy as well so that tool will work.
  • Copy mkisofs.exe to folder mkisofs_app from exacted files, you can locate this file in folder \tools\cdrtools\
  • Copy cygwin.ini and cygwin1.dll to folder mkisofs_app from exacted files, you can locate this file in folder \tools\cygwin\
  • Now, we can use mkisofs tool for creating ISO
  • You can verify the tool by checking version of mkisofs tool
  • Open command prompt and navigate mkisofs_app folder
  • Run command mkisofs.exe –version
  • It will return something like “mkisofs 3.02a10 2021/07/23 (i686-pc-cygwin)” (Note, it will vary based on downloaded version)

Once we have mkisofs tool in place, we can proceed with the customization of ESXi

Prepare the Kickstart file

You can create a KS file based on your requirements as its very infra to infra. VMware has very good documentation for KS file parameters which you can refer – https://docs.vmware.com/en/VMware-vSphere/8.0/vsphere-esxi-installation/GUID-51BD0186-50BF-4D0D-8410-79F165918B16.html#GUID-61A14EBB-5CF3-43EE-87EF-DB8EC6D83698

I have created the following sample Kickstart file and saved it as KS.CFG, which you can refer to, and do not forget to replace the values in $$. For example, you can replace “$esxipass$” with an exact encrypted password. If you don’t want to use an encrypted password, you can use the parameter rootpw with a plain password, e.g. rootpw VMware123!

You can generate the encrypted password using the following command

Sample Kickstart File for ESXi Installation and Configuration

Extract the ISO file to the folder

Extract the ISO file and put it in the folder, as this is required to modify the BOOT.CFG file. You can extract the ISO using 7ZIP or any other tool. 7ZIP has command-line support as well. In this case, we are extracting the ISO to folder C:\Temp\ESXi8.0

7ZIP

Copy the Kickstart file to the root folder

Copy KS.CFG file into the folder where we extract the ISO files. In this case, the folder path is “C:\Temp\ESXi8.0”

Modify BOOT.CFG file

Modify the BOOT.CFG file, to pick the kickstart file. Note, there are two BOOT.CFG files we would need to modify.

  1. Root folder BOOT.CFG
  2. EFI\BOOT\BOOT.CFG

There are the following changes, we have to update in both BOOT.CFG file.

Current

kernelopt=runweasel cdromBoot

Desired Change

kernelopt=runweasel ks=cdrom:/KS.CFG

Create ISO from extract using mkisofs

Now, it’s time to create ISO from extract. There are multiple tools available for it, but we using mkisofs in this scenario.

Please update the command with your respective file and folder path.

Once, ISO is created you can install the ESXi with custom parameters. This way you can create custom ESXi ISO and deploy ESXi with custom parameters. All these tasks can be automated using C# or Python or PowerShell. Note, we would need space as automation will create one ISO for each server but ISO can be deleted after the installation.

Leave a Reply

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