Format a USB Flash Drive to Boot the ESXi Installation or Upgrade

Prerequisites

  • Linux machine with superuser access to it
  • USB flash drive that can be detected by the Linux machine
  • The ESXi ISO image, VMware-VMvisor-Installer-version_numberbuild_number.x86_64.iso, which includes the isolinux.cfg file
  • Syslinux package

1: Create a partition table on the USB flash device

fdisk /dev/sdb

  1. Enter d to delete partitions until they are all deleted.
  2. Enter n to create a primary partition 1 that extends over the entire disk.
  3. Enter t to set the type to an appropriate setting for the FAT32 file system, such as c.
  4. Enter a to set the active flag on partition 1.
  5. Enter p to print the partition table.

    The result should be similar to the following message.

    Disk /dev/sdb: 2004 MB, 2004877312 bytes
    255 heads, 63 sectors/track, 243 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1             1           243      1951866  c   W95 FAT32 (LBA)
    
  6. Enter w to write the partition table and exit the program.

2: Format the USB flash drive with the Fat32 file system

mkfs.vfat -F 32 -n USB /dev/sdb1

3: install Syslinux

wget https://mirrors.edge.kernel.org/pub/linux/utils/boot/syslinux/3.xx/syslinux-3.86.tar.gz

tar -xzvf syslinux-3.86.tar.gz

cd syslinux-3.86

apt install nasm build-essential uuid-dev mtools

make installer

mtools/syslinux /dev/sdb1

cat mbr/mbr.bin > /dev/sdb

4: Create a destination directory and mount the USB flash drive to it.

mkdir /usbdisk
mount /dev/sdb1 /usbdisk

5: Create a destination directory and mount the ESXi installer ISO image to it.

mkdir /esxi_cdrom
mount -o loop VMware-VMvisor-Installer-6.x.x-XXXXXX.x86_64.iso /esxi_cdrom

6: Copy the contents of the ISO image to the USB flash drive.

cp -r /esxi_cdrom/* /usbdisk

7: Rename the isolinux.cfg file to syslinux.cfg

mv /usbdisk/isolinux.cfg /usbdisk/syslinux.cfg
Test with ubuntu 18, ubuntu 20, ESXI 5, ESXI 6.7