How to create a bootable VMware ESXi 3.5 & 4.0 (vSphere) USB pen drive

There are a couple of methods to create a VMWare ESXi 3.5 or v 4.0 (vSphere) bootable USB key. Firstly though I should point out that at this stage you can only buy/create ESXi and not ESX (ie: the Service Console version) on a memory pen drive or card.
A Choice of Methods
UPDATE: VMware have now provided a much simpler method of installing ESXi onto a USB pen drive as outlined in method 3 below. For step-by-step instructions on how to do this check out my new post here.

As with most things in the world of computers there are multiple ways of doing the same thing and creating a bootable ESXi 3.5 or 4.0 USB pen drive is no exception. The most popular approach to creating a bootable ESXi USB pen drive is to use WinImage so in this article I will be covering this method along with using an alternative Windows Command Line based method (DD for Windows). However with the introduction of VMware ESXi 4.0 there is an option to select USB pen drive as a target during the installation process – this being the easiest method of all.

I have used both methods successfully but others have reported some problems when using ‘DD for Windows’ under x64 Vista.

The reason for showing the ‘DD for Windows’ method is that most postings you’ll come across only show examples of using WinImage to extract ESX bootable USBthe relevant files from the ESXi ISO and to save the resultant image onto the USB key.

I thought it good to show an alternative as I have experienced issues when using WinImage under Windows 7 beta (7000) & RC (7100) x64 – though others report that it has run ok for them.

captured_Image.pngI found that WinImage installed just fine under Windows 7 though when I went to write an image to a USB key I was presented with a RED X with no description or hint as to what the problem may be. captured_Image.png[8]Also the capacity of my USB key went from 2GB to 4MB something a normal reformat could not fix ! To get your USB key back to its original capacity download the HP USB Disk Storage Format Tool from here and run it against your USB key.

I tried running WinImage as an administrator and also tried running it with an XP and Vista shim under Window 7’s compatibility mode – still with no luck. Doh! So you may want to consider running WinImage under Windows XP or Vista.
Why create a bootable VMware ESXi USB pen drive?
I really like the idea of having a bootable ESXi USB key around as it is useful for quickly spinning up an ESXi install on one of my lab machines. For this project (and also because I didn’t have any spare USB keys or sufficient capacity lying around) I went out yesterday and bought 2 x 2GB USB keys (for £9.99).

In this article I will provide steps for both ESXi pen drive creation methods so you can take your pick.
Two easy methods:

  1. DD for Windows (Command Line)
  2. WinImage (GUI)
  3. ESXi Install CD (ESXi 4.0 Only)

What you’ll need for today’s project is:
1 x USB key (>1GB in capacity). I’m using a 2GB Dane-Elec USB key – never heard of them to be honest but 2 for £9.99 I couldn’t pass up that deal. I have heard from some that not all USB keys work though that said I have never come across one so far that hasn’t. Maybe we could start a list of known USB keys (ie: Manufacturer/Model) that work/don’t work at the bottom of this article in the Comments section.

1 x Copy of the ‘dd’ for Windows utility which can be downloaded from here. At the time of writing this article the latest version is 0.5. After downloading install/extract it onto your PC and take note of the location.

or

1 x Copy of WinImage, downloaded from here.

1 x VMware ESX(i) ISO image either on CD or in file format. Just a reminder that you can download VMware ESXi for free from here.

1 x Copy and install WinRar (Shareware). If you haven’t already got this installed then you should as it’s very useful. It can be downloaded from here.
Location, Location, Location:
There aren’t really any differences between creating a ESXi 3.5 or 4.0 bootable USB pen drive apart from the obvious difference between the actual image file names.

Both of the ‘dd’ image files that you need are located in the INSTALL.TGZ file when this file is abstracted you will find the required ‘dd’ image file in the directories outline below:

VMware ESXi 3.5 (U4)

VMware ESXi bootable USB pen drive

VMware ESXi 4.0

VMware ESXi bootable USB pen drive

Now onto the first method…

Method #1 – ‘DD for Windows’:

Firstly we want to extract the relevant ‘dd’ file from the VMware ESXi ISO image so that we can then apply it to the USB key.

For the purposes of this exercise I am going to build a bootable ESXi USB key based on VMware ESXi U3 (it was a little while ago when I first wrote this article :) though the same still applies to ESXi 3.5 U4 and ESXi 4.0). The file name for this is: ‘VMware-VMvisor-InstallerCD-3.5.0_Update_3-123629.i386’.

Using WinRar open your VMware ESXi ISO using WinRar.

ESX bootable USB

Now whilst still in WinRar open (by double clicking) the ‘INSTALL.TGZ’ file.

ESX bootable USB

From here drill down the directories until you reach the ‘usrlibvmwareinstaller’ sub-directory.

ESX bootable USB

Now double click on the ‘bz2’ file to extract it (in this instance called ‘VMware-VMvisor-big-3.5.0_Update_3-123629.i386.dd.bz2’.

ESX bootable USB

You are now left with a single file with a ‘dd’ extension. This is the file that we are after. Extract this file to the same directory as where the ‘dd’ for Windows utility resides. (Note: The other option would be to add this directory to the ‘Path’ environment variable within your Windows OS so that the ‘dd’ for Windows util can be access via command line from any directory).

We are now at the stage where we’ll use the ‘dd for Windows’ utility to apply the image you just extracted to a USB pen drive. If you have any WinRAR windows left open you can now close them as we will only be dealing with the file with the ‘dd’ extension you just extracted.

Insert your USB key that you wish to have ESXi installed onto into your PC.

With your USB key inserted into your PC open up ‘My Computer’ within the OS and take note of the drive mapping letter that your USB key has been assigned.

In my case it is the F (Removable Drive) drive.

ESX bootable USB

Open up a Command Prompt and navigate to the directory where the ‘dd’ for Windows utility and VMware ESXi image file is located.

ESX bootable USB

Run the command: ‘dd – -list’ (Note: there are two dashes before the list command)

If you are trying to run this from a Windows 7 Beta installation, as I am, you will notice that there is no entry for the USB pen drive (F:) under the ‘NT Block Device Objects’ section (see image below) – this is where we’d usually expect to see an entry for the pen drive and the other attached hard disks. I’m guessing this is down to some incompatibility between ‘dd’ for Windows and Windows 7 Beta.

So this part of the process will need to be performed either using Windows XP or Vista.

ESX bootable USB

I don’t have a Vista machine built up at the moment though so I will perform the remaining steps from within Windows XP where we run the same command (ie: ‘dd – -list’) we get the following output. I have run this process multiple times from a Vista based PC in the past and can confirm it works the same as it does from an XP machine.

After running the ‘dd – -list’ from the XP machine notice how you can now see the hard disks and the USB drive (e:) appear in the ‘NT Block Device Objects’

ESX bootable USB

We are now ready to apply the ESXi image onto the USB drive. To do this use the following command (for more details on the commands click here):

dd bs=1M if=VMware-VMvisor-big-3.5.0_Update_3-123629.i386.dd of=\?DeviceHarddisk1Partition1 –progress

ESX bootable USB

The portion of the command that starts with ‘\?’ specifies the location of your USB pen drive – just to clarify this information you get from running the ‘dd –list’ (see above). This will most likely vary between machines depending on how may hard disks and other USB drives it has attached.

With the dd process running you will see a number that increments like that seen below. The process with generally run for a few minutes whilst the image is applied to the USB key.

ESX bootable USB

Once the process has completed you are then a proud owner of a bootable VMware ESXi USB pen drive!

ESX bootable USB

Insert it into a compatible server/PC and boot to test that it works.

Method #2 – ‘WinImage’:

First begin with starting WinImage (assuming you’ve already installed it).

VMware ESXi bootable USB pen drive

From the ‘Disk’ drop-down menu select ‘Restore Virtual Hard Disk image on physical drive…” as you want to restore the VMware ESXi image into your USB pen drive.

VMware ESXi bootable USB pen drive

The next screen (below) should show you a list of all your attached removable drives. If you have multiple removable drives attached then take care to select the correct USB pen drive – don’t want any accidents happening to we? :)

Select you USB pen drive to write the ESXi image to and click ‘Ok’

VMware ESXi bootable USB pen drive

See image below – to select your VMware ESXi ‘dd’ image file.

VMware ESXi bootable USB pen drive

Once you have selected ‘All files (*.*) ‘ and can now see you ESXi ‘dd’ image file select ‘Open’

VMware ESXi bootable USB pen drive

Select ‘Yes’ at the ‘Warning’ screen..

VMware ESXi bootable USB pen drive

The VMware ESXi image at this stage is now written to your select USB pen drive.

VMware ESXi bootable USB pen drive

Once the ESXi image has been written when you open your USB pen drive within Windows Explorer, containing the ESXi image, you should see the following few files. You don’t have to perform this step – only if you want to check to see if the image was written successfully.

VMware ESXi bootable USB pen drive

Method #3 – ‘ESXi Install CD’ (ESXi 4.0 Only):

This third option is the easiest and most hassle free of all. From ESXi 4.0 you get the ability to install a USB pen drive into a USB port of your server and then boot from the ESxi 4.0 installation CD. When you get to to stage in the installation process to select the destination for the ESXi install you should see your USB pen drive as a destination along with your server’s internal hard disk.

Just select your USB pen drive as the target for the ESXi 4.0 install and follow the rest of the installation process through – everything going to plan you should see it install onto your USB pen drive.

SPECIAL THANKS TO: http://www.techhead.co.uk for this post

Continue Reading

Create a bootable VMware ESXi 5 USB stick in Windows and perform a scripted installation

Step 1
Be sure removing all partitions and format a FAT32 partition on the USB stick by using the following command:

Open the command prompt and enter the following commands:

diskpart (make sure you run diskpart as administrator)
list disk (list the disk in your system including the USB)
select disk USB number
clean
create partition primary
active
format fs=fat32 quick
assign
exit

Step 2
Download the Windows LinuxLive USB creator utility here.

Step 3
Start the Lili USB creator utility.

image

Follow the steps 1,2,4 and click 5 to create the USB stick. Wait till the USB creation process is finished.

Step 4
Edit the BOOT.CFG file in the root of the USB stick and add ks=usb between /b.b00 and — /useropts.gz modules

The BOOT.CFG should look like this:

bootstate=0
title=Loading ESXi installer
kernel=/tboot.b00
kernelopt=runweasel
modules=/b.b00 ks=usb --- /useropts.gz --- /k.b00 --- /a.b00 --- /ata-pata.v00 --- /ata-pata.v01 --- /ata-pata.v02 --- /ata-pata.v03 --- /ata-pata.v04 --- /ata-pata.v05 --- /ata-pata.v06 --- /ata-pata.v07 --- /block-cc.v00 --- /ehci-ehc.v00 --- /s.v00 --- /weaselin.i00 --- /ima-qla4.v00 --- /ipmi-ipm.v00 --- /ipmi-ipm.v01 --- /ipmi-ipm.v02 --- /misc-cni.v00 --- /misc-dri.v00 --- /net-be2n.v00 --- /net-bnx2.v00 --- /net-bnx2.v01 --- /net-cnic.v00 --- /net-e100.v00 --- /net-e100.v01 --- /net-enic.v00 --- /net-forc.v00 --- /net-igb.v00 --- /net-ixgb.v00 --- /net-nx-n.v00 --- /net-r816.v00 --- /net-r816.v01 --- /net-s2io.v00 --- /net-sky2.v00 --- /net-tg3.v00 --- /ohci-usb.v00 --- /sata-ahc.v00 --- /sata-ata.v00 --- /sata-sat.v00 --- /sata-sat.v01 --- /sata-sat.v02 --- /sata-sat.v03 --- /scsi-aac.v00 --- /scsi-adp.v00 --- /scsi-aic.v00 --- /scsi-bnx.v00 --- /scsi-fni.v00 --- /scsi-hps.v00 --- /scsi-ips.v00 --- /scsi-lpf.v00 --- /scsi-meg.v00 --- /scsi-meg.v01 --- /scsi-meg.v02 --- /scsi-mpt.v00 --- /scsi-mpt.v01 --- /scsi-mpt.v02 --- /scsi-qla.v00 --- /scsi-qla.v01 --- /uhci-usb.v00 --- /tools.t00 --- /imgdb.tgz --- /imgpayld.tgz
build=
updated=0

Step 5
Create a Kickstart configuration file for the scripted installation in the root of the USB stick. Here is an example:

#Sample kickstart scripted installation
vmaccepteula
rootpw VMw@re
install --firstdisk --overwritevmfs
network --bootproto=static --ip=192.168.250.21 --gateway=192.168.250.1 --nameserver=192.168.250.6 --netmask=255.255.255.0 --hostname=esxi5-01.beerens.local --device=vmnic0 --addvmportgroup=0
reboot

%firstboot --interpreter=busybox
# Rename local datastore name
vim-cmd hostsvc/datastore/rename datastore1 "$(hostname -s)-local-storage-1"
# DNS names
esxcli system hostname set --fqdn=esxi5-01.beerens.local
esxcli network ip dns search add --domain=beerens.local
# DNS server addresses
esxcli network ip dns server add --server=192.168.250.6
esxcli network ip dns server add --server=192.168.250.1
# SSH and ESXi shell
vim-cmd hostsvc/enable_ssh
vim-cmd hostsvc/start_ssh
vim-cmd hostsvc/enable_esx_shell
vim-cmd hostsvc/start_esx_shell

For editing and creating the boot.cfg and ks.cfg file in Windows I use Notepad++ so NO hidden carriage returns are in the files. And the USB stick creation in ready.

SPECIAL THANKS TO: http://www.ivobeerens.nl/ for this post.

William Lam’s blog has real good information about Kickstart scripts found here.

Continue Reading

McAfee is blocking email on SMTP port 25

By default McAfee Enterprise, and some other versions, automatically block port 25 by default. This is an Anti-MailWorm feature. To disable it, do the following:

  • Rt Click on the McAfee icon in your system tray
  • Select “Open VirusScan Console” or Manage Features > VirusScan Enterprise. Depending on the version you have.
  • Double click on Access Protection Properties, this will open the dialog for this area
  • Under Anti-Virus Standard protection there is a rule that is set to block, it is “Prevent Mass Mailing Worms from Sending Mail
  • Uncheck the box under BLOCK and you are all set….click ok, and try it again. A reboot is NOT needed.
Continue Reading

Creating a Keystore for LDAP SSL

Exporting your Active Directory Certificate
As an Administrative user on your Active Directory server:

  1. Open the Microsoft Management Console by running mmc.exe.
  2. Add the Certificates snap-in for the Computer Account (select the Local Computer).
  3. Locate your certificate in the resulting tree. If you are using a self-signed certificate then this will appear under the Personal folder.
  4. Right click on the certificate, select All Tasks > Export.
  5. Export the certificate (without the private key but will all associated trusted certificates) in Base 64 format.

Creating a Keystore
Once the certificate has been exported you will be able to create a keystore with this certificate that you can use to access your Active Directory server.

  • To do this you will use the keytool (keytool.exe on Windows) utility supplied with your Java runtime with the following command:

keytool -import -alias ldap -file <certificate file> -keystore shdomain.ks

  • Enter a secure password for your keystore. This will create a keystore file called shdomain.ks
Continue Reading

Missing Sharing Tab in Windows 2003

Problem

I wanted  to share a certain folder in windows 2003 server, but when I entered the folder’s location > properties , I didn’t see the Sharing tab. (as shown below)

Resolution

Go to start > run > Services.msc > Start the Server service . (as shown below)

In my case , the Server service was stopped due to lack of certain security patches in that server. In order to solve this problem for good , update the server using Windows Update. In order to solve the problem temporarily, start the Server service.

Continue Reading