I wrote this article because I wanted to install an ESXi4 on a System with unsupported Network card, thus I had to modify the oem.tgz. As it is so much easier nowadays to use USB Sticks to install a new system I wanted to use one of those for the task. Unfortunately it took me a really long time to figure out how to modify the oem.tgz and, far more important, include it onto the USB Stick that it would be loaded properly during the installation process. I put it on the root of the USB Stick, but you also have to adjust the bootloaders config files to read the oem.tgz during the boot process if there was no oem.tgz on the root of the original source .iso. So here is a step-by-step guide to put the ESXi install .iso on a USB Stick and put the oem.tgz on it properly:
Requirements:
- ESXi4 Install ISO (I used VMware-VMvisor-Installer-4.0.0.Update01-208167.x86_64.iso)
- A Computer running Linux (This can also be a Live Linux…)
- USB Stick with at least 512MB
All process except the creation of the oem.tgz can also be done from a Windows. Actually everything could be done from a Windows but I didn’t wanted to install the necessary programs as it’s quite comfortable over a shell.
Building the oem.tgz
First of all you need to know what you want to do with the oem.tgz. In my case, I wanted to include a driver for a RTL8101e (R8169) as well as the driver for an Atheros L1E (atl1e). I found a suitable driver for both the cards an now wanted to put it back on (you can get a modified oem.tgz working for this two and some other devices here; if you use this, you can skip this step creating the oem.tgz). First I created a folder “oem” in which I put all the necessary files:
./etc/vmware/simple.map ./etc/vmware/pci.ids ./usr/lib/vmware/vmkmod/r8169.o ./usr/lib/vmware/vmkmod/atl1e.o
Withing the simple.map, I had to add the corresponding PCI ID’s with the driver. You can find the PCI ID’s with lspci (on linux) or on “Hardware Properties” / Details / Hardware IDs (on Windows). In my case, I had to add the following lines in simple.map:
10ec:8136 0000:0000 network r8169.o 1969:1026 0000:0000 network atl1e.o
As the .o files are already in place, the next step is just to put everything into the oem.tgz archive. Check to be in the oem folder and then run:
tar czvf ../oem.tgz * cd ..
This was the easy part, now we want to create a new .iso with the proper oem.tgz in it. This files is located on the original iso: There is a file image.tgz, within this archive is a bz2 compressed file VMware-VMvisor-big-208167-x86_64.dd. On this Image, there is it, the oem.tgz. So first we create a folder structure to fit the needs:
mkdir ddimg img iso iso-mnt
Next, we mount the original .iso and copy the content to the iso-mnt folder:
mount -o loop -t iso9660 /path/to/original/.iso iso-mount cp -r iso-mnt/* iso/ umount iso-mnt
Now we extract the image.tgz from the iso into the img folder and uncompress it:
tar zxvf iso/image.tgz -C img/ cd image/usr/lib/vmware/installer/ bunzip2 VMware-VMvisor-big-208167-x86_64.dd.bz2 (or the name of the file you find in this folder)
Now we mount the .dd image:
mount -o loop,offset=$((512*8224)) VMware-VMvisor-big-208167-x86_64.dd ../../../../../dd-img/
Next, we copy the oem.tgz file into the mounted .dd image and unmount it again:
cd ../../../../../ cp oem.tgz dd-img/ umount dd-img/
Now we have to compress the .dd image file again, and create the whole archive of image.tgz:
cd img/ bzip2 usr/lib/vmware/installer/VMware-VMvisor-big-208167-x86_64.dd tar zvcf ../iso/image.tgz usr/
Finally, we want to create the final .iso with the modifications:
cd ../iso mkisofs -o ../ESXi4-install-modified.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 \ -boot-info-table .
When you are sure that you have the right files on your iso, you can clean up…
cd ../ rm -rf iso/ rm -rf iso-mnt/ rm -rf img/ rm -rf dd-img/ rm -rf oem/
Now we have our .iso and we want to put it on the USB Stick. For this I used a tool called “unetbootin”, you can get it here. Get the version for you OS and start it (alternatively if you don’t have an X you could also use Syslinux. Select the .iso and select your USB Stick device and start the process.
After this is done, we also need to put the oem.tgz onto the root of the USB Stick and modify the bootloaders config to load the file during the boot process:
cp oem.tgz /path/to/USB-Stick-root/ nano ubnfilel.txt
Here, you add “OEM.TGZ” in a new line between README.TXT and SYS.VGZ
Now we also have to adjust the bootloaders config: You have to add a ” — oem.tgz” to the ESXi Installer append string. Before it looks like this:
append initrd=/ubninit vmkboot.gz --- vmkernel.gz --- sys.vgz --- cim.vgz --- ienviron.tgz \ --- image.tgz --- install.tgz
Change to:
append initrd=/ubninit vmkboot.gz --- vmkernel.gz --- sys.vgz --- cim.vgz --- ienviron.tgz \ --- image.tgz --- install.tgz --- oem.tgz
Do the same to ISOLINUX.CFG and now you are done! Eject the USB Stick, put it into the desired computer and boot from usb – done
I hope this might help some guys to save some time
Any comments are appreciated.
Here are the pages I used to create this Guide:
http://technodrone.blogspot.com/2010/05/esxi-deployment-solution-part-4.html http://vm-help.com/esx40i/ESXi_USB_install.php http://www.vm-help.com/forum/viewtopic.php?f=12&t=1876&p=5389#p5389