Virtual Machine Template Guidelines for VMWare – “Windows Server 2012”

Following are the guidelines/steps to create a Virtual Machine template for Windows Server 2012. Please note always start with minimum Specs and then extend later, whenever it required.

Please download below files by click on the file name. It will help you in later configuration.

It’s time to start.

1-First create a new VM

  • Right Click on Server and Choose “New Virtual Machine”
  • Enter VM Name (according to defined naming convention) and Inventory Location
  • Select Datastore
  • Select Virtual Machine Version: select latest available
  • Select “Microsoft Windows Server 2012 (64-bit)” as OS Version
  • # of Virtual Processors: 1
  • Amount of RAM: 2GB
  • Network
    • # of NICs: 1
    • Adapter Type: VMXNET 3
    • Select “Connect at Power On”
  • SCSI Controller: LSI Logic SAS
  • Create New Virtual Disk: 40GB
    • Disk Provisioning: Thin Provision
  • Virtual Device Node: SCSI (0:0)

NOTE: Thin Provision is good practice to store templates files. because, it will save some storage space.

2-Now prepare the virtual hardware

  • Right click on VM ->Hardware Upgrade(If Applicable)
  • Edit VM Settings > Options->VMWare Tools->Advanced->
    • Check upgrade Tool during power cycling check box
    • Check synchronize guest time with host check box
  • Edit VM Settings->Memory /CPU Hot plug (enable both)
  • Edit VM Settings->Advance->General Section ->Uncheck “Enable logging”

3-OS Configuration

  • Edit VM Settings->Remove Extra Hardware(USB & floppy etc)
  • Power on the VM and Install Windows Server 2012 64bit
  • Once installed shutdown the VM and go to “Edit VM Settings”->Boot Options > Select “Check box to force going into the BIOS on next boot”
  • Power on the VM (will go directly to BIOS) > Advanced > I/O Device Configuration:
    • Disable Serial port A
    • Disable Serial port B
    • Disable Parallel port
    • Disable floppy drive
  • Power on the VM and install VMware Tools-> While installation choose “Custom Install Type” and select all components
  • Set Windows “Time Zone” and time configuration.
  • Install any Windows Update and Service Pack
  • add static route (if required). below is an example, edit it according to you needs)
    • cmd: route add 172.17.0.0 mask 255.255.0.0 10.0.9.2 –p
    • cmd: route print(to verify route)
  • Enable “remote desktop”, uncheck “remote assistance”
  • In Control Panal->Windows Firewall->Add “remote desktop” in exception list.
  • Install .Net Framework and Java (if required)
  • Add inbound Rule in the firewall(if it is on)for ICMP(Ping)
  • Disconnect Windows Server 2012 ISO from VM Settings and set “device type” to “Client Device”

4-Create Snapshot

  • Create snapshot for safe side in case anything goes wrong in later configuration
    • Snapshot name->(Win_2k12_Snap01_Date and Time) and add description(FRESH OS INSTALLATION with basic configuration)

5-Test VM Alignment

  • There is not need to check the alignment because, OS later then “Windows XP/2003” are already aligned.

6-Network Configuration

  • Control Panel->View by->small icons
  • From Control Panel-> Network Connections->Right click on “Local Area Connection” and select properties->Uninstall QoS Packet Scheduler

** We don’t do QOS at the server level, our switches do that.

  • Uncheck IPv6 and close network connection screens ** We don’t use IPv6 yet so we disabled it for now

Or

  • Run below command on cmd (I prefer to use this option).

reg ADD “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters” /v DisabledComponents /t REG_DWORD /d 0xffffffff /f

7-Task Manager Changes

  • Right click Taskbar and choose Properties->Taskbar (Tab)->use small icons
  • Right click Taskbar and choose Properties and choose Customize under Notification Area->
    • Select “Turn system icons on or off”
    • turn Volume off
    • Turn action center off
  • Notification bar: Always show all icons and notifications on the taskbar
  • Right click on desktop-> view ->small icons

8-Control Panel Settings

  • Open Control Panel >Choose Folder and search options->Under View Tab
    • Select “Show hidden files, folders and drives”
    • Uncheck “Hide extensions for known file types”
    • Check “Allows show icons, never thumbnails + Allows show menus”
    • Check “Display the full path in the title bar”
  • Control Panel ->Power Options
    • Change Power Plan ->Balanced->Change plan settings->Change settings that are currently unavailable->
    • Turn off display-> never
    • Put the computer to sleep->never
  • Control Panel -> Sound -> Sound-> Sound Scheme: No Sounds
    • Pop-up: “Would you like to enable the Windows Audio Service?” – No->
    • Uncheck “Play Windows Startup sound”
  • Control Panel -> System ->System Protection>System Protection (Tab) -> Configure->Turn Off system protection.
  • Control Panel > Sync Center > Manage offline files->General (Tab)> Disable offline files
  • Control Panel –> Action Center –> Change Action Center Settings –>
    • deselect all options
    • Customer Experience improvement program- > Choose : no I don’t want to participate
    • Problem Reporting Settings: Never check for solutions (for all users)
    • Windows Update:
    • Never check for updates
    • Uncheck “Give me recommended updates …”
  • Control Panel –> Action Center-> Change user account Control Settings -> never notify
  • Disable Hibernation(run cmd as administrator)
    • cmd: powercfg.exe –h off
    • cmd: bcdedit /timeout 5

9-System Performance

  • Control Panel ->System -> Advance system Settings->Select Advanced Tab
    • Performance->Settings->“Adjust for best performance”
    • Startup and Recovery->
    • Uncheck : time to display the list of operating systems
    • Time to display recovery option when needed (set to 5)
    • Uncheck: write event to the system log
    • Write debugging information: Small memory dump (256 KB)
  • Turn off indexing- >Go to “C:” Drive-> Properties -> General
    • Uncheck “Allow files on this drive to have contents indexed in addition to file properties”

10-IE Settings

  • Control Panel->Internet options: Use New Tab + Check “Delete browsing history on exit”
  • Advance->Turn on IE Option (EMPTTY Temporary internet file folder when browser is closed)
  • Go to internet explorer Tools-> Compatibility view settings-> add websites (sngpl.com.pk,sngpl.net)
  • Delete temporary files from C:\Users\<Current login user>\appdata\local\temp

11-Swapping and defragment

  • Control Panel->System->Advanced System Properties->performance->Advance->Virtual Memory->Change
    • Uncheck “Automatically manage paging file size for all drives”
    • Select “No paging file”
    • Click “Set” to disable swap file
  • Defragment
    • Go to C: -> Properties -> Tools -> Defragment Now…
    • Select “(C:)”->Click “Defragment disk”

12-Create Snapshot

  • Create snapshot for safe side in case anything goes wrong in later configuration
  • Snapshot name->(Win_2k12_Snap02_Date and Time) and add description(Customization 1-Before Profile Setting)

13-User Profile Settings

In Windows Server 2008/2012 and Windows 7/8, Microsoft has disabled the Copy To.. Button on the User Profiles screen.

This issue is known to Microsoft but no fix has been released yet, but luckily there is an alternate way to achieve this.

  • You can download a tool called ‘Windows Enabler ‘from the below link or save from attachment of this document at start.
  • http://www.freewarefiles.com/downloads_counter.php?programid=980
  • Save the file to your Template VM’s desktop and extract the file.
  • Right click on “.exe“ file.
  • Once you have started the Windows Enabler application you will notice a new icon in the system tray
  • Make sure you click on it once to enable the application.
  • In the ‘Run’ prompt type cpl and hit Enter
  • Navigate to ‘Advanced’ tab -> User profiles -> Settings
  • Click on the desired profile and you will notice that ‘Copy To‘button is disabled.
  • Now, click on the disable button and it will become enabled thanks to ‘Win Enabler’ application.
  • Now copy the profile (in our case, it would be the user which we are using for configuration in most case it is administrator) to “Default users”(C:/Documents and Settings-/Default Users) profile.

14-Finalizing

  • Enable Swap files
  • Server manager-> change system properties->Advance -> Performance -> Settings->Advanced -> virtual memory->change
  • Check “Automatically manage paging file size for all drives”
  • Place Services-Registary and GPOSettings-Win2012.txt on “C” Drive, Rename with “Services-Registary and GPOSettings-Win2012.cmd”.
  • Join Domain (optional), it’s optional because customization wizard will join domain for you in every machine.
  • Register Windows (optional) (customized wizard will do this for you) 
  • cmd: ipconfig /release
  • Clear Event Logs

15-Create Snapshot

  • Create snapshot for safe side in case anything goes wrong in later configuration
  • Snapshot name->(Win_2k12_Snap03_Date and Time) and add description(Fully Configured except Antivirus)

16-Install Antivirus (optional)

  • It is the time to install an antivirus security. It’s optional, if you may want to install one.

17-Sysprep the Windows in Generalized mode

Running a SYSPREP allows the PC to be generalized with new unique IDs so that you get an “Out of the Box” experience (OOBE) on the next boot.  The next boot will bring you to the Windows Welcome Screen, where you’ll be prompted to accept the EULA (End User License Agreement) and enter an Administrator password (if running Windows Server).

To SYSPREP a Windows 7/8 PC or Windows Server 2008/2012 from Command Line:

  • Open an Administrative Command Prompt.
  • Type the following then press <Enter>: CD \Windows\System32\Sysprep
  • Type the following then press <Enter>: SYSPREP /generalize /shutdown

18-Convert VM to Template

Use the VMware Customization Wizard to create a re-usable script for cloning the template.

Domain Setting Syntax in Customization Wizard.

  • Username: administrator@example.com
  • Domain: example.com

NOTE: You should also have windows volume license key for mass deployment.

Add below setting in Run Once in Customization wizard (this step is optional. you may configure it according to you environment)

Run Once:

  • c:\Services-Registary and GPOSettings-Win2012.cmd (which downloaded from this post at start)

Now’s a good time to test that your template will create a usable clone and make sure while creating a production VM from template choose “disk provision” method from “thin provision” to “thick provision”.

vmtemplate-xp01

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.