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:
- Get the driver: You can find most drivers as oem.tgz here.
- 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).
- 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.
- 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:
- Move from DHCP to static IP. Makes it easier to remember the IP number.
- 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 22.214.171.124).
- Enable local tech help mode (which lets me login on the local console into shell).
- 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:
- You can login locally to do what you can with shell.
- You can ssh into the box to do the same.
- You can run remoteCLI that VMware gives.
- You can use web services SDK and forge your own programs.
- 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:
- You can use vmware converter to convert the existing physical machines. It can covert to and upload the image to the hypervisor.
- 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.