VMware Workstation Home Lab Setup Part 5 – ESXi Template

Nov 6, 2014 • Jonathan Frappier

With the Windows template set and our first VM working, its time to make an ESXi template we will use in the home lab. I mean it is small - I typically install with only a 1GB OS drive but why not use the features in VMware Workstation, so I am going to setup a clone. Setting up the ESXi VM is pretty much the same as what we did in part 1, so I am not going to rehash that (hopefully you learned something in part 1) but I’ll note some tips here none the less.

First, when creating the disk use only 1024MB, ESXi will install fine for our use it just won’t have any place for logs but that is okay, we will fix that later. Also, while VMware Workstation should take care of this when you select ESX as your VM type, check to make sure Virutalize Intel VT-x/EPT or AMD-V/RVI is enabled in the processor section in Virtual Machine Settings. Finally, mount your ESXi ISO in your CD/DVD drive and power on the VM.

While it has been documented pretty well, I will walk through the ESXi install steps here for completeness. Also, once you click into the console, you will lose control of your mouse since ESXi doesn’t have VMware Tools installed, press CTL-ALT to return it to your computer

Boot the VM with the ESXi CD mounted

After a few moments the Welcome to the VMware ESXi 5.5.0 Installation screen will appear, press the enter button to continue

Press F11 to accept the EULA (tip, if you are on a laptop or keyboard with extra features on the F keys, you may have to hold down the FN or function key

The only drive available should be the 1GB drive create during the VM setup, ensure it is highlighted in yellow and press the enter button

Select your keyboard layout and press Enter

Type in the root password, arrow down to enter it again and press enter

After a few moments, the Confirm Install page will appear, press F11 to install

Once the install completes, press Enter one last time to restart the server

Now that we have the base ESXi install done, it is time to install a couple of extra Flings into our ESXi template - VMware Tools for ESXi and the ESXi Mac Learning dvFilter. In order to install these, we need to log into the console of our ESXi virtual machine in VMware Workstation; click into the console and press the F2 button to get started.

Log in as root and the password you set previously

Arrow down to Troubleshooting Options and press enter

Arrow down to enable SSH and press enter; the SSH status in the right/gray side of the screen should change from Disabled to Enabled

Now press the ESX button until you return to the main screen with the IP address ESXi pulled from DHCP

Open your favorite SSH client and connect to that IP address

Log in as root

I am assuming you have internet access here, so it is actually quite easy to install these components, copy and paste the commands below into you SSH session. If you do not have internet access, you will first need to download the VIBs, upload them to the ESXi virtual machine and install from that location (just edit http path in the below commands and replace with your file system path

You should receive a message that the VIBs were installed like the image below

Note the dvFilter is installed here for testing purposes, since my home lab is built on Windows and VMware Workstation, typically you would install this on your physical ESXi hosts running ESXi virtual machines. Now that we have done that we “could” power down the ESXi VM we just built and start using it as a template, however we would need to manually reset ESXi every time we cloned it (and if you are doing this in a FC storage based environment you will need to do that anyways) but why would we want to do that. The following steps are courtesy of William Lam and virutallyghetto.com, check out his site and the blog post for full details on resetting the virtual machine. Since we do not have any VMFS datastores, there are only two steps we need to do before cloning, then once the ESXi virtual machine is clone you will need to log in and set networking information before we join them to vCenter (to be installed shortly).

From the SSH session, run the following from William's article:

esxcli system settings advanced set -o /Net/FollowHardwareMac -i 1

Next, remove /system/uuid from esx.conf. Open it in vi, arrow down until you find the /system/uuid line and press dd on your keyboard, then press esc : wq <enter>

vi /etc/vmware/esx.conf

Log out of the SSH client

Return to the ESXi DCUI and disable SSH

Press ESC twice to return to the main DCUI page and press the F12 button, enter the root password and then press F2 to shut down the VM

Once the virtual machine powers off take a snapshot to use for future cloning. You should have two VMs in your template folder, along with your running Windows linked clone which is current a domain controller. You are now ready to start cloning your nested ESXi virtual machines.

As a side note, and not required, you may also want to install the simple web client, an open source(?) simple client so you can manage the ESXi host without the DCUI or vSphere Client. You can find this project on GitHub.

Alight, so far we have built our Windows template in VMware Workstation that we will use for various home lab purposes, cloned it and got the first clone ready to be a domain controller. Given the limited resources in the lab, I’m not sure I want to tackle PKI at this time, though maybe I’ll try a lightweight opensource project at some point. Anyways back to why you are here, configuring Active Directory;

The last thing to do before promoting the server to a DC is to give it a static IP address, after all we don't want that changing (even if we are using DNS for everything). Bring up the Start menu

Change Obtain an IP address automatically to use the following and enter the IP information for your network. In my case I will set it to 192.168.6.5 with a subnet mask of 255.255.255.0 and a default gateway of 192.168.6.2 for my NAT'd VMware Workstation network. If it is not already, set the Preferred DNS server to 127.0.0.1

Server Manager should still be open from the previous post - if not open it.

Click on AD DS in the left navigation menu. You should have a yellow bar that says Configuration required... click the Yellow Triangle in the upper 1/3 of the window

Click on Promote this server to a domain controller

Select the Add a new forest radio button

Specify your root domain name. If you are included to pay for SSL certificates use a valid TLD that you own as there are very few providers offering certificates for private domains such as .local. I am going with all self signed certificates in my lab (for now) so I've chosen vxprt.local (.lan has troubles with OSX...at least it used to) and click Next

On the Domain Controller Options page, you can change the functional levels if you think you'd ever need to introduce and older domain controller, its unlikely so you should only need to add the DSRM password, then click Next

On the remaining steps, just click next (or review information provided if you like)

Verify that your server appears with an A record for the IP previously set.

Right click on Reverse Lookup Zone and click on New Zone

Click Next, accepting defaults until you get to the Reverse Lookup Zone Name page

Type in the first 3 octets of the IP subnet you are using, so for example I would type in 192.168.6, this will help generate the appropriate zone name, click Next two more times and click Finish. You now have a reverse lookup zone so hosts can be resolved by name and IP address.

Go back to your forward lookup zone for your domain and double click on the A record for your DC

Check the Update associate pointer PTR record and click ok; this will create a record in the reverse zone you just created

The last step is to set a DNS forwarder since this server will server as the primary DNS server for all other servers.

Right click on your server, just under DNS and select properties

Click on the Forwarders tab and click the Edit... button

Remove any local addresses from the list by highlighting it and selecting delete

I will use the public Google DNS servers, but you could also use something like OpenDNS.

Click where it says "Click here to add and IP address..." and enter 8.8.8.8 and 8.8.4.4 - those should resolve to google-public-dns-a and b; click OK and OK again, then close DNS Manager

Open IE and verify you can get to the intenret, you should be all set!

So far we have setup our Windows template VM, created a Linked Clone and made it into a Domain Controller and NTP server, next we can get into setting up our virtual ESXi hosts.

Now that we have finished building the template for our ESXi hosts used in our home lab setup, it’s time to start cloning. The process is not all that different from cloning the Windows virtual machine we did earlier, so a quick overview:

In VMware Workstation, right click on your ESXi template virtual machine (if you've been following along it should be vxprt-esxi-tmp) >> Manage >> Clone

Follow through the wizard, selecting Clone from "An existing snapshot..." and "Create a linked clone"

Name your VM accordingly and place it in the desired folder/drive. I will name my ESXi virtual machines vxprt-esxi## so my first will be vxprt-esxi01

Once the clone finishes, close the wizard, move the VM into your desired folder (if you are using folders) and power it on

After a few moments, our ESXi virtual machine will be powered on. Once it is clone, my preference is to give my ESXi hosts static IP addresses. Before doing that, log into your Domain Controller, open DNS manager and create A records for each of the ESXi virtual machines you plan to create by right clicking on the forward lookup zone for your domain and selecting New Host (A or AAA)… My IP scheme will be: