Unattended installation

While interactive installation is very easy, you need to repeat the same steps for each server to install. If the number of hosts to install increases dramatically, the interactive installation method may not be the most suitable choice. The installation process can be automated using a script to provide an efficient way to deploy multiple hosts.

ESXi supports the use of an installation script to automate the installation process and can be useful if you want to have a consistent configuration for all hosts. Using an installation script, you can quickly deploy multiple instances of ESXi, creating unattended installation routines. These scripts can be saved on a USB flash drive or in a network location accessible through NFS, HTTP, HTTPS, or FTP.

The following table indicates some common boot options for unattended ESXi installation. For a complete list of supported boot options, refer to the vSphere Installation and Setup Guide available on the VMware website:

Table 4.2: Commands supported in the ESXi installation script

A complete list of supported commands to use with installation scripts can be found in the vSphere Installation and Setup Guide you can download from VMware website at the URL https://docs.vmware.com/en/VMware-vSphere/6.5/vsphere-esxi-vcenter-server-65-installation-setup-guide.pdf.

To configure an unattended installation booting from a USB stick, perform the following steps:

  1. Navigate to the installation media and edit the boot.cfg file. Replace kernelopt=runweasel with kernelopt=runweasel ks=usb:/ks.cfg. This allows the system to automatically use the script located on the USB drive. Make sure you use an editor that can handle UNIX encoding.
  2. Create a ks.cfg file in the root directory of the USB device that the installer will use for the unattended installation. Edit the file and create the script. You can use the following simple script as an example:
vmaccepteula
rootpw mypassword
install --firstdisk –overwritevmfs
keyboard English
network --bootproto=dhcp --device=vmnic0
reboot
  1. Save and close the file. Plug in the USB stick and power on the server.
  2. To manually run the installer script when the ESXi installer window appears, press Shift + O to edit boot options. At the runweasel command line, type ks=usb:/ks.cfg. To specify the path to an installation script, you may also use the command ks=http://ip_address/kickstart/ks.cfg, where the IP address refers to the machine where the script resides.
  1. The system will boot from the USB stick and do an unattended installation:

ESXi unattended installation 

The main benefit of using unattended installations for ESXi is not only speeding up the installation process, but also ensuring a consistent configuration of all ESXi hosts.