VMware/Linux/ESXi: Running ESX4i From Bootable USB

I like running ESXi via booting from USB 2.0 memory sticks.  This makes it that much easier for my home lab.  Especially since I mainly use ISCSI VMFS datastores.  Not to mention that “in a pinch”, having ESXi on memory sticks can aide in disaster recovery (DR) scenarios for small businesses.  Of course the requirement here is that the server MUST be able to boot from USB!  Also, get a big memory stick.  Each time an upgrade is performed to ESXi, the version being upgraded from is still stored on the memory stick in case a “roll back” is needed.  At least this is my understanding.  Larger memory sticks are pretty cheap now.  Below outlines the steps to creating a bootable ESX4i memory stick.  The main reason for me writing this up is that the process turns out to be different from ESX3i.

Even though this is being done using Linux, the directory structure and location of data files will be helpful in doing this from Windows.

Below is a link to Yellow Bricks (Duncan Epping) VMware blog.  He goes through the process of creating the USB boot device for Windows.  If you are doing this from Linux, continue on from this section.
http://www.yellow-bricks.com/2009/06/09/vsphere-esxi-on-a-usb-memory-stick/

Create a temporary mount point where the downloaded ESX4i ISO will be placed

root@laptop:~# mkdir /mnt/temp

Next, “mount -o loop” is used to mount the ISO to the /mnt/tmp location.  Using the loop option, it allows us to view and traverse the ISOs structure.

root@laptop:~# mount -o loop /home/user01/Desktop/VMware-VMvisor-Installer-4.0.0-164009.x86_64.iso /mnt/temp

Change into the temp directory and check the contents

root@laptop:~# cd /mnt/temp
root@laptop:/mnt/temp# ls
boot.cat    ienviron.tgz  isolinux.bin  menu.c32    vmkboot.gz
cimstg.tgz  image.tgz     isolinux.cfg  README.txt  vmkernel.gz
cim.vgz     install.tgz   mboot.c32     sys.vgz

For ESX4i, the file that actually contains what we need is image.tgz.  I created the “/root/build/vi4″ subdirectory for building this configuration.  the tgz file is copied there shown below since /mnt/tmp is read only.

root@laptop:/mnt/temp# cp image.tgz /root/build/vi4

Move into the vi4 directory and verify the file was copied

root@laptop:/mnt/temp# cd /root/build/vi4
root@laptop:~/build/vi4# ls
image.tgz

Un-compress and extract the contents of image.tgz into the current directory

root@laptop:~/build/vi4# tar -xzvf image.tgz
usr/
usr/lib/
usr/lib/vmware/
usr/lib/vmware/installer/
usr/lib/vmware/installer/VMware-VMvisor-big-164009-x86_64.dd.bz2

Above lists the directories and files created when the contents were extracted.  So we see that the dd file was listed in the output.

Move into the directory containing the dd file and list the contents

root@laptop:~/build/vi4# cd usr/lib/vmware/installer/
root@laptop:~/build/vi4/usr/lib/vmware/installer# ls
VMware-VMvisor-big-164009-x86_64.dd.bz2

Here, bunzip2 is used to de-compress the VMware-VMvisor-big-164009-x86_64.dd.bz2 file.  This took about 10 minutes on a slow laptop.

root@laptop:~/build/vi4/usr/lib/vmware/installer# bunzip2 -d VMware-VMvisor-big-164009-x86_64.dd.bz2

Now we can see the fully decompressed dd file, which is almost 1 gig in size.

root@laptop:~/build/vi4/usr/lib/vmware/installer# ls -lah
total 901M
drwxr-xr-x 2 201 201 4.0K 2009-05-25 15:16 .
drwxr-xr-x 3 201 201 4.0K 2009-04-30 22:08 ..
-rw-r--r-- 1 201 201 900M 2009-04-30 22:11 VMware-VMvisor-big-164009-x86_64.dd

I already removed all of the partitions from the memory stick being used here.  I used gparted to accomplish this, but fdisk can be used as well.  Once the memory stick to be used is connected, check /var/log/messages to see what device has been assigned to the memory stick.

Here, I already knew that /dev/sdb was assigned to the USB memory stick.  The “dd” command thats standard on Linux is used to identically copy the VMware-VMvisor file to the memory stick.

root@laptop:~/build/vi4/usr/lib/vmware/installer# dd if=VMware-VMvisor-big-164009-x86_64.dd of=/dev/sdb
9-x86_64.dd of=/dev/sdb
1843200+0 records in
1843200+0 records out
943718400 bytes (944 MB) copied, 322.119 s, 2.9 MB/s

Once this was complete, the USB memory stick was ready to go.  I went over to the server, attached it, and ESX4i was immediately booted with no issues.  Configure the management IP and user from the console and you are ready to go! The same process needs to be repeated for each memory stick that needs to be created.  You could just use “dd” to copy the ESXi memory stick to another memory stick, but that would take longer.

Notes: When mounting an ISO in loop mode, you will not be able to write the the directory structure or modify files located there.  It is read only.

Comment or email me if you have any questions. kevin@colovirt.com

~ by Kevin Goodman on June 1, 2009.

7 Responses to “VMware/Linux/ESXi: Running ESX4i From Bootable USB”

  1. a bit easier is ESXi 4.0 just installs to a USB stick and boots…no mods necessary.

  2. a bit easier is ESXi 4.0 just installs to a USB stick and boots…no mods necessary.

  3. Awesome! I will try it. At the time, I had no access to a 64 bit server to boot the ISO. My vmware servers at home have no CDROMs.

  4. windows is much easier for this portion. winimage will do the job.

  5. I don’t have a windows machine at home (I am a Linux engineer). All the tools used are common to most Linux distributions, so most of the time this process can be done natively without software additions. The exception here might be the bunzip utility. I am going to put a link on this blog post referencing a great source for the Windows process.

  6. worked fine on the following:
    Intel S5000PAL
    Micron eUSB (4GB)

    I did try to simply use the installer, but got nowhere (the eUSB was configured in BIOS as a fixed disk).

  7. [...] 2. ESXi4 otse pulgalt bootimiseks. http://blog.colovirt.com/2009/06/01/vmwarelinuxesxi-running-esx4i-from-bootable-usb/ [...]

Leave a Reply