Install ESXi from USB stick


from http://www.jonathanmedd.net/2011/01/install-esxi-4-1-from-a-usb-stick.html


Install ESXi 4.1 from a USB stick

Posted on January 24th, 2011 Jonathan Medd 18 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 modifysyslinux.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:

01 default menu.c32
02 menu title VMware VMvisor Boot Menu
03 timeout 80
04  
05 label ESXi Installer
06 menu label ^ESXi Installer
07 kernel mboot.c32
08 append vmkboot.gz ks=usb --- vmkernel.gz --- sys.vgz --- cim.vgz --- ienviron.vgz --- install.vgz --- mod.tgz
09  
10 label ^Boot from local disk
11 menu label ^Boot from local disk
12 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:

1 vmaccepteula
2 rootpw password
3 autopart --firstdisk --overwritevmfs
4 install usb
5 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 ativobeerens.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.cfgfile 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 yoursyslinux.cfg file to remove the reference to – mod.tgz .


發佈了38 篇原創文章 · 獲贊 3 · 訪問量 18萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章