Automate ESXi installation



When you want to try a newer version, or when you need a specific version for verification, there is a surprising opportunity to install ESXi on a physical server outside of production. Installing ESXi is easy (much more honest than Hyper-V) in itself, but it can be tedious as the number grows. For the purpose of building a production environment, VMware has a function called Auto Deploy that can be used from the Enterprise Plus edition , but it is only used for production purposes, and building the environment such as preparing a DHCP server is a benefit of automation. It is troublesome, and honestly, it is not something to use casually. Another is VMware Cloud Foundation’s SDDC Manager , which is also not suitable for building a verification environment. The reason is that the required non-vSphere products are created as Management / Workload Domain, and the version is fixed (in the first place, vCF is too luxurious for verification).

So, everyone loves William Lam , who introduced an easier and easier way to install ESXi in ” Automated ESXi Installation to USB using Kickstart “, so I immediately tried it.

1. Prepare USB installation media

This time, I used Intel NUC, which everyone loves, for the physical server, and Rufus for creating the installation media .

As a caveat when creating installation media with Rufus, as mentioned in the comment section of the above blog, it works well if the partition configuration is MBR instead of GPT.

2. Edit the BOOT.CFG file

Rewrite kernelopt = cdromBoot runweasel to
kernelopt = ks = usb: /KS.CFG
. This is because the KS.CFG script created later will be used at the time of installation.

bootstate = 0
title = Loading ESXi installer
timeout = 5
prefix =
kernel = / b.b00
kernelopt = ks = usb: /KS.CFG

3. Create a KS.CFG file

Create the KS.CFG file under the root of the USB memory. The following are the minimum settings, and the IP address etc. should be replaced as appropriate. The documentation and are helpful. Below is a sample script customized for me.

install --firstdisk = usb --overwritevmfs --novmfsondisk
--Bootproto = Static Network --Ip = 172.16 . 10 . 21 --Netmask = 255.255 . 255 . 0 --Vlanid = 10 --Gateway = 172.16 . 10 . 254 --Hostname = Esxi- 1. Test . Local - = -Nameserver 172.16 . 10 . 10 --Addvmportgroup = 1
rootpw VMware1!
% firstboot --interpreter = busybox
# enable & start SSH
vim-cmd hostsvc / enable_ssh
vim-cmd hostsvc / start_ssh
# enable & start ESXi Shell
vim-cmd hostsvc / enable_esx_shell
vim-cmd hostsvc / start_esx_shell
#Suppress ESXi Shell warning
esxcli system settings advanced set -o / UserVars / SuppressShellWarning -i 1

4. Installation

Now, just insert the USB memory into the server and turn on the power, and ESXi will start up with the minimum settings completed.

You can see that the script is loaded.


To be honest, there aren’t many parts that can be automated with this method (because ESXi itself is easy to install in the first place). On the other hand, since there is no need to operate the keyboard after starting up, it is great that you do not have to think about anything other than changing the IP address in the script. It’s easy to try, so why not give it a try?