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

Reply
0 Kudos
100 Replies
Paul_Lalonde
Commander
Commander

Mike,

I could have sworn that error message (for me, in the past) is supposed to say "...does not appear to contain ESX Server 3.01 CD-ROM images." Any chance you're using files from a RH distribution?

(Just a shot in the dark...)

Paul

Reply
0 Kudos
Michelle_Laveri
Virtuoso
Virtuoso

That's interesting....

The version that I'm using is your patched version which I downloaded from:

http://home.cogeco.ca/~plalonde2/hdstg2.img

Which was meant to fix the python error...???

Could be the wrong file is on the webserver???

Regards

Mike

Regards
Michelle Laverick
@m_laverick
http://www.michellelaverick.com
Reply
0 Kudos
Paul_Lalonde
Commander
Commander

I will check on it this weekend. PLEASE don't send me an invoice for all your billable time if this ends up being my bad! Smiley Happy

Paul

Reply
0 Kudos
Michelle_Laveri
Virtuoso
Virtuoso

Well, I've had some progress...

I used mkisof to create the ISO... so it looks like WinISO isn't so hot after all...

However, I still have an error... get past all the install questions... and then it fails. I think I have the same anaconda errors as others have:

I'm on a HP Proliant DL385 G1. I have two other servers but they don't support from USB key. So I can't test to see if this server specific...

I've attached my error message from the ILO to this post...

Regards

Mike

Regards
Michelle Laverick
@m_laverick
http://www.michellelaverick.com
Reply
0 Kudos
Michelle_Laveri
Virtuoso
Virtuoso

I will check on it this weekend. PLEASE don't send

me an invoice for all your billable time if this ends

up being my bad! Smiley Happy

Paul

Paul, no worries mate... without your input we haven't got this far... so your efforts are appreciated... at some stage I would like understand the python error (in a rough way to explain to others) but that's for later...

Regards

Mike

Regards
Michelle Laverick
@m_laverick
http://www.michellelaverick.com
Reply
0 Kudos
Michelle_Laveri
Virtuoso
Virtuoso

Any progress to report Paul...

I've been reviewing this thread and looking back on the process generally... The common line appears to be that different USB sticks work differently... So I am wondering if this is hardware specific.

You said you have used to USB sticks successfully. I wondered if you could post here the exact[/b] sticks you use. I would be happy to go out and actually buy them just to test this... the theory being is if I can reproduce a working system from the same type of USB device - then it must HW specific?

Regards

Mike

Regards
Michelle Laverick
@m_laverick
http://www.michellelaverick.com
Reply
0 Kudos
dominic7
Virtuoso
Virtuoso

I've got it working using the steps that Paul outlined and an Imation 4G drive. It runs a kickstart and installs on a compaq DL385 G1 though I still have some other weirdness that I'm trying to track down where it doesn't seem to be applying all of my kickstart changes that work with the floppy and/or cdrom method.

Reply
0 Kudos
canadait
Hot Shot
Hot Shot

do you have any commands after the %post as I can't get these to work.

Reply
0 Kudos
dominic7
Virtuoso
Virtuoso

No. That was the weirdness that I was referencing. I thought it was just me 😃

Reply
0 Kudos
Michelle_Laveri
Virtuoso
Virtuoso

I've got it working using the steps that Paul

outlined and an Imation 4G drive. It runs a kickstart

and installs on a compaq DL385 G1 though I still have

some other weirdness that I'm trying to track down

where it doesn't seem to be applying all of my

kickstart changes that work with the floppy and/or

cdrom method.

Cool... Can you post the precise make & model of the flash drive?

Did you get to the bottom of your kickstart woes...?

My %post section (which I shameless nabbed from brianhouse.net) works just dandy on my PXE method. So I can't see why it wouldn't with the USB stick. If I could just get past these Anaconda errors...

It does sound like a hardware issue. Paul mentioned earlier about the installer wanting to "protect" the system. Perhaps different sticks have different write-protection methods which would indicate why some behave differently from others???

Regards

Mike

Regards
Michelle Laverick
@m_laverick
http://www.michellelaverick.com
Reply
0 Kudos
dominic7
Virtuoso
Virtuoso

I tried a different usb drive ( sd->usb adaptor actually ) and it didn't work so I stole a 4g flash drive from an intern that was on vacation to test it out. The model number is 'HMDS-04GC' but a google of that doesn't yield a result. Most of the little crap that we order comes from CDW, so I found one that looks the same here:

http://www.cdw.com/shop/products/default.aspx?EDC=941709

I'm using the same kickstart that I have been using to integrate into CDROMs and have also used via floppy, but the %post section isn't being executed, I'm looking into why.

Reply
0 Kudos
canadait
Hot Shot
Hot Shot

Ok good. (well not good)

I was pulling out my hair as to why they would not execute.

Reply
0 Kudos
dominic7
Virtuoso
Virtuoso

My problem may have been a brain fart, it looks like I have windows-style formatting on my ks.cfg file. I reformatted it and am re-installing the host now. I should know in the next 10 mins or so.

Reply
0 Kudos
canadait
Hot Shot
Hot Shot

How can you tell that it is windows formatted?

Reply
0 Kudos
dominic7
Virtuoso
Virtuoso

transfer it to an esx box and run "cat -ev ", if all the lines end in ^M then it's formatted windows style.

BTW, I got it all working now.

Reply
0 Kudos
dominic7
Virtuoso
Virtuoso

/me dances a little jig

This is pretty sweet, now I have all my disaster recovery on a usb drive with boot menus and all. My kickstart installs all my patches and sim agent from an ftp repository and does all my configuration completely hands-free.

Paul, do you mind if I re-use some of you work on my site?

Reply
0 Kudos
dominic7
Virtuoso
Virtuoso

I bought another 1G flash drive on the way home today from Fry's for $12 USD. I don't think the model matters much, I had the same success with this one. Mike if you want me to load up everything on a flash drive and ship it to you drop me an email at dominic@vmprofessional.com.

Reply
0 Kudos
Paul_Lalonde
Commander
Commander

Go for it!

And thanks for offering to help Mike out... I've been trying to find the time to sit down in the lab and go through it all again, but it ain't happening because I'm freakishly busy lately.

Paul

Reply
0 Kudos
Michelle_Laveri
Virtuoso
Virtuoso

I bought another 1G flash drive on the way home today

from Fry's for $12 USD. I don't think the model

matters much, I had the same success with this one.

Mike if you want me to load up everything on a flash

drive and ship it to you drop me an email at

dominic@vmprofessional.com.

That's for the offer Dom, but as you might expect I'm more interested in getting the set-up nailed so I can confidently put it out for others. I want to include it in the book along side a PXE appliance I have been working with... but if I can't get it to work, I won't want to put something in the book that I'm 100% confident will work...

If its not the USB stick itself like a hardware issue - Perhaps I am doing something wrong in the process. Attached is a PDF version of the instructions I've documented so far. I bought WinISO to create the custom ISO, which for me didn't work. But mkisof did work...

I'd appreciate anyone who has got this working to check my instructions in case I am doing something wrong....

Regards

Mike

Regards
Michelle Laverick
@m_laverick
http://www.michellelaverick.com
Reply
0 Kudos
Michelle_Laveri
Virtuoso
Virtuoso

My problem may have been a brain fart, it looks like

I have windows-style formatting on my ks.cfg file. I

reformatted it and am re-installing the host now. I

should know in the next 10 mins or so.

I've had this myself. I created my kickstart file using the VMware scripted tools. Then I cut & pasted this into PXE server appliance I have been working on. What I didn't know is that this server was formating its files as "DOS Format". Symptoms included my %post section not being processed correctly. My %post creates a file with the cat > command, and then tags itself to the /rc.d/local file to be executed on first boot. This is because esxcfg commands need a VMkernel loaded to function...

Other symptoms include these cat > files not being correct format and have odd characters in the file name like filename_r and when edited with nano filename_^m. I knew what the problem was but took me ages to find it. I've seen this before in editing scripts on a windows PC but forgetting use "Text" in WinSCP to transfer them to ESX. If you use binary then these ^M characters get added to each and every line.

I thought the > cat process was the problem, but ACTUALLY, it turned out to be the KS script itself. I only realised this when I went to edit the KS file with nano. It popped up with \[DOS Format] in the menu. Blink and I would have missed it.....

Since the same problem bedevils license files - I've taken to using the COS at all times to edit or create files. If this is impossible I used Wordpad. Notepad always screws up license files....

Regards

Mike

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