Below are 2 processes for installing ESXi 4.0 to a USB flash drive. A prior method for ESXi 3.5 would also work with 4.0. It uses WinImage instead of dd as shown below. If you need to embed a custom oem.tgz file into your installation.
Install ESXi to a USB device with DD
To run ESXi from a USB flash drive, you’ll want to get a USB 2.0 certified device that is at least 1 GB in size. It is also recommended that you fully enable USB 2.0 on the system you will use. If you have the option you should also set the USB device to be treated as a fixed hard drive.
1) First, extract the DD image that will be copied to the USB flash drive from the ESXi Installable install CD. You can find that here within the release ISO for 4.0 – image.tgz\image.tgz.temptar\usr\lib\vmware\installer\VMware-VMvisor-big-164009-x86_64.dd.bz2\VMware-VMvisor-big-164009-x86_64.dd.
2) If you’re using Windows, download the dd.exe utility.
3) On Linux run fdisk -l and make a note of the devices on the system. Then insert the USB device and run fdisk again to identify the drive. It’ll be in the form of /dev/sdx. With some Linux distributions, a USB drive will be automatically mounted.
Run the mount command to verify if that is the case and then unmount if necessary as the device can not be mounted for this process. With Windows, you’ll follow the same process, but you’ll run dd.exe –list before and after inserting the USB device. The device will be listed as Harddisk1PartitionX (where X is the device itself).
4) On Linux run the command
dd if=VMware-VMvisor-big-164009-x86_64.dd of=/dev/sdx bs=500MB
(where sdx is the device found in step 3. With a USB 2.0 controller, this process should complete in under 5 minutes. For Windows, you will run
dd.exe if=VMware-VMvisor-big-164009-x86_64.dd of=\\?\Device\Harddisk1\PartitionX bs=1MB --size --progress
5) You can verify that the image was written correctly with md5sum. For Linux run the below commands and the 2 values generated by md5sum should match.
ls -l VMware-VMvisor-big-164009-x86_64.dd
In the output of the ls command, you’ll see the size of the file. Use that in the following command (78643200 is the below example).
dd if=/dev/sdx bs=786432000 count=1 2> /dev/null | md5sum
For Windows run the following commands. You can get md5sum from here and again the output values should match.
dd.exe if=\\?\Device\Harddisk1\PartitionX of=check.dd bs=1MB count=750 --progress
6) Try to boot your ESXi host with the USB device.
Install ESXi to a USB device direct from the install CD.
A new change to ESXi 4.0 is that you can install direct from the install ISO to a USB device. As shown in the image below, the install has recognized the 1 GB USB device attached to the server and was able to install successfully. The BIOS should be set to treat a USB device as a fixed hard disk.
You can also do the same thing with ESXi 3.5 by making a change to TargetFilter.py using the method described here. Instead of changing the IDE interface, in the USBFilter(lun) section you will change
return interface.GetDriver() == 'usb-storage' and interface.GetInterfaceType() == ScsiInterface.SCSI_IFACE_TYPE_PARALLEL
return interface.GetInterfaceType() == ScsiInterface.SCSI_IFACE_TYPE_ISCSI