Scripting. Powershell, VMware, Windows, Active Directory & Exchange. All that kind of stuff…..
RSS icon Email icon Home icon
  • Install ESXi 4.1 from a USB stick

    Posted on January 24th, 2011 Jonathan Medd 29 comments

    Depending on your environment you may find the ability to install ESXi from a USB stick, particularly if you do not have access to a PXE based deployment solution.

    With ESXi 4.0 I had used a USB stick with the install ISO on the stick. Whilst starting to test 4.1 I thought it would be a simple case of replacing the 4.0 ISO with 4.1. However, when I did this I was able to boot to the install, but when it got to the part of copying the files I received the error:

    “Unable to find the system image to install. This is due to the image not being mounted correctly, or the CD-Rom drive not supported”

    A bit of googling revealed that there seems to be a change between 4.0 and 4.1 where the install is hard-coded to look for the files on the CD-Rom drive. Consequently it looks like you need to take a slightly different approach and use the new Scripted Install feature of ESXi in 4.1

    So this post will detail the three steps you need to take to get this working:

    • Creating the bootable USB stick including the installation files
    • Adding the Kickstart script
    • Add a custom mod.tgz file

    Creating the bootable USB stick including the installation files

    There are many posts on the web detailing how to create a bootable USB stick with syslinux. One I have found particularly useful for this scenario is UNetbootin. This is a GUI based tool that allows you to create bootable USB drives for Ubuntu, Fedora and other Linux distributions by pointing the tool at the install ISO and hitting Go! I found this from Daniel Buonocore’s post over at blogs.vmpros.nl

    Download the execuatble from UNetbootin and point it at the ESXi 4.1 ISO file.

    Hit OK and the creation will begin:

    You will be prompted to overwrite the file menu.c32 , answer Yes that you wish to do this.

    This part is then complete. There is no need to reboot :-)

    Adding the Kickstart script

    As mentioned earlier we need to specify that the ESXi install files are not on the CD-Rom; we do this by modifying the syslinux.cfg file to include a reference to a Kickstart file on the USB stick. So modify syslinux.cfg to include ks=usb to the append line. Whilst we are here also add - – -  mod.tgz at the end of the same line – more on this in the next section. The resulting file will now look like this:

    
    default menu.c32
    menu title VMware VMvisor Boot Menu
    timeout 80
    
    label ESXi Installer
    menu label ^ESXi Installer
    kernel mboot.c32
    append vmkboot.gz ks=usb --- vmkernel.gz --- sys.vgz --- cim.vgz --- ienviron.vgz --- install.vgz --- mod.tgz
    
    label ^Boot from local disk
    menu label ^Boot from local disk
    localboot 0x80
    

    We now need to add a Kickstart script to the USB stick. The ESXi Installable and vCenter Server Setup Guide for 4.1 contains details of the options for this file. For my very simple requirements I have used the following to create a ks.cfg file:

    
    vmaccepteula
    rootpw password
    autopart --firstdisk --overwritevmfs
    install usb
    network --bootproto=dhcp --device=vmnic0
    

    Add a custom mod.tgz file

    At this point you are pretty much there, however if you boot of the stick now you will get the following error on the console constantly repeating:

    Total number of sectors not a multiple of sectors per track! Add mtools_skip_check=1 to your .mtoolsrc file to skip this test

    It is possible to temporarily get round this via the following method detailed in the VMware communites:

    ALT + F1

    Log in (root + no password)

    echo “mtools_skip_check=1″ >> .mtoolsrc

    ALT + F2 to return to original Console window

    Press Enter or wait to continue

    However, you don’t really want to have to do that everytime. So very helpfully Ivo Beerens over at ivobeerens.nl has created a custom mod.tgz file which will automate this part for us.

    Download the mod.tgz file and copy it to the USB stick. (Make sure you have modified the syslinux.cfg file as mentioned earlier in this post to reference the mod.tgz file)

    The contents of the USB stick should now look like:

    The USB stick is now complete and ready to be boot from. The following three posts were highly useful in helping put this USB stick together.

    Update 18/02/2001:

    The release notes of ESXi 4.1 U1 contain details of the above issue where the additional mod.tgz file is required:

    Unable to install ESXi 4.1 using scripted installation from a USB drive
    When you try to install ESXi 4.1 by using script saved on a USB drive or if the installation media is on a USB drive, the ESXi 4.1 installation stops and displays the following message:
    Total number of sectors not a multiple of sectors per track!
    Add mtools_skip_check=1 to your .mtoolsrc file to skip this test.

    The issue is resolved in this release.

    I tested this and it works fine, so the mod.tgz file is no longer required. Don’t forget to update your syslinux.cfg file to remove the reference to – mod.tgz .

     

    22 responses to “Install ESXi 4.1 from a USB stick” RSS icon

    • Greetings.

      I tried this setup now, and it works fine into the install, but it fails with the following message.

      “Error (see log for more info):
      md5 sums did not match

      And then the install cancels and exit.

      Any tips on how to fix it? I have removed the mod.tgz file as it’s not needed anymore as you stated.

    • Jonathan Medd

      Have you checked that the ESXi download you have is not corrupt as per the below?

      kb.vmware.com/kb/1537

    • I’ve followed this guide to the letter, and it boots to the USB key and displays the two menu options of ESXi Installer or boot to local disk. When I choose ESXi installer, it displays this error:
      “mboot.c32: not a COM32R image”

      I’m using ESXi build 348481 for the source ISO.

      Any ideas?

    • “mboot.c32: not a COM32R image”

      use older version of unetbootin like
      “unetbootin-windows-494.exe”

    • Rick, if you used Syslinux for your USB disk, I had the same problem. Found I needed to use version 3.63 of Syslinux to match the version used of ISOlinux used in the ESXi image.

    • Hi,

      had the same issue…
      use an older version of unetbootin.

    • If like me you followed these directions and received the error that mboot was not a valid image than it is an issue with UNetBooting. It appears that the new version uses a buggy Syslinux. I was able to fix the issue by using Unetbootin version 494.

      http://sourceforge.net/projects/unetbootin/files/UNetbootin/494/unetbootin-windows-494.exe/download

    • Why do all UNIX instructions have to be so damn hard! 14 years IT experience 10 different websites to get a ISO to boot to a USB key and a couple of hours.

      Why can unix sites not give you one image file to download that you can write out in one command line. I think you guys like to make peoples lives hard.

    • I updated my software to easily create USB installer for ESXi 4.1.

      It will also automatically put the ks.cfg file with a lot of options and comments.

      You can download it on http://www.linuxliveusb.com

      It’s free and open-source.

    • version 494 of unetbootin works very well for installing ESXi 4.1. Thanks!

    • I still can’t this working.

      The install works ok, states it needs to boot up however, it then starts going through the install again upon the server rebooting. Any thoughts?

    • This worked flawlessly, but only once I used unetbootin-windows-494, the latest ver did NOT work!

    • How do you install VMware from a USB stick onto the internal usb stick?

    • Hi,

      Unfortuantely you cannot use a scripted install to install from the USB stick to an internal USB / SD since you cannot use a Scripted Install to install ESXi Installable to a USB device or SD Card. See the below for more info.

      http://kb.vmware.com/kb/1022263

      Jonathan

    • Excellent post. Like another user I had to use the unetbootin-windows-494 exe to load up properly. Great documentation, thanks!

    • This works great, up until the “Calculating MD5″ screen. After that appears, it just hangs. I have downloaded the ESXi twice, but still no luck. Any suggestions?

      Thanks,
      Jeff

    • Jonathan, Thanks for this nice article. The procedure works perfect for me when I install in USB stick itself but unfortunately I am unable to see the SATA disk in Dell T110 II (may be because SATA not detected). So far I tried ESXi 5.

      Anyone any clue?

      Many thanks!

      Joy.

    • Hi,

      I’d make sure it’s on VMware’s HCL and might be worth applying firmware updates. Also look out for Dell specific ESXi drivers for version 5.

    • I keep getting an error, when the install is about to go through..

      “error encountered before the user interface was initialized- this system does not have a network interface card that is plugged in, or all network interface cards are already claimed. Installation cannot continue as requested”

      I am installing on a Cisco c260 M2, and have a netwok cable connected M1 port going to a 3750 Switch.

      Any ideas?? I dont want it to go through DHCP since I’ll have to set a static IP..

      Thanks in advance

      -Deneb

    • I fixed the issue.. just a heads up for anyone else that has a problem:

      changed bootproto to static instead of dhcp.

      1 vmaccepteula
      2 rootpw password
      3 autopart –firstdisk –overwritevmfs
      4 install usb
      5 network –bootproto=static –device=vmnic0

      -Deneb

    • Thx @Deneb that worked for me too!

    • The easiest way to run installation from usb is using linuxlive usb…

      http://www.linuxliveusb.com

      Really works…

      Thank you…


    7 Trackbacks / Pingbacks

    Leave a reply