Creating a Bootable ESXi USB Stick on Mac OS X

I recently found myself with a decent HP DL385 G2 server with no hard drives (it used to have hard drives, but now it doesn’t…there’s a long story behind it that I won’t get into here). So, I decided I’d try creating a bootable ESXi USB flash drive to use with the server. There are lots of guides out there for creating bootable ESXi USB flash drives, but none of them were written for users, like myself, who use Mac OS X. Telling a Mac user to use WinImage just doesn’t work, and while Linux-oriented guides are closer, they still don’t address any Mac-specific issues.

So, here’s my guide for creating a bootable ESXi USB flash drive from Mac OS X.

  1. Download the ESXi installable ISO.
  2. Double-click the ISO to mount it (an icon will appear on your desktop). From there, navigate the contents of the ISO image to find VMware-VMvisor-big-3.5.0-xxxx.i386.dd.bz2 and copy it out of the ISO image into a separate folder.
  3. Insert the USB flash drive into an available USB port. Mac OS X will mount the drive and an icon will appear on your desktop.
  4. Open the Terminal and type the following command:
     
    diskutil list
     
    On my system, the USB drive was listed as /dev/disk1, but your mileage may vary. It should be pretty easy to tell which device is the USB drive, as the first partition (i.e., /dev/disk1s1) will have a label that matches the name of the icon on the desktop.
  5. Type this command:
     
    diskutil unmountDisk /dev/disk1
     
    Replace /dev/disk1 in the command above with the appropriate entry for your system, as identified in the previous command. The icon for the USB flash drive will disappear from your desktop.
  6. Run this command:
     
    bzcat <path to VMware-VMvisor file> | dd of=/dev/disk1
     
    Replace /dev/disk1 in the command above with the appropriate entry for your system, as identified by the “diskutil list” command in step 4.

When the process completes—you’ll know because the Terminal prompt will return—use this command to “eject” the USB flash drive and make it safe for physical removal:

diskutil eject /dev/disk1

Again, replace /dev/disk1 with the appropriate device for your system.

At this point, the USB flash drive should be ready to roll. Insert it into a compatible server and virtualize away!

In the process of creating this guide, I found the following sites to be extremely helpful:

mechanised.com: How to Create Your Own Bootable ESXi USB Stick
Create ISO on Mac OS X 10.4 | Martin Bergek
Installing VMware ESXi on a USB memory stick using Ubuntu

For Mac users, the special sauce is the “diskutil” command. Unmounting the USB drive from the Finder also made the underlying BSD device, i.e., /dev/disk1, disappear. Without unmounting it in Finder, the device is reported as “busy” and can’t be accessed (even via root). By using diskutil, we are able to make the device accessible.

Tags: , , ,

29 comments

  1. Dave Sobel’s avatar

    Interesting. How big a drive do you need for this?

    Dave

  2. Jason Boche’s avatar

    I don’t know what I’m more impressed with

    * that you figured out and shared your knowledge of making ESXi on USB using a Mac

    -=or=-

    * that you found yourself with a DL385G2. Those things exactly don’t grow on trees. I’ve had my sights on a pair for over a year but no dice yet. DC Opterons I hope (as opposed to SC).

    Either way, congrats!

  3. slowe’s avatar

    Dave,

    I think you can get by with a 1GB flash drive. I only had a 4GB drive available, so that’s what I had to use.

    Jason,

    Well, like I said–there’s a long story behind the DL 385 G2. It was in my lab at work (where I had four of them), and I loaned a couple to another department. One of them they still have, the other they returned to me–without any hard drives. So, using this solution let’s me get something out of this box until I can get my hard drives and my other server back.

  4. Les’s avatar

    i am getting a syntax error near unexpected token ‘|’ at step 6

    can you please help?

    thanks

    Les

  5. slowe’s avatar

    Les,

    You’re not putting the less-than/greater-than symbols around the path to the VMvisor file, are you? And if your path to the VMvisor file has any spaces in it, you’ll need to properly denote that. I found that dragging and dropping the VMvisor file from Finder into the Terminal works best–OS X will then just drop the properly formatted path onto the command line for you to complete.

  6. Les’s avatar

    hehe.. i did :P
    no wonder it gave me that error, thank you

    but now i am stuck with lvmdriver failed to load when i try to boot my installer up on the UMPC.

    static IP keep giving me 0.0.0.0… ?

  7. tango’s avatar

    Just wondering, after the install is completed, do you need to run ESXi off of the USB stick forever? Or will it install to the hard disk?

  8. slowe’s avatar

    You will be running ESXi off the stick. This procedure does not install ESXi to the hard drives.

  9. nick’s avatar

    0+0 records in
    0+0 records out
    0 bytes transferred in 0.886868 secs (0 bytes/sec)

    not working for me. tried several usb sticks. :(

  10. Robert Goodyear’s avatar

    Couple notes for other users here:

    1. 1GB is “right-sized” for ESXi — any more is wasteful, save it for your camera.
    2. If you bend these methods to use a CF card (which I found to be an excellent solution with a little Female IDE-to-CF adapter plugged right into my motherboard, no cable!) then you’ll need to know two VERY important things:
    2a. When the BIOS drops to the VMware console press SHIFT-O to open a Boot Options commandline. Enter “nousbboot” and proceed on with the boot.
    2b. After your ESXi host is configged at the console you’ll then want to enter the host with the VI Client, then edit CONFIGURATION > Advanced Settings > VMkernel.Boot.usbBoot == false.

  11. PeterNem’s avatar

    Really helpful guide – thanks for this!

    Pete.

  12. Joe the System Administrator’s avatar

    Indeed if you attempted to assert this procedure leveraging ESXi Update 4, you might well be flabbergasted to notate that the VMware-VMvisor file is conspicuously in absence!

    If your reaction was like mine (“Good grief darling, there is no love with this procedure!”); do not fret, there is a solution to be foretold!

    All one has to do is extract the VMware-VMvisor file from the install.tgz file, and once such extraction has become occurrent in the absence of anomalous behavior, the pronouncement of the above entitled procedure will ostensibly function absent appreciable complication or issue.

    Moreover, it is instructive that the VMware-VMvisor file when bunzip’ed is about 750MB, thus a thumb drive with a capacity of less than 1GB would not be useful for this exercise.

    Good Luck!

  13. Charles Francis’s avatar

    Scott,
    This may be a dumb question, but have you done or thought about doing an article on people who want to build an ESXi server at home with backups, etc?

  14. Rob’s avatar

    Hey Scott, Do you remember how long this took to complete for the bzcat/dd operation?

  15. slowe’s avatar

    Rob, I’d estimate about 45 minutes or so–much longer than I expected. However, it’s been a while so my memory may be incorrect. Thanks for reading and commenting!

  16. Nigel’s avatar

    Hey Scott – is it possible to load dos to the usb stick and boot to it. I now have 4 hypervisor volumes, and bit confused where to go now.
    Thanks for great post

  17. Casey’s avatar

    Thanks for this…. it was the second time I wanted to do this, and the second time that googling brought me here (after a number of other places that didn’t give me the answer!) This still works with ESXi 4.0.0, but you have to look inside the “image.tgz” file to find the dd.bz2 file you need.

  18. Alex W.’s avatar

    THX M8. I have been banging my head to the wall almost the past hour because I could not make it work. The first time since years of being heavy Mac User I was getting frustrated ! :D

    By the way, what in the whole world are you needing G2s ! for. I already binned 12*380G3, fully equipped ! Yesterday I got 7*380G6 ! (2 CPU, 8*146G 15K SAS, 54G DDR3 10600) MUUUUHHHHAAA HHAAAA HA! Such Sexy devices ;D

  19. Daniel W’s avatar

    Things may have changed since your original post .. but you can boot your Mac off of an ESXi installer CD (Hold Down Option key when turning Mac On). The Installer will let you install directly to a USB stick.

    Also .. if you ever want to burn an ISO to a USB Stick, go into Disk Utility (Applications / Utilities). Click on a disk and go into the restore tab. You have two text boxes. Drag your ISO into the ‘Source’ box. Drag your USB partition into the ‘Destination’ Box. Click ‘Restore’

  20. Ryan’s avatar

    Daniel W,
    I tried this but after loading all the files when it tries to boot I get lvmdriver failed to load and it halts.

    I am now in the process of following the instructions above. Pushing an hour waiting for bzcat to finish.

  21. Tom Rowan’s avatar

    I’ve got this working fine. I used my Mac to ‘dd’ the files on the USB Stick. (see here http://rowanidentity.blogspot.com/2009/07/installing-esx4i-on-usb-memory-stick.html). Great.

    But the problem is that even on a 4GB stick there is no room for the 4GB VFAT scratch partition. That means that the ESXi host will have to use additional memory in lieu of a scratch partition. (I remember a value of 512MB extra?).

    So while it all works fine in a 1GB stick, 8GB or bigger would be optimal. After all an 8GB stick is about £10-£20 depending on quality. As the woman in your life would tell you: Size Matters.

  22. Johan’s avatar

    Would this method also work for creating any bootable Linux USB stick? I want to use my Mac to make a bootable and persistent Ubuntu stick, but the only methods I’ve found, other than this, assume you’re on Windows.

  23. slowe’s avatar

    Johan,

    As far as I know, it should work. I’ve never tried it, but it should work. Good luck!

  24. Tom’s avatar

    Any idea about getting ESXi to work on a Mac? The CD booted on my new Mac Pro, but like another poster above, I’m getting the “failed to load lvmdriver” error. Trying your bzcat/dd to USB flash drive method and I’ll see if that boots. It runs fine in VMWare Fusion, but that kind of defeats the purpose of using ESXi…

  25. Aaron’s avatar

    FYI the VMware-VMvisor-big-3.5.0-xxxx.i386.dd.bz2 file is in the install.tgz file within the ISO.
    Extract it using stuffit and the file is under:
    install/sbin/usr/lib/vmware/installer/

  26. Mike Sims’s avatar

    Has anyone gotten ESXi to actually work on a Mac? And if so, does ESXi on Intel Mac hardware support OSX Guests? Parallels has a bare metal hypervisor that can do this, and my MacPro (late 2008 model) has 24 gigs of ram (at least 15 TB of storage at various levels [eSata, FW800, USB, DROBO Etc.]) and an itch to be the only adult kid in my city to say he can truly run OSX and Windows on the same mac simultaneously AT BARE METAL! (although I guess I give up that coherence nonsense – boo hoo) and it’s BEGGING me to run all guests at a more rudimentary level as I now run OSX Server and Windows 7 under Parallels Desktop and I’m not going to spend $1,000 for a hypervisor just so I can geek out harder than I do now.

    :-)

  27. slowe’s avatar

    Mike Sims, to my knowledge ESXi is not supported on a MacPro. Unfortunately, I don’t have a 24GB MacPro on which to test it. :-(

Comments are now closed.