Home > Ultimate vSphere Lab > Building the Ultimate vSphere Lab: Part 4 – Base Template

Building the Ultimate vSphere Lab: Part 4 – Base Template

Now it’s time to start building our Virtual Infrastructure services.  This will consist of a bunch of VMs hosting Active Directory, SQL Server, vCenter, …  So we’re talking about 3 to 5 VMs here.

We will use Windows 2008 R2 as the base OS for these VMs.  We will be using Linked Clones technology of VMware Workstation to put those VMs in the smallest space possible.

To make it a short story, we’ll install one ‘Base VM’ with Windows 2008 R2 including all the patches/service packs.  Then, we will create a linked clone for each of our VMs.  This linked clone contains only the differences between the Base VM and the linked clone.  In most cases, this is less than 5 GB per VM.

So let’s start for the Base VM.  Click Create a New Virtual Machine to create your first VM.

image

Pick Custom (advanced).

image

The Hardware Compatibility must be Workstation 8.0 (default).

image

Select I will install the operation system later.

image

Pick Windows Server 2008 R2 x64 as the OS Type.

image

Name it Windows2008R2_Base and store it under the VM folder on your SSD drive.  DO NOT STORE IT ON YOUR HDD!!!  This Base VM will get A LOT of Read IO.  If you put it on your HDD, smoke will probably arise from it 🙂

Since my SSD is the C: drive, I store it under C:\VM

image

One CPU/Core will be sufficient.

image

Memory size of 1024 MB.

image

Set the Network Type to Do not use a network connection.

image

LSI Logic SAS Controller.

image

Create a new virtual disk.

image

Type is SCSI.

image

Select Store virtual disk as a single file.  These days everybody uses NTFS on Windows 7 so there are no issues with big files.

40 GB disk size is fine.  They are thin provisioned (since we do not select the Allocate all disk space now) so only used space will be allocated.

image

Accept the default Disk File.

image

Click Finish to create the VM.

It will appear in your VMware Workstation console now.

image

Edit the virtual machine settings.

First, remove the Floppy, USB Controller, Sound Card & Printer devices.  We won’t need them and they only consume unnecessary resources.

image

Next, click the Add button and add a Network Adapter.

image

Select Custom – VMnet0 as the network connection.  This will give the VM internet access.

image

Click the CD-DVD (IDE) drive and attach the Windows 2008 R2 ISO file to it.  This ISO file is best stored on the HDD as you need it only once.

Click Power on this virtual machine.

If you get a warning about your Memory Configuration, just tick Do not show this message again and continue.

The VM will boot from DVD and the installation of Windows begins.  Pick the correct regional settings and install it.

image

Every Full Installation edition of Windows besides Web Server will do.  Since i will run a trial edition, i use the Datacenter edition…  Not that we will be using any of those features, but it just shows up nice 🙂

image

Pick a Custom Installation and install it on the 40 GB drive.  Now is a good time to look at the files in the VM directory on your desktop.  The VMDK file which actually contains all the data will grow now as data is been copied from the ISO to the VM.

image

After installation, about 7 GB will be consumed.  Nice.

Back to the VM, change the password to something strong (capital letters + small letters + number).  We will reuse this password for all accounts.  After all it’s only a lab so no sensitive information will be found, but we need to have a password since blanks are not accepted.

image

Your mousepointer will be choppy, so let’s solve that first.

First, we start by installing VMware Tools on it (VM – Install VMware Tools…).

image

An AutoPlay popup will appear in the VM.  Click Run setup64.exe and perform a Typical Installation.  Reboot the VM.

Performance of the VM is okay now, as well as the graphics performance.

Before updating the VM, we will install .NET Framework first.  Open Server Manager and click the Features item.  Click the Add Features link.

image

Select the .NET Framework 3.5.1 Features item.

image

Some additional roles need to be installed.  Do so by clicking Add Required Role Services.

image

Click Next, Next, … Install to install it.

Next, we will turn on Windows Update to bring the VM up-to-date.  You can go ahead and install all the updates, but it’s easier to apply the latest service pack first.  Download it from the Microsoft website and then apply all Windows Updates patches afterwards.

TIP: Disable IE ESC in Server Manager.  Makes surfing a bit easier on the VM.

image

Now that our system is up-to-date, it’s time to clean it up.  When looking at the VMDK file size, we have grown to 17 GB already!  Yikes!

image

We’ll start by removing the SP1 installation files.  In a command prompt, run dism /online /cleanup-image /spsuperseded.

image

After that, we are going to remove all Windows Update backup files.  Stop the Windows Update service and delete the C:\Windows\SoftwareDistribution folder.

image

After deletion, Start the Windows Update service.

Next up the hibernation file: open a command prompt as Administrator.  Type powercfg.exe /hibernate off

image

After all these step, the VM is consuming less than 10 GB.

image

Open up VMware Tools, go to the Shrink tab.  Click the Prepare to shrink button.

image

It’ll take some time…

image

image

After it has completed, look at the VMDK file size:

image

9 GB!  That’s more like it!

Now the VM is ready to be used as a Template.  Run c:\windows\system32\sysprep\sysprep.exe in the VM.

image

Select the OOBE option and check Generalize.  Select Shutdown and click OK.

image

The VM will shutdown automatically and is ready to be templatized (i just invented a new word 🙂 ).

image

That’s it for now!  On the next episode we will start deploying our first VM which will be the Domain Controller.

 

Building the Ultimate vSphere Lab – Part 1: The Story

Building the Ultimate vSphere Lab – Part 2: The Hardware

Building the Ultimate vSphere Lab – Part 3: VMware Workstation 8

Building the Ultimate vSphere Lab – Part 4: Base Template

Building the Ultimate vSphere Lab – Part 5: Prepare the Template

Building the Ultimate vSphere Lab – Part 6: Domain Controller

Building the Ultimate vSphere Lab – Part 7: SQL Server

Building the Ultimate vSphere Lab – Part 8: vCenter

Building the Ultimate vSphere Lab – Part 9: ESXi

Building the Ultimate vSphere Lab – Part 10: Storage

Building the Ultimate vSphere Lab – Part 11: vMotion & Fault Tolerance

Building the Ultimate vSphere Lab – Part 12: Finalizing the Lab

 

 

 

Advertisements
Categories: Ultimate vSphere Lab
  1. December 27, 2011 at 18:22

    at what point would it make sense to switch it EFI BIOS type?

  2. Ben Loveday
    January 3, 2012 at 21:27

    Hi Sammy,

    Great article! I just have one comment to add, the Intel i5 does have a true quad core model (non-ht) and is a lower cost option than the i7. I myself have an AMD FX 8 core CPU and is perfect for my home lab, only problem is finding 8gb dimms although these are becoming more affordable now.

    Thanks again for the great post!

    cheers,
    Ben

  3. Marko
    January 4, 2012 at 14:51

    Wow, really great article!!!
    Only one suggestion: when you Power On for the first time the VM instead just Power On the VM, Power On To Bios and in the Main screen set “Legacy Diskette A” Disabled and in the Advanced–>I/O Device Configuration set all voices to Disabled.
    This is what I do everytime I create a new VM, in this way I have all the unused hardware disabled.
    Again, really great guide!!!!!

    • January 4, 2012 at 14:55

      Thanks for the suggestion! I’ll try to update the post ASAP with this valuable info!

  4. Raed Hussein
    January 19, 2012 at 23:04

    A great effort indeed, that doesn’t need my testimony 🙂

    However i have a comment to add that other may found helpful; we have to enable the VMCI option ( VM setting >> under the option tab >> guest isolation >> check the VMCI which is the VM communication interfce ), cause i was trying to install windows 2008 by booting from the CD, but the VM never detect the CD drive and then try to PXE boot, which drive me crazy until i enable this feature when i was clicking around :P,

    Again thanks a lot Sir,

  5. Brian Doyle
    May 4, 2012 at 22:36

    Great tutorial Sammy! It was exactly what I was looking for. 🙂

  6. August 30, 2012 at 14:20

    Thank you very much for publishing this huge step by step guide, it is helping me to create my home lab for vSphere.

  7. Daemonfly
    September 3, 2012 at 20:12

    Sysprep step – you have “c:\windows\system32\sysprep” in the text, but c:\windows\system32\sysprep\sysprep.exe” in the pic. I followed the text first, which hung me up for a bit before I saw the difference in the pic.

    • September 7, 2012 at 14:03

      Thanks!

      I have updated the post!

  8. Codera
    September 29, 2012 at 17:24

    If somebody is following this and using Workstation 9, then the Vmware tools ver.9 doesnt have shrink and other options anymore! But you can use Clean up disk option, that you would find doing right click on the vm, then Manage. It helped me save 2GB, so my 2008R2 ENT base template is only 8,46 GB big.

  9. romenick
    October 14, 2012 at 13:18

    Codera :If somebody is following this and using Workstation 9, then the Vmware tools ver.9 doesnt have shrink and other options anymore! But you can use Clean up disk option, that you would find doing right click on the vm, then Manage. It helped me save 2GB, so my 2008R2 ENT base template is only 8,46 GB big.

    Thanks for VM Workstation 9 update.

  10. Joe DeSimone
    October 16, 2012 at 00:47

    First, thank you for the great work. I am just starting to buid my lab and this should be a huge help.

    One question. Why are you running sysprep on the base build. I was under the impression that when you clone a VM new GUIDs are and other systems uniquenesses (Now there is a new word) are automagicly created.

    I did try it your way and I experienced a problem when I was adding the sqladmin account to the local admin group. even tried readding the machine to the domain still no go. I plan on starting over from square one just thought I would try to get clarification before I proceed.

    Thank you

    • October 25, 2012 at 07:23

      You are partially right with your assumption.

      When you use vSphere do deploy VMs from templates using Guest Customization, you don’t need to sysprep your Base VM as vSphere will handle all these things for you under the hood.

      But VMware Workstation doesn’t have this functionality, so that’s why you need to run syspres on your Template to generalize it.

  11. Anthony
    November 30, 2012 at 18:13

    Hi there. Thanks for this excellent blog; it’s really helping me out with a home lab setup. I just wanted to contribute that I was having trouble with the dism cleanup and found the solution was in the syntax of the command. This site: http://everythingsysadmin.wordpress.com/2011/03/16/cleanup-winsxs-after-windows-7-sp1-install/, shows instead of /superseded, one should use /SpSuperseded. This resolved my issue of seeing the Error 87 referring to “The Superseded option is not recognized in this context” which prevented the cleanup from occurring.

    Thanks too to the guys above that posted about the shrink / disk cleanup feature moving in Workstation 9 to under the VM menu -> Manage. This helped me out a lot too!

    My OS has shrunk from 17GB down to 9.6GB using these steps. Thanks again!

  12. Tim
    March 26, 2013 at 03:51

    This information is very well done and am enjoying building my first VMware Lab. i do have one question. In the above process where it talks about “Open up VMware Tools, go to the Shrink Tab. Click the Prepare to shrink button” I cannot find where to open up VMware tools. The service is running and shows up in the Action Center. I checked the programs and all over….at least most areas and cannot find it. I did an uninstall and reinstalled VMware Tools hoping it will show up on desktop or in program fiels, however, same results. How do it Open up VMware tools?

    • April 14, 2013 at 19:45

      Double click the icon of VMware Tools in the tray area next to your clock! That should do it!

  13. Glen
    May 28, 2013 at 22:02

    Vmware tools is open but does not allow it to be open, no vmware tools in control panel also.

  14. Glen
    May 28, 2013 at 22:03

    Glen :
    Vmware tools is present in system tray but double click it will only show the about, no vmware tools in control panel also.

  15. Glen
    May 29, 2013 at 00:08

    Glen :

    Glen :
    Vmware tools is present in system tray but double click it will only show the about, no vmware tools in control panel also.

    I have done this step so I can shrink the vm – http://kb.guru-corner.com/question.php?ID=205

  16. Abhishek
    May 30, 2013 at 14:41

    How many max VM’s can be run using this kind of setup ??

  17. Varun Malhotra
    June 7, 2013 at 18:10

    I would thank you for sharing such a wonderful step by step guide. I do have one question which is puzzling me. Can, we perform all the VMware features on this desktop environment because one of my friend told me that VDR/vApps doesn’t work on Desktop hardware and needs only a server hardware to run.

    I would highly appreciate any valuable suggestions in this context. Thanks in advance.

  18. gloacai
    June 27, 2013 at 16:51

    For anyone following this guide using Win2012 and SQL 2012 you still need to install .NET v3.5, v4 won’t cut it for SQL 2012. Also I had problems installing .NET v3.5 and ran the following command in an elevated powershell.

    dism /online /enable-feature /all /featurename:NetFx3 /source:d:\sources\sxs

    (Command slightly modified from http://www.sqlcoffee.com/Troubleshooting101.htm)

  19. JCG
    August 15, 2013 at 17:26

    Hello Sir, trying to create the 2008 base template, i have downloaded a reliable ISO for server 2008, twice, and each time the files start expanding on the install, i get an error msg stating that the files either cant be found, or are corrupt.. Any thoughts? Just to test if it was the 2008 ISO, i downloaded from Microsoft the server 2003 ISO x86, and tried installing that as a base template also, but when i start the machine, it goes to trying to pull a DHCP address, like the machine is trying RIS, or use WDS…

  20. Wayne
    February 22, 2014 at 19:24

    Was wondering if anybody was using work station 8 and at the point it section 4 has had an issue with the updating and patching. I was wondering if the Host (Physical Nic) had to be set up to allow connections through that nic ? or is the installation suppose to do that automatically? In the step where it states to update the base, I cannot get the VM to connect and run updates. I have 4 available Virtual nics and 1 physical nic. the VM is on Vnet 0 and the physical nic I have no issue getting on line..

  1. June 8, 2012 at 16:43

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: