ESXi unattended installation 4.0 4.1 USB

ESXi unattended installation 4.0 4.1 USB

ESXi unattended installation 4.0 4.1 USB 150 150 Roderick Derks

Create an unattended installation for ESXi Installable version

This article is usable for the ESXi 4.0 and 4.1 version. For 4.1 you need to do more then in 4.0 because of a file that needs te be uncompressed in a special way, see the end of the article where I have written the new info.

The ESXi installer scripts are located in the install.tgz file (ESX 4.0) or in the install.vgz file (4.1) in the root of the installation media. Opening this up (for 4.1 see below), we see 2 directories: sbin and usr. In sbin is the (b)Ash script that is called to kick off the ESXi installation, but it just calls to /usr/lib/vmware/installer/ThinESX.py, which in turn simply calls the Start method defined in ThinESXInstall.py in the same directory. This file defines a number of install steps, each of which is a method in yet another file, /usr/lib/vmware/installer/ThinESX/ThinESXInstallSteps.py. Most of the methods in that file call scripts in /usr/lib/vmware/installer/ThinESX/Dialogs to do the actual work. Once you unravel this, it’s clearly obvious that only one thing needs to be modified – the install steps defined in /usr/lib/vmware/installer/ThinESXInstall.py! Here’s what the default entry looks like, on lines 22/23:

Steps = [ WelcomeStep, LicenseStep, TargetSelectionStep, ConfirmStep, \
WriteStep, PostConfigStep, CompleteStep, RebootStep ]

The PostConfigStep does some important work, and doesn’t present any user dialogs anyway so it needs to stay. But I couldn’t give a damn about a welcome screen, a EULA acceptance (as if we’re not bound to that anyway by the license purchase), a target confirmation dialog, and a message telling me the install has completed. So stripping out the extraneous stuff, we are left with:

Steps = [ TargetSelectionStep, WriteStep, PostConfigStep, RebootStep ]

More info from VMWare about installing ESXi 4.1 can be found here.

ESXi 4.1

On a Linux workstation (Ubuntu)

  • mount the iso (i.e. using Navigator)
  • extract install.vgz
  • copy install.vgz into a new directory
  • Rename install.vgz to install.gz so gzip understands it
    # mv install.vgz to install.gz
  • gunzip install.gz
    # gunzip install.gz
  • I could not copy vmtar to my Ubuntu install so I copied install.gz to the esx server
    # scp install.gz root@esxhost:/tmp

On ESXi
In 4.1 the install.tgz file is suddenly replaced by a install.vgz file! What the hell is a .vgz file? VMware probably decided to use another packing method, it is probaly faster. We need another tool to unpack the files.

  • Use vmtar to convert the install to a normal tar format
    # cd /tmp
    # vmtar -x install -o install.tar

On a Linux workstation (Ubuntu)

  • copy the file to a linux workstation
    # scp root@esxhost:/tmp/install.tar
  • Untar install.tar
    # tar xvf install.tar
  • edit the file afer setting the write rights
    # chmod +w usr/lib/vmware/installer/ThinESXInstall.py
    # vi usr/lib/vmware/installer/ThinESXInstall.py  --> (Read the instructions above)
  • tar the files again and copy it to the ESXi host
    # tar cvf install.tar *
    # scp install.tar root@esxhost:/tmp/

On ESXi

  • Use vmtar to convert the install to a normal tar format
    # cd /tmp
    # vmtar -c install.tar -o install

On a Linux workstation (Ubuntu)

  • Zip the file
    # gzip install
  • Rename gzip to vgz
    # mv install.gz install.vgz

Copy install.vgz into the original ISO file. I did that using "Ultra Iso", that's a Windows application… Yeah I know…

Install from a USB drive

I was trying to install VMware esxi 3.5 on a Dell PowerVault 750N (sold as a nas box).  The box doesn’t have a CD drive so I had to get the esxi install on another way.  I found a couple how-to’s about booting from a usb thumb drive that used a different kernel, but by changing a few bits I was able to boot from a USB thumb drive directly to the ESXi install.

Items Used:
1. 8GB USB 2.0 thumb drive  ***Revised I had to use a 512 stick to get it working on 1 server
2. VMware-VMvisor-InstallerCD-3.5.0xxxx.i386.iso (extract iso to USB drive)
3. Syslinux-3.72 (unzip to temp location)

Procedure:
1. Format USB drive with FAT32 (I needed a 512MB USB drive formated FAT to get it to work on 1 server)
2. Extract VMware iso to USB drive
3. Extract Syslinux onto C: drive
4. Navigate to syslinux-3.72\win32 and run the following command
syslinux.exe -s -m -f -a e: (e: was my usb drive)
5. This will create a file called ldlinux.sys (hidden file so you need to view hidden to see it)
6. Navigate to the USB drive and rename isolinux.cfg to syslinux.cfg. You do not need to change anything in this file. The config file boots the mboot.c32 kernel that is included with the esxi install.
7. Make sure your server is set to boot from USB and you are good to go.

Roderick Derks

Liefhebber van fietsen, van het oplossen van IT puzzels, en van het delen van informatie om anderen te helpen.

All stories by:Roderick Derks

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Your Name (required)

Your Email (required)

Subject

Your Message

Your Name (required)

Your Email (required)

Subject

Your Message