VMware Cloud Community
Paul_Lalonde
Commander
Commander

HOWTO: Installing ESX Server from a USB flash drive

After Mike Laverick posted his experience with ESX Server and USB flash disks in another thread, I decided to figure out how to make it work.


Here's a quick rundown on setting up a USB flash disk (ie. pen drive, flash key, etc.) to install ESX Server.


Requirements:



\- You will need at least a 1 GB USB flash disk.


\- You must have

both

the ESX 3.x CD-ROM and ISO image handy.


\- You will need an ISO image extraction tool such as WinISO, MagicISO, or even WinRAR.


\- You'll need SYSLINUX, a Linux boot loader for removable media. Get it here:





http://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-3.36.zip





\- These instructions are based on a Windows PC for simplicity. If you're a Linux guru, then you can obviously do this under Linux. You'd need to know how to mount .ISO images in order to extract files, etc.








Steps Required:





1. Plug in your USB flash disk and format it under Windows. Use the FAT filesystem (not FAT32, although it would probably work).



2. From Windows Explorer, find the

boot.iso

file in the

/images

directory on the ESX 3.x CD-ROM. Copy

boot.iso

into a temporary directory on your hard drive.






3. Using your ISO extraction program of choice, extract the contents of the

boot.iso

file to your USB flash drive. On my PC, it's the

E:

drive.




4. Delete the

isolinux.bin

and

updatecd.cfg

files from the USB flash disk.



5. Rename the

isolinux.cfg

file on the USB flash disk to

syslinux.cfg





6. Using WordPad (not Notepad), open the

syslinux.cfg

file and add the keyword usbto the end of every line that begins with

append

. Here's what the file should look like when you're done:



default esx

prompt 1

timeout 600

display boot.msg

F1 boot.msg

F7 snake.msg

label debug

kernel vmlinuz

append initrd=initrd.img noapic nomediacheck debug usb

label esx

kernel vmlinuz

append initrd=initrd.img usb

label text

kernel vmlinuz

append initrd=initrd.img text usb

label expert

kernel vmlinuz

append expert initrd=initrd.img usb

label ks

kernel vmlinuz

append ks initrd=initrd.img usb

label lowres

kernel vmlinuz

append initrd=initrd.img lowres usb



7. Now, extract the

syslinux

.zip file into another temporary directory on your hard drive.



8. Open up a command prompt and use the

cd

command to navigate into the

win32

directory. For example:

cd C:\temp\syslinux-3.36\win32</p>

9. Now, run the syslinux program to apply the boot loader and boot sector to the USB flash drive:</p>

syslinux -s e:


( On my PC, my USB flash drive is mounted as drive E: )



10. Finally, copy the ESX 3.x ISO image onto the flash drive:



+copy c:\iso\esx-3.0.1-32039.iso e:\ +



11. Confirm that your USB flash drive contains the following files:



boot.cat

boot.msg

initrd.img

snake.msg

splash.lss

vmlinuz

syslinux.cfg

esx-3.0.1-32039.iso



12. You're all set! Unplug the USB flash drive, configure the BIOS on your server to boot from USB accordingly, and boot 'er up!



13. The ESX installer will detect the USB device and whatever SCSI / disk controllers you have. When the installer asks you what the installation source will be, choose

Hard Disk

.



14. You will need to choose the right disk device (ie. /dev/sda, /dev/sdb) that corresponds to your USB flash disk. Chances are it will be /dev/sdb.



15. Finally, the installer will ask you what directory to find the ESX installation CD image in. Just use / and it will find the .ISO image for you.



16. The rest is history!



Please let me know how this works for you and if you run into any glitches. This is going to save me a lot of time since I don't have CD-ROM drives in all of my servers!!

Paul

0 Kudos
100 Replies
canadait
Hot Shot
Hot Shot

Mike these are the exact same problems I am having. I was using your "ESX01" cfg file you previously posted.

Do you have a working cfg file that I could use that has the %post stuff. I really want to make this work! Smiley Happy

Please post the working file or PM me.

Thanks so much!!

0 Kudos
dominic7
Virtuoso
Virtuoso

So I've taken Pauls work and re-written it here:

http://vmprofessional.com/material/usb_install.html

Perhaps these instructions will help you Mike.

0 Kudos
Michelle_Laveri
Virtuoso
Virtuoso

Well, i tried those - and I still have the same problem...

I think it must be the USB drive...

Regards

Mike

Regards
Michelle Laverick
@m_laverick
http://www.michellelaverick.com
0 Kudos
skearney
Enthusiast
Enthusiast

Mike,

Have you tried a manual install with the ISO on your USB key? If not, it might help with the debugging. I had no issues using the modified hdstg2.img file supplied in this thread.

Add 'askmethod' to your boot options (and remove KS stuff).

0 Kudos
Chris_S_UK
Expert
Expert

I tried this with a couple of keys, the first (a ByteStor device) gave a "Boot Error" but the second (a Samsung device) works ok.

Thanks

Chris

0 Kudos
mannyb
Contributor
Contributor

This has been a great post and I am still trying to tweak the USB boot process. I have taken and also created various KS.cfg files. However, during the install process I get the following error

"tmp/anaconda_build//usr/lib/anaconda/text.py, line 425 in run"

I can boot off the USB drive and do an install, but I would also want to make KS. files loadable from the same USB drive. This is a great idea thanks guys for posting it!!

0 Kudos
dconvery
Champion
Champion

Guys -

Any idea what I am doing wrong? I followed the instructions. with an older SanDisk 1GB cruzer micro. I am using Hp BL460c blade servers. I am also using iLo for console connection. The system will boot to the usb drive fine. I type in "esx text" or just hit and vmlinuz loads, then initrd.img loads. Then it just stops. No error, no nuttin.

Help :o(

Dave Convery, VCDX-DCV #20 ** http://www.tech-tap.com ** http://twitter.com/dconvery ** "Careful. We don't want to learn from this." -Bill Watterson, "Calvin and Hobbes"
0 Kudos
Schorschi
Expert
Expert

I went around and around and around on this with VMware... Don't ask how I got VMware to look at the problem, but I did. It all boils down to how the usb device is not recognized as a true read/write device and is remounted internally by anaconda, so that the USB boot device is seen as a fake CDROM device, again, anaconda is confused, so it then attempts to mount the USB device now read-only, as read-writeable, and thus partitions.py freaks out. Thinking I could side step the issue, I got the USB device to be recognized as a Hard-Disk... well no, due to the device enumeration of type, I hit a break wall again. Dang anaconda continues to see the USB device it booted from as a VALID disk it SHOULD mount as read-write.

This is not technically a bug in partitions.py, but something that partitions.py coding is just not designed to do because it only supports 3 types, CDROM, HD (SCSI or otherwise), and Floppy device types. To correct the issue per VMware, anaconda would have to be significantly changed in several places, starting with the actual code that does the initial device discovery at the hardware analysis level which core to ASM of anaconda, and teaching anaconda what it means to be a 21st centry 2007 tool. This, per VMware, is just not worth the effort, or at least that was the comment at the time.

0 Kudos
dconvery
Champion
Champion

I'm not even getting to anaconda. This is before the drivers even load. It just sticks at "Loading initrd.img ........."

Dave Convery, VCDX-DCV #20 ** http://www.tech-tap.com ** http://twitter.com/dconvery ** "Careful. We don't want to learn from this." -Bill Watterson, "Calvin and Hobbes"
0 Kudos
Michelle_Laveri
Virtuoso
Virtuoso

I went around and around and around on this with

VMware... Don't ask how I got VMware to look at the

problem, but I did. It all boils down to how the usb

device is not recognized as a true read/write device

and is remounted internally by anaconda, so that the

USB boot device is seen as a fake CDROM device,

again, anaconda is confused, so it then attempts to

mount the USB device now read-only, as

read-writeable, and thus partitions.py freaks out.

Thinking I could side step the issue, I got the USB

device to be recognized as a Hard-Disk... well no,

due to the device enumeration of type, I hit a break

wall again. Dang anaconda continues to see the USB

device it booted from as a VALID disk it SHOULD

mount as read-write.

This is not technically a bug in partitions.py, but

something that partitions.py coding is just not

designed to do because it only supports 3 types,

CDROM, HD (SCSI or otherwise), and Floppy device

types. To correct the issue per VMware, anaconda

would have to be significantly changed in several

places, starting with the actual code that does the

initial device discovery at the hardware analysis

level which core to ASM of anaconda, and teaching

anaconda what it means to be a 21st centry 2007 tool.

This, per VMware, is just not worth the effort, or

at least that was the comment at the time.

I think this post is very meaningful/useful... I decide a couple of months ago to give on this esx-on-a-stick approach. I just never got it working, and became more interested in a over-the-network PXE approach which became the UDA...

Regards

Mike

Regards
Michelle Laverick
@m_laverick
http://www.michellelaverick.com
0 Kudos
mikef123
Contributor
Contributor

Hi Paul, I'm wondering if you have a patched version of the of the hdstg2.img file for 3.5

Thanks

Mike

0 Kudos
stevi_velvet
Contributor
Contributor

Thanx to Mike & Paul (et al.) for all their hard work in posting their info., Just thought I'd share my onw expereinces whilst I'm at a dead end

I'm using a OEM Blade with a P35 (ICH9R) chipset & 2 500GB SATA . It 's the only box avaibale in the firm that is spare & I can utilise for prep on my upcoming VCP Course, and the snads of time are running out quickly!!

- CD-ROM Installation hits a bring wall of 'Device not Fóund '

- I've been meticulous in the USB Postings, along with things such as recreating the ESX ISO with mkisofs via RHEL & not any Windows ISO Product (which leads to the same error above) & arrive at the stage where, whilst the SATA Disk & their partitons are seen, the installation complains of

The ESX Tree does not match your media

It seems that recerating the ISO with the patched hdstg2.img may have created that..I hope, Less I'll order on my own account a SCSI Controller & Card

BTW I've tried ALT-F@ at anaconda ( to get to the shell & investigate if their any problems with how the USB Partitons are recognised )which seems to have been disabled ?

0 Kudos
stevi_velvet
Contributor
Contributor

Realised eslewhere that the hdstg2.img version does match the initrd.img

Hence joined the queue with Mike (see previous post)

~ |

0 Kudos
stevi_velvet
Contributor
Contributor

Proceeded further with a unmodified ESX 3.5 ISO on the USB, now awaiting a HCL-compatible NIC

0 Kudos
mikef123
Contributor
Contributor

Using Pauls modified .img file is incompatiable with 3.5. I've been trying to insert Pauls modified partitions.pyc file into the hgstg2.img from 3.5. No luck. Paul, if you get a chance could you explain how you modified the .img file.

Regards

Mike F.

0 Kudos
stevi_velvet
Contributor
Contributor

Mike

See my previous post, I discarded esx-custom.iso & replaced with the original ESX 3.5 ISO & have proceeded further

Stevie (ms.)

0 Kudos
mikef123
Contributor
Contributor

I tried that but the partitions.pyc file is still complaining.

0 Kudos
stevi_velvet
Contributor
Contributor

Tried the 64607 Build of ESX (28th February Release) ISO on the USB, failed with the familiar error of ' The Tree not matching the media Type'

Sucess: Managed to install the 64607 build over SCSI (70GB U160 + Adaptec29320-R via auction) via HTTP...no other method including CD-ROM would worked

Almost Sucess: Installed over a existing Fedora 7 SATA Disk, but would not GRUB. Manually updated GRUB after mounting ESX's /boot, but Fedora's GRUB, didn't recognise VMFS , so reverting back to SCSI - ...

Good Luck All

0 Kudos
jeholo
Contributor
Contributor

Tried the VI 3.5 (64607 Build of ESX, 28th February Release) ISO on the USB, failed with the familiar error of ' The Tree not matching the media Type.

Used Paul's hdstg2.img file.

Have anybody managed to get a USB install of VI 3.5 working ?

Jan Erik Holo

0 Kudos
mikef123
Contributor
Contributor

I haven't gotten it to work. Paul's hdstg2.img file is for 3.01. if you loop mount the img you will see a lot of python files in the anaconda directory. They are not compatible with 3.5

0 Kudos