Creating USB key to install VMware ESXi 4.1

Many servers don’t have DVD drives nor CD drives, so installing ESXi 4.1 with a CD is not optimal.  Sure you could always buy a USB DVD drive, but why not try to be cool and do it with a USB stick instead?  I’m actually a bigger fan of doing things through PXE.  Network installs are the ideal way to manage datacenters.  However, sometimes, if you’re a rovering IT guy like me going from site to site, you can’t always do network installs.  There are an amazing amount of IT shops that I have run into that shun the idea of network installs.  So, for those still in the dark ages, or for those who are on the road a lot, here is how we do it with a USB stick in 10 easy steps.

1.  Get the VMware ESXi 4.1 ISO image from VMware.com.

2.  Open the image.  On my mac, I just click on the image and it opens it for me.  On Linux you could do a loop back mount:

If you have Windows, I’m sure you can use your favorite search engine to find a way to do it, but the rest of this tutorial is in Linux.

4.  Now get a USB stick.  You need to partition a large enough windows 95 image and make it bootable.  I do this through fdisk:

5.  Now you need to format it:

6.  Now we need to use syslinux and make it bootable.  I do this on Linux like this:

7.  Mount the USB stick and copy all the files to it:

8.  Now you have to get rid of the isolinux stuff:

9.  At this point you should be able to umount the USB drive and stick it in a server and boot from it and start the installer.  The problem is (in my opinion) is that the Installer is hard coded to look for the CDROM.  So you will error out saying that it can’t find the installation media.  This is pretty lame.  But that’s ok  because I want to automate this anyway.  So the answer is we make a kickstart file that can tell it where to go.  So let’s edit the syslinux.cfg and add a kickstart file.  We add these files to /media/USB where our USB is mounted.

The modified syslinux.cfg file:

Here we simply add the ks=usb argument.  This tells it to use kickstart and that the kickstart file is found on the USB drive.

The Kickstart file (ks.cfg)

My simple kickstart file (ks.cfg) just looks like this:

10.  There, now you’re done.  Unmount the USB key, Put it in the server and it will install ESXi4.1 from the USB key without any prompting.  Fun in 10 easy steps!

Comments are closed.