Skip to content

Unattended ESXi Installation from an USB Flash Drive

I was asked if it is possible to create an USB Flash Drive that can install ESXi on a server automatically. ESXi has a Scripted Install feature which allows to put all installation parameters into a Kickstart file to run unattended Installations. This post explains how to create an USB Flash Drive that does unattended ESXi installations. You can plug it into a Server, power it on and ESXi will be installed automatically.

  1. Create a bootable ESXi Installer USB Flash Drive with Rufus (Howto)
  2. Navigate to the Flash Drive and open boot.cfg with an editor. Make sure to use an editor that can handle UNIX encoding (PSPad for example)
    edit-boot.cfg
  3. Replace kernelopt=runweasel with kernelopt=ks=usb:/ks.cfg
    boot-cfg-replace-kernelopts
  4. Create ks.cfg in the root directory of your Flash Drive
    create-esxi-kickstart-file
  5. Open ks.cfg with an editor. Creating complex kickstart is out of scope of this post. The only option you need to know is install. The firstdisk flag will install ESXi to the first device, with the following priority:
    1 - locally attached storage (local)
    2 - network storage (remote)
    3 - usb disks (usb)
    Be careful to not destroy any data! Remove Shared LUNs and do not use this with Servers that contain data.Copy this to your ks.cfg file. This will install ESXi to the first local disk:

    vmaccepteula
    rootpw vmware
    install --firstdisk --overwritevmfs
    network --bootproto=dhcp --device=vmnic0
    reboot

    ks-cfg-content

  6. Save and Close

That's it. You can plug in the USB Flash Drive to a Server, power it on and it will be installed automatically. The password for the root user is set to "vmware".

Do you want to install plenty hosts to SD Cards or USB Flash Drives?
Create the required amount of USB Flash Drives or SD Cards but replace the ks.cfg file with:

vmaccepteula
rootpw vmware
install --firstdisk=usb-storage --overwritevmfs
network --bootproto=dhcp --device=vmnic0
reboot

Plug it in and power the server on. It will boot from the media and do an unattended installation to the installation media. (It uses the first USB device - might be an issue when you have more than one USB storages connected.)

Of course, you can also write an own ks.cfg file to deploy servers with your own customized configuration.

4 thoughts on “Unattended ESXi Installation from an USB Flash Drive”

  1. i followed this post, and tried to boot from usb thru hp iLO interface. it goes to the normal installation, the kickstart file is ignore. Does it works with HP ILO 4?

    1. Haven't tried it with iLO, but it schould not affect the installation.
      What ESXi version are you trying to install? This post was created with ESXi 5.5.

  2. Pingback: HP ZL Compute Blade on the Cheap | tinkeringdadblog

Leave a Reply to Tim Ye Cancel reply

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