Aug 032011
 

In today’s installment, I will show how to install a hypervisor. I choose a free product VMware hypervisor to install on my computer so that I can run VM’s.

What is a hypervisor? It is an hosting environment to run virtual machines. There are two kinds. The first kind runs on the bare metal (no OS needed) and the second one runs on an OS. Naturally, the first kind is faster. In case of VMware hypervisor, it runs a barebones version of Linux with hypervisor software, file system and a few other tools.

Step 1: Download the software

Hypervisor itself is free, which you can download it at: http://www.vmware.com/go/esxi. Make a note of the license number they give you – you need that later. The old name for hypervisor is ESXi. You will find references to vSphere, which is the enterprise version which costs lots of money. You need vSphere Client as well, but that can wait. The software comes in the .iso format. You can mount it in windows using http://www.daemon-tools.cc/eng/products/dtLite (daemon tools).

Step 2: My machine is not supported!

First thing I did was to burn the iso to the the DVD. I installed Linux countless times from 1994 and thought I could get this past quickly. Little did I know that VMware removed support for standard components like Mobo based network interfaces. Too bad.

First thing is to remember what components I have in my system. The mobo (mother board) information comes up during boot times, but I still wanted a complete list. An evaluation copy of AIDA 64 listed the complete list of the machine hardware details after I installed in that machine.

What I need is to do the following:

  1. Get the driver: You can find most drivers as oem.tgz here.
  2. You need to modify the boot image. You can use ESXi customizer for this purpose. It creates a new iso for you.

At this point, you will be running out of DVD’s to burn. I wanted to use flash drive to install my OS. That way, if there is a mistake, I can always rewrite that.

Step 3: Creating a bootable flash drive

Most mother boards support booting from flash drives. When booting up, you can enter the setup (by pressing DEL often, but it tells you what to press to edit the setup) and edit the boot sequence. You may have to insert the flash drive before and rescan it and then setup the boot sequence. That is what I did.

To prepare the flash drive, there are several ways. Here are the two methods (thanks to: vmhelp site).

  1. Use syslinux(make sure you use version 3.8x – the version 4.x doesn’t work):
    • First format the flash drive in DAT32 mode.
    • Go to syslinux/win32 folder and run the command: syslinux.exe –mbf G: (assuming G: is where your flash drive is).
    • Copy the contents of the iso that you created with ESXi customizer. Again, mount the iso using daemon tools.
    • Rename the isolinux.cfg to SYSlinux.cfg.
  2. Use Unetbootin for creating the flash drive.

Once you created the boot drive, you will notice that you still will encounter issues. Specifically, the system needs to know that it needs to copy files from the flash drive. Here is what you can do, using kickstart script.

First edit the syslinux.cfg file:

menu title VMware VMvisor Boot Menu
timeout 80

label ESXi Installer
menu label ^ESXi Installer
kernel mboot.c32
append vmkboot.gz ks=usb --- vmkernel.gz --- sys.vgz --- cim.vgz --- ienviron.vgz --- install.vgz --- mod.tgz

label ^Boot from local disk
menu label ^Boot from local disk
localboot 0x80

All we did is to add  ks=usb Now, we need to create a ks.cfg in the following way:

vmaccepteula
rootpw password
autopart --firstdisk --overwritevmfs
install usb
network --bootproto=dhcp --device=vmnic0

Thanks to Jonathan Medd for this guidance. Now, boot from the flash drive and finally, the system will copy the files to the first bootable drive and complete the installation. Finally, remove the flash drive and reboot the system. Before the reboot is done, for a good measure, adjust the booting sequence.

Step 4: Configuring the hypervisor

When you first login (remember the login password that you specified in the ks.cfg file (password)), you can do a few adjustments. This is what I did:

  1. Move from DHCP to static IP. Makes it easier to remember the IP number.
  2. Set the DNS to static DNS (I have a forwarding DNS running on a different machine, that caches the requests – I use that as well as google’s which is 8.8.8.8).
  3. Enable local tech help mode (which lets me login on the local console into shell).
  4. Enable remote tech help mode (which lets me login via ssh).

The last two are not a good idea security wise, but I decided to do it temporarily.

Step 5: Installing the client

There are four/five ways to interact with the hypervisor:

  1. You can login locally to do what you can with shell.
  2. You can ssh into the box to do the same.
  3. You can run remoteCLI that VMware gives.
  4. You can use web services SDK and forge your own programs.
  5. You can use vSphere Client, a gui program to create/manage your virtual machines.

Naturally, most people opt for the last one. I am doing the same too (except that I use the ssh as well. More later). The licensing restricts some functionality. It would be fascinating to see if web services are also restricted.

Btw, once you start the vSphere client, you can provide the license that you got when you were downloading. Otherwise, you are in 60 day evaluation mode.

Step 6: Installing an existing VM

The web is replete with virtual machines. Most virtual machines are created for use in VMPlayer. THe hypervisor only lets you create/clone machines. How do you transfer the new machines in here? As I see it, there are two choices:

  1. You can use vmware converter to convert the existing physical machines. It can covert to and upload the image to the hypervisor.
  2. You can move the vmdk file to the hypervisor (you can use scp or winscp)  and convert the file with the following command: “vmkfstools -i sourcefile.vmdk destinationfile.vmdk”. After that, when you are creating the virtual machine, you can link into this file.

I did the second type.

In the next posts, I will describe the machine setups that I am planning on (mostly for various BI projects that I am planning on). Specifically, I will see if we can use openstack with this hypervisor.

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)