Creating USB based boot media for ESX 4 installs

As a follow on to my Automating vSphere ESX4 Host Installations blog I have detailed a howto create USB based boot media using syslinux 3.82 and the ESX 4 installation source files. The process is actually quite simple as we can create the bootable USB from a Windows system.  You can also do the same with extlinux but most people will have a Windows based management system so lets only focus on this Windows based method within this blog.

The first step is to ofcourse obtain a copy of the Syslinux 3.82 or higher zip package from  http://syslinux.zytor.com/ and extract to a  file store of your choice.

Prepare the media:

To prepare a USB memory stick we need to format it with a FAT32 file system. Windows explorer provides that functionallity with a simple right click on your USB device.

Format USB device

Generate a bootable media device:

Once formated we will need to open a cmd prompt and go to our syslinux file store and execute the following example.

Syslinux cmd prompt

In this example the syslinux win32 tool creates a grub based loader and boot sector on the USB memory device mapped to drive G: the tool also defines the syslinux directory using the -d option as the root path and this is where we will copy the ESX 4 initial ramdisk image file and some additional syslinux text menu files.  If your planning to use the usb device as a source for the ESX 4 packages then those files  e.g. the VMware directory etc. would need to be placed in the root directory of the usb device and not the syslinux directory. In this blog the usb device is only used to launch a remote source file install.

Copy menu and ESX 4 install files:

From the ESX 4 ISO or CD copy the isolinux directory to G: and rename it to syslinux also copy the build_numbler file to G:  additionally explore the downloaded syslinux file store and locate ..syslinuxcom32menumenu.c32, copy this file to the G:syslinux location, you may also want to copy vesamenu.c32 if you wish to checkout a GUI based menu. That’s really just eye candy on the requirements side but it can provide some cool background display capabilities.

Create your selectable boot time menu:

Now we are ready to create the syslinux.cfg configuration file in the syslinux directory.  Here is an example I created for this blog.

default menu.c32
prompt 0
timeout 9000
menu title ESX 4 Automated Install VC1 HTTP Repo

label Default
kernel vmlinuz
append initrd=initrd.img vmkopts=debugLogToSerial:1 mem=512M quiet ks=http://vc1.laspina.ca:8088/esx/4.0/default.cfg

label vh0
kernel vmlinuz
append initrd=initrd.img vmkopts=debugLogToSerial:1 mem=512M quiet ks=http://vc1.laspina.ca:8088/esx/4.0/vh0.cfg

label vh1
kernel vmlinuz
append initrd=initrd.img vmkopts=debugLogToSerial:1 mem=512M quiet ks=http://vc1.laspina.ca:8088/esx/4.0/vh1.cfg

Once your cfg file is created your ready to boot the USB device either on your server or over RDAC/ILOM interfaces,  select a server target from the menu and walk away.

Yes it’s that simple and easy to create USB bootable media for your ESX 4 installs.

Regards,

Mike





Tags: , , , , , ,

Site Contents: © 2009  Mike La Spina

76 Comments

  • ian says:

    what in the isolinux folder because its a 100% copy of the esx iso straight to my usb drive using unebootin

  • ian says:

    right my screen when i get the error is:

    Booting ‘VMware ESX 4.0’
    root (hd0,0)
    Filesystem type is ext2fs, partition type 0x03
    uppermem 307200
    kernal /vmlinuz ro root=blablabla mem=300M quiet
    [Linux-bzimage, setup=0x1e00, size=0x170d9c]
    initrd /initrd.img

    error 15: file not found
    press aby key to continue

    so to me its saying initrd.img is not found and it is ther in the isolinux folder

  • Ian,
    Try using an absolute path, e.g. /syslinux/unitrd.img

  • ian says:

    I did to no avail
    currently trying another way will let you know it used syslinux.exe -ma i:
    instead of -d will let you know

  • Ian,

    This is not correct.

    default menu.c32 <- This directs the default menu item. It should be pointing to the menu label value e.g. default Default prompt 0 timeout 9000 menu title ESX 4 Automated Install VC1 HTTP Repo label Default kernel vmlinuz

  • ian says:

    sorry mike what do you mean I am a noob cant you tell lol

  • Change default menu.32 to default Default

  • ian says:

    i managed to do it I used a usb cdrom and the dvd worked perfectly

  • Devil.Sunny says:

    Hi,

    I am facing the same issue as IAN mention above.


    initrd /initrd.img

    error 15: file not found

    Please make a correction in your post so we can install ESX4/ESX4i from USB Disk.

  • Devil.Sunny says:

    Hi,

    I am facing same issue “file not found error 15 initrd.img” as IAN mention above, please check and re-post the USB ESX4/ESX4i media creation on the bases of “Unebootin”.

  • Devil,
    Please post your cfg file and the path where your initrd.img file resides.

  • DeeSaR says:

    Hi, thanks for your tutorial, but to do the complete install from USB-Key (no kickstart) the word “askmedia” has to be appended to the syslinux.cfg line… example:
    “append initrd=initrd.img vmkopts=debugLogToSerial:1 mem=512M quiet askmedia” if you do not, the Install will fail (searches for cd-rom installation media). Second, you will have to copy the full dvd Content to the USB-Key, otherwise the media will not be recognized.

  • Thanks for your comment,

    Yes you need the askmedia append statement if your not using a ks.cfg, it’s also discussed in some prior comments along with the need to place the install image on the root of the usb store.

    Regards,

    Mike

  • Camels says:

    Hi,

    Great guide thank you!! I’m having issues right at the end of hte installation, im getting an error message – no such file or directory /mnt/sysimage/boot/initrd.img

    When i break into console I can actually navigate to that area and the file is there..

    Can anyone shed some light on this please 🙂

    Camels

  • Camels says:

    I fixed my previous issue by downloading the ESX 4 update 1 ISO and copying those files onto the USB

  • Marin says:

    I can’t find isolinux directory from the VMware-VMvisor-Installer-4.0.0.Update01-208167.x86_64.iso file (latest distribution from VMware), and of course there is no initrd file?

  • Marin,

    The file you have specified is an ESXi image and will not have the same layout, it’s isolinux boot entries are in the root directory.
    You can create a boot but cannot use the automated the host configuration with the ESX install script methods.

  • Nathan says:

    I got the USB key to boot, but it kept asking for me to install the cdrom and would fail after thin initrd.img booted. I could hit f2 and get a prompt and mount the usb drive. I tried ‘askmedia’ but then all it does is say..insert CDROM and keep asking for the CD.

    I still use a ks.cfg file from a web server so my syslinux.cfg looks like this:
    default esx
    prompt 1
    #menu title ESX build 208167
    timeout 300

    LABEL esx
    menu label ESX Scripted Install using ks.cfg
    kernel vmlinuz
    append initrd=initrd.img vmkopts=debugLogToSerial:1 mem=512M ks=http://server/ks.cfg askmedia

  • Hi Nathan,

    Where is your ESX code repository. On the usb or on the http server?

    If it is on the USB’s root then make sure your ks.cfg files contains a line with

    install usb

    Also be sure to copy the ESX DVD to the root of the USB stick.

    Regards,

    Mike

  • Akiraa says:

    For EXSi 4:
    I deleted the isolinux.bin, renamed isolinux.cfg to syslinux.cfg, edited syslinux.cfg and added the keyword ‘usb’ at the end of the ‘append’ command

  • Perry says:

    Do you need to copy the ESX 4.x “Vmware” folder contents to the root of the USB key, or just copy the folder to the root? Can somebody post an example of the syslinux.cfg assuming that all of the ESX install files are copied to the USB key?

  • Hi,
    The folder structure needs to match what the iso looks like. The problem most people encounter is the ks location issue. Since syslinux loads a ram image, the visibility of the ks files is constrainted to the access context of the ram image at the time of load. The ram image can access the USB but it is instructed to do so by setting the install media from the ks file as “install usb”. Thus if the ks file is not part of the initrd img file you must define it over one of the available “ks=” methods of the image loads append statement of the syslinux.cfg file.

    Mike

  • Rob Smith says:

    Hi

    Thanks to everyone for the above help. Just to add in my experience I used the following in my syslinux.cfg file and I was able to install Vmware ESX 4.0 from a USB key.

    default esx
    prompt 1
    #menu title ESX build 164009
    timeout 300

    LABEL esx
    menu default
    menu label Install ESX in graphical mode
    kernel vmlinuz
    append initrd=initrd.img vmkopts=debugLogToSerial:1 mem=512M quiet askmedia

    LABEL esx-text
    menu label Install ESX in text mode
    kernel vmlinuz
    append initrd=initrd.img vmkopts=debugLogToSerial:1 mem=512M ks=usb text quiet askmedia

    LABEL usb-ks
    menu label ESX Scripted Install using USB ks.cfg
    kernel vmlinuz
    append initrd=initrd.img vmkopts=debugLogToSerial:1 mem=512M ks=usb quiet askmedia

    LABEL first-disk-safe
    menu label ESX Scripted Install to first disk
    kernel vmlinuz
    append initrd=initrd.img vmkopts=debugLogToSerial:1 mem=512M ks=file:///usr/lib/vmware/weasel/examples/ks-first-safe.cfg quiet

    LABEL first-disk
    menu label ESX Scripted Install to first disk (overwrite VMFS)
    kernel vmlinuz
    append initrd=initrd.img vmkopts=debugLogToSerial:1 mem=512M ks=file:///usr/lib/vmware/weasel/examples/ks-first.cfg quiet

    LABEL skip-install
    menu label ^Boot from first hard disk
    localboot 0x80

    Im no expert – just a guy who had to get Vmware installed and found server had no DVD drive – but it worked

    Rob

  • Slym says:

    Or you can use LinuxLive USB Creator and it will even create a ks.cfg with a lot of examples for different settings.

    It’s there : http://www.linuxliveusb.com

    And it’s working with vSphere 4.1 and 5.0.

  • […] machine (Virtualization Pro) Howto: 101 Scripting ESX server installation on vSphere 4 (VI Tips) Creating USB based boot media for ESX 4 installs (Ubiquitous Talk) Automating vSphere ESX4 host installations (Ubiquitous Talk) Best Practices for […]

Leave a Reply

XHTML: You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>