Automated Install of vSphere ESXi 6.0 from a USB/SD

The time has come for me to rebuild my home LAB and I have decided to start from scratch and build from the ground up. I plan to build it using as much automation and ways of streamlining the process as possible, just as you would want to do in a large scale deployment.

Starting with my main host which is the most powerful with dual 2.5GHz quad core Xeons and 32Gb RAM. I use USB sticks or SD cards in all my servers to host the ESXi operating system as it free’s up the disks for me to wipe as I please.

What you will need:

  1. USB stick, min 4Gb and fast enough for it to work or an equivalent SD/microSD card
  2. A copy of UNetbootin, availble from http://unetbootin.github.io/
  3. The ISO of ESXi which you will be using. As I have HP servers I use the HP customised image which has all the relevant drivers for storage controllers etc.

Step 1 – Prepare the USB

It is a good idea to format the USB stick before you use put the boot image on it. If you have previously used it as a boot device it will likely have numerous partitions on. The easiest way to remove them all in Windows is to open a command prompt as admin and use DiskPart to clean the drive.

Extreme caution should be excercised here, you have the potential to destroy data. Ensure that the selected disk is the USB drive and not one of your data drives. The easiest way to see this quickly is from the size of the disk.

DiskPart Clean

Step 2 – Install the boot files to the USB

Run UNetbootin, select the Diskimage option and browse to the ESXi ISO image. Select the USB drive which you wish to use and click OK. Click Exit once finished, no need to reboot.


UNetbootin ESXi 6.0(2)
UNetbootin ESXi 6.0(3)

  Step 3 – Modify the SYSLINUX.CFG file

This step updates the syslinux.cfg file created by Unetbootin

Find SYSLINUX.CFG and locate the following line:

default menu.c32

Modify this line to:

default ks

Then add a new section to the file which matches below.

LABEL ks
KERNEL mboot.c32
APPEND -c boot.cfg ks=usb:/ks.cfg
MENU LABEL Super Ghetto Install

Step 4 – Create a KickStart file

The final step is to create the kickstart file specifying the options you wish to automate. The following basic settings will accept the EULA, set the password and install the ESXi OS onto the USB drive which you used to boot from. The network settings will also be set to a static address.

vmaccepteula
rootpw VMw4r3!
install --firstdisk=usb-storage --overwritevmfs
keyboard 'United Kingdom'
network --bootproto=static --device=vmnic0 --ip=192.168.1.100 --netmask=255.255.255.0 --gateway=192.168.1.254 --nameserver=192.168.1.254 --hostname=ESX_6.0_01
reboot

A great starting point for kickstart settings is http://kb.vmware.com/kb/2004582.

Step 5 – Boot from USB

Now that everything is ready and you have put the updated files on the USB stick you can transfer this into your ESXi host and boot from it. The installer loads everything into memory first which is why it can happily install to itself.

 

Leave a Reply

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