PDA

View Full Version : Virtualizing Servers using VMWare ESXi



Tomm
11-07-2009, 08:42 PM
Hey,

---THIS IS IN THREE POSTS DUE TO THE LIMITATIONS IMPOSED TO THE MAX NUMBER OF IMAGES IN A POST---

I've seen some people wanting to setup servers at home and I thought I most post a tutorial on how to virtualize a number on servers on one physical server. In these tutorial I will be useing the freely avaliable VMWare ESXi 4 (More information and free download at http://www.vmware.com/products/esxi/) and you'll need a spare computer/server that you want to install it on. The server requires a minimum of a 64bit processor and 2gb of RAM else it will refuse to install. Additionally not all hardware is supported (Most server/enterprise hardware is supported, but your old spare computer will most likely have hardware that is not supported) and you should check compatibility at http://www.vmware.com/go/hcl although some hardware not listed on that site may also work - might as well attempt it! If you want to run 64bit guests (guests are virtual machines running on the phyiscal server or host) then you'll need a processor that supports Intel VT or AMD-V but you can still run 32bit guests if you lack such a feature.

A word of warning: Installing ESXi will erase the contents of your hard drive and is NOT supported in a multiboot environment - don't try and install it alongside another OS to test it out. Also if you can, I recommend you install it onto a USB pen drive and just use the hard drive for storing VMs (If you want to get fancy you can use a SAN but that is beyond the scope of this tutorial).

Right, I am assuming at this point that you have got a free license, downloaded the ISO and burned it to a disk. You should now put that disk into the machine you want to install it on and boot from the disk. Assuming all went well you should see the installation firing up:

http://img243.imageshack.us/img243/5820/74732248.png

Once it has finished loading (Could take some time) you'll be presented with a license agreement to accept along with a warning about that you should check the HCL for compatibility with your hardware. Accept both messages.

Next you'll be presented with a option of what device you want to install to. If you took my recommendation of installing it to a USB pen drive then select it, otherwise just select the hard drive you want to install to:

http://img232.imageshack.us/img232/4184/56985010.png

If the installation program detects stuff on that device then it will warn you about it before proceeding. Before the installation you get a final message to confirm you want to install ESXi:

http://img9.imageshack.us/img9/927/78047782.png

You should begin to see the installation take place which, again, may take some time:

http://img16.imageshack.us/img16/516/26364244.png

Assuming all went well you should be presented with a message telling you that the installation had completed. You should listen to its advice and remove the disk from the drive before pressing the enter key to reboot.

http://img243.imageshack.us/img243/5060/85386019.png

http://img189.imageshack.us/img189/4473/10620438.png

Once the server has rebooted you should see it start booting into ESXi:

http://img200.imageshack.us/img200/9325/85374704.png

After it has finished loading and starting up stuff you should be given a simple screen as follows:

http://img189.imageshack.us/img189/5036/86600036.png

Before we can download the tools we need to manage it from another computer there is a few things we need to do from the actual machine. Press F2 to enter the setup menu and you'll enter into the configuration screen:

http://img16.imageshack.us/img16/2734/42263343.png

Select "Configure Password" and press enter, type in a new password, repeat it, and press enter (Remember this password as you'll need it to configure the server remotely as well as to access the configuration menu in feature):

http://img200.imageshack.us/img200/6954/81704301.png

Next, scroll down to "Configure Managment Network"...

http://img11.imageshack.us/img11/5192/49151724.png

..press enter and you'll be given a new set of options:

http://img301.imageshack.us/img301/1095/33262796.png

Scroll down to IP Configuration and press enter. On the next dialog, scroll down to "Set Static IP Address and Network Configuration" and press the spacebar followed by Enter. This prevents the ESXi host getting assigned a new -and potentially different- ip address when it starts up thus causing confustion when you want to manage it.

http://img9.imageshack.us/img9/8517/28517650.png

Keep pressing escape until you are prompted to restart the managment network to which you should press y to accept:

http://img243.imageshack.us/img243/3017/71764909.png

After logging out of the configuration menu you'll be returned to the default screen (Which loses its color if you wait long enough, a sort of screensaver I guess :P). Note how the IP address is now followed by (STATIC) rather than (DHCP). Make a note of this IP address as you'll need it for the next step.

http://img301.imageshack.us/img301/5143/87150709.png

From another computer on the same network as the ESXi server enter the IP address that you saw in the previous step into a web browser (Ill be using firefox).

http://img27.imageshack.us/img27/4749/68203528.png

If you are using anything like a fairly modern browser you'll be warned that the certficiate is not valid, in firefox just select I understand the risk and click on add exception to bring up the following window:

http://img27.imageshack.us/img27/5595/71558828.png

To which you should click on confirm security exception which should now allow you to see the website:

http://img189.imageshack.us/img189/842/88098119.png

Click on "Download vSphere Client" to download the application we need to manage the server.

http://img200.imageshack.us/img200/5397/78558470.png

When prompted just save or open it - upto you.

http://img16.imageshack.us/img16/8453/87529390.png

Once it has downloaded run it. You may have noticed i've jumped from Windows 7 to Windows XP. This is because how the .NET framework works in Windows 7 which causes the client to not work properly (You can't login :P) so i'm running it in Windows XP mode (Download at: http://www.microsoft.com/windows/virtual-pc/download.aspx if you are using Windows 7). See how useful virtualisation is? :D

http://img27.imageshack.us/img27/9438/84788073.png

When prompted, I recommend you to install the vSphere Host Update Utility because without it you won't be able to remotely update the host if a new patch/version comes out.

Tomm
11-07-2009, 08:43 PM
http://img200.imageshack.us/img200/7619/25149177.png

Once it is installed, enter the IP address of the host (Yes I know its changed from 192.168.2.6 to .6 because I am actually about to show you on my actual real ESXi server I use at home :P You should use your IP you wrote down earler though), enter the username as root and enter the password you setup on the host.

http://img243.imageshack.us/img243/6170/26404867.png

You'll most likely get presented with a screen like this. Just tick "Install this certificate.." and click ignore and you won't get it again when logging in.

http://img232.imageshack.us/img232/8186/91469056.png

If you managed to set all the details right you'll get given this screen. Click Inventory to bring you to the screen that should contain your ESXi server and any VMs (Which will be none at the moment, unlike my server):

http://img243.imageshack.us/img243/5010/29601702.png


-----

CREATING VIRTUAL MACHINES ON YOUR ESXi SERVER

----

Before we start make sure you have the ISO image of the operating system you want to install and you are actually able to install it - this is not a guide on how to install a operating system :P

Click on the summary tab (Make sure your esxi server is selected in the left pane):

http://img12.imageshack.us/img12/5272/57523926.png

Right click on "datastore1" under datastores and click Browse Datastore:

http://img402.imageshack.us/img402/3806/26664896.png

Click on the little "New Folder" icon since we are about to create a new folder to store all our ISOs in:

http://img402.imageshack.us/img402/9245/48324110.png

Type the name of the folder (I'm going to use ISO since, well, it stores ISOs :D)

http://img39.imageshack.us/img39/9977/43141508.png

Select the folder on the left pane and click the "Upload Files to this Datastore button":

http://img39.imageshack.us/img39/786/10650350.png

Browse to the location of the ISO on your computer and click Open.

http://img39.imageshack.us/img39/4021/88187611.png

Click yes to this message to start the upload process.

http://img146.imageshack.us/img146/7182/72357083.png

Once it has uploaded, close the datastore window and right click on your ESXi server on the left pane and click "New Virtual Machine":

http://img189.imageshack.us/img189/8470/31586339.png

Select "Custom" in the wizard since the default option just sets all the recommended settings for the operating system you plan to install which is not really a good idea.

http://img12.imageshack.us/img12/2206/42876053.png

Click next and you'll be asked to type the name of the virtual machine. Give it a sensible name related to what it is or what it is used for (Not like Dummy Machine for instance :P)

http://img402.imageshack.us/img402/9839/33333121.png

On the next step, you'll be asked to select what virtual machine version you want to use. Select version 7 unless you have any specific plans to downgrade for some strange reason :8

http://img146.imageshack.us/img146/1259/41522432.png

For the next step you'll be asked what operating system you plan to install. Select the OS type and version you are going to install and hit next.

http://img402.imageshack.us/img402/2997/65954179.png

Selecting the amount of CPUs you want is limited by the number of logical CPUs avaliable on the host. Unless there is a specific reason not to then I recommend you select the max avaliable.

http://img402.imageshack.us/img402/4914/39461540.png

Now you have sucessfully managed the task of picking a number from a list you are required to enter another number. This time you need to pick how much RAM you want to make avaliable to the guest OS. Note that you can select much, much more RAM than is actually installed on the host server but I strongly recommend you do NOT do this. Select a reasonable number based on how many other VMs you plan to run and what operating system you are installing it on. Helpfully hints are given based on the OS you selected but you can, in most cases, get away with running it with less than recommended or even the minimum.

http://img189.imageshack.us/img189/1471/74026771.png

On the next step you'll need to select what controller you want to present to the guest OS for accessing the disks. I recommend, unless you have a specific reason not to, that you accept the default value.

http://img189.imageshack.us/img189/3223/97750651.png

When you have hit the next button it will ask you want disk you want to use. Since we don't have any virtual disks go ahead and select that you want to create a new disk and hit the ol' next button.

http://img402.imageshack.us/img402/1461/74093143.png

Tomm
11-07-2009, 08:43 PM
Select the capacity of the disk. You can increase the size of the virtual disk at a later point but extending the volume created on that physical disk may not be so easy, especially if it is the boot disk.

http://img18.imageshack.us/img18/9828/26392357.png

Leave the next options as the default value. They are used if you have multiple disks and you want to configure what port they are connected to on the virtual disk controller. The independant option is really only useful if you actually use the snapshot (Stores an excact copy of the VM, including current state, that you can restore at a later point) feature and don't want it to affect that drive.

http://img402.imageshack.us/img402/3743/24261939.png

Finally after hitting that next button for the last time you'll be presented with a summary of the virtual machine. Hit finish to create the virtual machine on the host.

http://img22.imageshack.us/img22/1842/10679878.png

A few more things must be done before we can install the operating system. Select the newly created VM in the left pane and go to the summary tab:

http://img189.imageshack.us/img189/4448/89537469.png

Click edit settings to open the following window:

http://img189.imageshack.us/img189/4619/51011685.png

Select the CD/DVD drive and select the "Datastore ISO File" option and hit browse.

http://img189.imageshack.us/img189/7852/57959814.png

Browse to the location of the ISO we uploaded and click on okay.

http://img22.imageshack.us/img22/6622/65046571.png

The ISO is now loaded onto the drive. Tick "Connect at Power On". Click on okay to accept the changes and close.

So now that we have created the VM. Go to the Console tab and hit the play button on the toolbar. The VM will bootup and should automatically boot from the ISO image. Install & configure the operating system like you normally would as if you were sitting at a physical computer. You can come back to this console tab and time you need "virtual physical" access to the VM although I recommend you enable remote managment tools like you would for a normal server (e.g remote desktop/ssh).

There are alot more features and settings for VMWare ESXi but this tutoral is really only designed to get you started with the basics. Hope you learned something and have fun playing around with your new ESXi server.

Thanks,

Tom

Recursion
11-07-2009, 08:46 PM
Very cool, much easier to follow than the Hak5 podcast I watched on this, thanks! :P

N!ck
11-07-2009, 08:56 PM
Amazing post(s). Must have taken a hell of a lot of time. +rep.

Fehm
11-07-2009, 09:13 PM
An amazing tutorial. Should definitely be added to the tut section!

mat64
12-07-2009, 02:03 AM
Awesome tutorial, thanks :)! +rep

Recursion
15-07-2009, 11:30 AM
I just managed to get PXE Booting working properly so hopefully Ill be able to use the rest of your guide :P

Want to hide these adverts? Register an account for free!