Syed Jahanzaib Personal Blog to Share Knowledge !

September 10, 2012

Howto enable SNMP on ESXi 5

Filed under: VMware Related — Tags: , — Syed Jahanzaib / Pinochio~:) @ 1:10 PM

To enable SNMP on ESXi 5 , First enable SSH service
You can read following article on howto enable ssh using vsphere client.

Now using vSphere CLI, type -server -username username -password mypass -c zaibsnmp

(you can change zaibsnmp to any name you like for the community name) -server -username root -password mypass -enable

& you will see

Enabling agent…



Syed Jahanzaib

August 30, 2012

Vmware ESXi 5.0 Update1 Autostart breakup Fix !

Filed under: VMware Related — Syed Jahanzaib / Pinochio~:) @ 4:19 PM

In my company, we have two virtual servers based on Microsoft Hyper-V & Free version of ESXi 4.0 running 10 guest OS. We did planned to convert all of our physical machine to virtual to get benefit from underutilized modern hardware. Last week I decided to move our Domain Controller & ADC to virtual (which were installed on IBM Xseries physical serve machines).

As a rule of thumb, always test any new / trial product in LAB before deploying it on production server, following this theory I installed Vmware ESXi 5.0 Update 1 on vmware workstation 7.x and found out a BUG that guest vm’s do not auto start anymore when the host ESXi starts (In previous versions i.e 4.x , they auto start normally if they are set to autostart). This is a bug for the FREE version of the hypervisor. (For example if you have installed the FREE License key provided by vmware)

After some googling, I found out that There were some changes made in the way the ESXi APIs are accessed in Update 1 that unfortunately breaks the Guest VM Auto Start feature.

Here is a quick workaround to give you the autostart functionality in traditional Linux style.

If you haven’t done so already, Do Enable SSH on the ESXi host server. This can be easily done using Sphere client.

  • Connect to ESXI using Vsphere client.
  • Goto Configuration Tab | Security Profile | in Services, click on Properties
  • Highlight SSH | Select Options | Service Commands | Start
  • Use any SSH client like PuTTY) to log into your host server. As showed in the image below

In my case, I only wanted to auto start only single guest vm  (Which is my test DC)  So first We need to get the VM ID’s for the virtual machines. Use the following command to do so. Make note of the ID numbers in the first column

Use the following command to get the VM ID of the machine you want to start.

vim-cmd vmsvc/getallvms

You will get results something like below ( I only have one test machine, so only one entry is visible)

Vmid          Name                                File                               Guest OS         Version   Annotation
1      TestPC-4-Autostart   [store] TestPC-4-Autostart/TestPC-4-Autostart.vmx   win2000AdvServGuest   vmx-08

The VM ID for test pc guest OS is 1

Use vi to edit /etc/rc.local  – & Insert the following startup lines above the IF statement and save.

vim-cmd vmsvc/power.on 1

[VI TIP: to enable editing, press i , now add your lines, to save, press ESC, now press shift+: & type wq and press enter]
As showed in the image below . . .

Save & Exit.

Now reboot the ESXi host server.

After reboot completes, you will see the target guest OS Auto starting this time.

Auto Start All VM’s guest OS

TIP: If you want to start all vm’s you need to add them as follow

vim-cmd vmsvc/power.on 1
sleep 180
vim-cmd vmsvc/power.on 2
sleep 180
vim-cmd vmsvc/power.on 3
sleep 180

Change the ID number as per your configuration. Now after starting 1st VM, ESXi HOST will wait 180 Seconds (3 minutes) to start second one and so on. You can change this number as per your hardware/software load.

I hope you will find it useful.


Syed Jahanzaib

July 4, 2012

Howto power ON ESXi Guest machine using CLI & howto link it to the DUDE :)

Filed under: Mikrotik Related, VMware Related — Syed Jahanzaib / Pinochio~:) @ 10:08 AM

I recently developed a Centralized Network Monitoring System using Mikrotik’s base THE DUDE . It is an amazing free application through which you can completely monitor your network environment and can perform various task also using single screen via web or console. I added various advance monitoring probes , You can find its demo screenshot at following link.

I decided to upgrade it from simple networking monitoring system to monitoring+management system I was already using its tool menu through which I was able to do RDP to any target windows pc, or Shutdown / Power ON any PC on the map or run any custom script to restart service on specific server, but the problem was that guest machines on VMWARE ESXI 4.0 were not responding to WOL packets (Magic Packets to power ON machine over the network), I searched over the internet but couldn’t found any solution to this, so I made my own scripts to fulfill the task.

First you need to enable SSH on your vmware ESXi box, You can enables ssh by using following guide

Once SSH is enabled, test it by using any ssh client , for example PUTTY.

After successful logged in to ESXi host using putty, we have to find the guest machine VM ID which we want to power on, use the following command to list all machines

vim-cmd vmsvc/getallvms

You will get result something like below, Look for the VMID of the machine you want to get,

Vmid       Name                                              File

112            vmserver1 – WSUS                     WSUS/WSUS.vmx
16              vmserver2 – Symantec             symantec/symantec.vmx
96             vmserver3 – SAMETIME         vmserver3/vmserver3.vmx

For example you want to power ON the vmware1 – WSUS machine having vmid 112 , use the below command

vim-cmd vmsvc/powen.on  112

Now we can use above command and wrap it in any script or batch file or link it with the DUDE tool menu

For example if you want to execute above command using PLINK (Which is used to execute command on remote ssh server using ssh tunnel) in any batch file, use the below command

\\dudepc\share\plink.exe -ssh -l root -pw zaibpass “vim-cmd vmsvc/power.on 112”

If you want to link it to dude Tool menu, Follow below steps
Open DUDE console, from left menu, Goto TOOLS , Click on + sign to add Tool

Type: Executable
Name: Power ON ESXi Guess OS
\\dudepc\bin\plink.exe -ssh -l root -pw zaibpass “vim-cmd vmsvc/power.on 112”

Click on OK to save , Now open your map, right click on your desired target (vm guest) and goto tools menu, and your new tool will be appearing there, click on it and the script will execute. Its recommended to test the command before putting it on any batch file or script.

Syed Jahanzaib

Howto Enable SSH in VMWARE ESXi 4.0

Filed under: VMware Related — Tags: , , , — Syed Jahanzaib / Pinochio~:) @ 9:16 AM

Today I was in need to execute some scripts on ESXi 4.0 server via remote to power ON the VM guest machine , but there is no menu to enable ssh  in ver 4.0, so I followed below steps to enable ssh on esxi 4.0
Free version of ESXi do have ssh service available but its disabled by default.

Goto your ESXI server, At the console , press ALT-F1 ,

Type unsupported in the console and then press Enter. The text typed will not be show over the screen, so be careful while typing ,  If you typed in unsupported correctly, you will see the password prompt.
Now Enter the password for the root login.

# You should then see the prompt of ~ #
Now we need to Edit the file inetd.conf in order to enable ssh service, Open it in vi editor

vi /etc/inetd.conf

Find the lines that begins with #ssh and remove the #
Then save the file.
by pressing ESC and type in :wq  ,

Once you’ve closed the vi editor, you can either restart the esxi server
Restart the inetd process only by following steps.

To restart inetd run , we first need to find the pid of inetd process by following command

ps | grep inetd

The output of the above ps command will be something like

4886     4886     busybox          inetd

the process ID in this example is 4886. Now run

kill -HUP 4866 

Now try to login to your ESXI 4.0 via putty or any other ssh client, Hopefully It will work fine 🙂

Good thing about new ESXI 4.1 version is that it supported enabling SSH via main console, no need to go back to black screen, i mean cli.
http ://

Syed Jahanzaib

June 15, 2012

Injecting RTL Driver in VMware ESXi 4.1 ISO using Windows OS

Howto inject RTL driver support in VMware ESXi 4.1 using VMware Customizer 2.7 in Windows OS 

I was installing vmware esxi on my test lab PC (Intel Desktop Board with RTL 8111 chipset NIC) but the Installation failed after I accepted the EULA and system halted.

unable to load module /usr/lib/vmware/vmkmod/vmfs3: failure

I tried several times to restart the installation but with the same error. After some googling , I found that my NIC was not in ESXi HCL (Hardware Compatibility List), This message usually points to incompatible NICs.  The list of supported components is short for a reason. Most embedded NICs on desktop motherboards just do not stand up well under load. Since in a virtual environment all the Virtual machines are sharing the NICs it doesn’t make much sense to even consider supporting something that isn’t well proven.

Fortunately I found driver pack for rtl 8111 , but I had to do some driver injection in ESXi ISO File. Following is the procedure on How I solve this problem.


# Windows 7 or +
# Copy of ESXI 4.1 Server in ISO format (Click here to Download) [Registration Required]
# RTL8111_8168_P55_integr_SATA_Ctrl.(AHCI).oem.tgz  (Click here to Download)
# VMware Customizer 2.7   (Click here to Download)

– Create a new Folder e.g esxi , Copy ESXi 4 ISO file in this folder,
– Download  RTL OEM TGZ file in same Folder,
– Download VMware Customizer in same Folder, then Execute it,
As showed in the image below . . .


*   In first Browse Field, Select the ESXi 4 ISO image,
*   In Second Browse Field, Select the Drive Pack in OEM TGZ format
*   In Third Browse Field, Select any folder where updated iso image output will be placed

Now cick on RUN to execute process . Once the operation begins, you will see something like below . . .


After completion of the process, it will notify you with the success results. Now burn this updated file on the Cd, and boot from this CD on your Server, and this time it will boot smoothly without giving you the error.

Happy Injecting 😉


Syed Jahanzaib

February 22, 2012

Vmware ESXi 4.x Installation Guide [Short Reference]

Filed under: VMware Related — Tags: , , , — Syed Jahanzaib / Pinochio~:) @ 12:35 PM

I received many emails regarding howto install and configure Vmware ESXi Server .
Following is an short reference guide for beginners. This guide will illustrate you howto install ESXi from beginning till creating Virtual machines in ESXi using VSPHERE Client. Believe me its realy simple :)~

First, Some Overview to VMWARE ESXi and it’s features.

ESX and ESXi do not run on a general purpose OS like Windows or Linux.  They install and run directly on your server hardware, which is why they are called “bare-metal hypervisors
it does not run atop a third-party operating system,but instead includes its own kernel. Up through the current ESX version 5.0, a Linux kernel is started first, and is used to load a variety of specialized virtualization components, including VMware’s vmkernel component. This previously-booted Linux kernel then becomes the first running virtual machine and is called the service console.

Ok let’s START 🙂

First you have to register yourself at vmware site, the registration is free 🙂
Just goto

and on the right side ” Register to download your Free Product ” window, click on CREATE an ACCOUNT,
After registration process, login with your id and you will see all vmware products for downloads.
Select VMware vSphere Hypervisor 4.1 License (ISO Format)

After downloading, burn it to CD (or if you trying it in vmware workstation , use it to boot)

Boot from ISO image OR CD, You will see VMware Boot screen.
As shown in image below

Select ENTER to select ESXi installer,

Now It will start detecting  your hardware After it, Welcome screen will appear.

Press ENTER to continue

END User license screen will appear,

Press F11 to continue

Now HDD / Storage Selection screen will appear,
select your hdd and press ENTER
As shown in the image below

Now Confirm Install screen will come.
Press F11 to confirm and the installation will begin.

It usually takes 3-5 minutes to install, After Installation complete screen appears, press ENTER to Reboot. By default you have 60 days time to enter License, after 60 days it will expire. (See the Tips ‘n Trick section of this article)

After reboot completes, VMWARE ESXi will start loading its kernel and other components
Now you will see following window.

To customize ESXi for id/password and network management,
Press F2 and you will be prompted to ENTER id password
default id is ‘ root
and password is empty, just ENTER ,
Now you will see something like

First configure your root password. (its necessary so that it can secured)

Now set IP address for ESXi so that you can manage it remotely using vmware Vshpere Client 😀
Select “Configure Management Network
Select “IP configuration

Here Select “Set Static IP Address
and enter your IP Address information.
As shown in the image below . . .

After entering info,
Press ESC to continue
Again Press ESC to continue, and it will ask you to Apply changes
Press Y to continue

ESXi basic setup is complete,
its time to test it
open your browser and open http://esxi-ip-address
and you should see something like below image

OK, ESXi is installed and ready to be explored , its time to hit the road,
I mean configure ESXi and then create virtual machines using Vsphere client to manage ESXi server.

From your Management pc (Winxp, Win7 or any version)
Download VSphere Client from

Installation of vmware vsphere client is very simple,
After installation is done, Open it, You will see something like below image

Enter your IP address of ESXi server, id and password (that you have configured in management section.). If you see any certificate warning , you can safely ignore it.

Now you will see your VMware ESXi Server.
As shown in the image below . . .

From here you can create virtual machines.
But first you have to add some STORAGE to store vm related material.

On the main screen , click on “Click here to create a database

and follow on the screen below.

Done, Now that you have created STORAGE, you can create new VM to get started.


Howto create New Virtual machine in ESXi

Connect to ESXi using VSPHERE client, on the main screen, click on “NEW VIRTUAL MACHINE
As shown in the image below . . .

ESXi 4.x Keys

*** I used this one on 4.1 esxi
MU412-DH3E7-48908-R0AEK-13K40 (Unlimited VMs)

vSphere Enterprise Plus
5V0NA-A2K05-H85Q1-FT1EM-CG8P8 (Unlimited CPUs)
MU412-DH3E7-48908-R0AEK-13K40 (Unlimited VMs)

vCenter Server

vCenter Server Foundation

vSphere Standard
4U6JK-DGJ17-M88V8-VHAEM-3P068 (Unlimited CPUs)
0G6T2-07L5P-H8071-DUCE6-0U82F (Unlimited VMs)

vSphere Advanced
JZ0TK-D1304-48DK1-2V8EK-3QKN8 (Unlimited CPUs)
0G4WR-FCK13-48E28-3JAQ6-C3AQ8 (Unlimited VMs)

vSphere Enterprise
NY018-AQK07-M89Z0-U32NP-C28H0 (Unlimited CPUs)
4U6RU-49KDN-48190-XC3Z6-CCH3D (Unlimited VMs)

ESXi 5.0 U1


vCenter 5 Standard Edition License Key

0G03V-2F1EL-ZZCY8-QT27P-93421   ***

VMware vSpher 5.0 Enterprise Plus (Unlimited CPU)

VMware vSpher 5.0 Enterprise Plus (Unlimited VM)

VMware vSpher 5.0 Desktop Host (12 Core)

VMware vSpher 5.0 Desktop Host (Unlimited VM)

VMware vSpher 5.0 for VCloud Service Provider Standard

VCenter Server 5.0 Foundation

VCenter Server 5.0 Essentials (Unlimited Server)

VCenter Server 5.0 Essentials (Unlimited Vram)

VMware View Premier

VMware View Enterprise

Difference between “I COPIED”  &  “I MOVED

I copied it

If you select “I copied it” the following setting in the target Virtual Machine .vmx configuration file are changed.


Which makes the copied Virtual Machine appear uniquely different the the original.  Useful if you are running multiple copies of same VM on the same network.

I moved it

If you’re running a single copy of the target Virtual Machine at a time then you may want to chose “I moved it” to avoid possible activation issues with come OSes and or Software that registers the Ethernet MAC as part of its checksum.



« Newer Posts

Blog at