Build a Step by Step #HyperV and #VMM Lab with #PowerShell

Hello Folks,

PowerShell is king!

Let’s build today a Hyper-V and VMM lab with PowerShell.

Are you ready?

Before we get started, let’s illustrate first the hardware and software requirements:

Hardware Requirements:

  • Computer running Windows Server 2012 R2 with Hyper-V enabled. (Get the evaluation of Windows Server 2012 R2 ISO here: WS2012 R2).
  • Minimum 16GB RAM.  This is required to support all of the running virtual machines.
  • 200GB or more free disk space.
  • SSD or faster HDD. I strongly recommend using SSD for better performance.

Software Requirements:

  • System Center 2012 R2 Virtual Machine Manager – pre-installed .VHD evaluation
    Download @ VMM 2012 R2
  • Microsoft Hyper-V Server 2012 R2 – Free hypervisor installation .ISO image
    Download @ Hyper-V 2012 R2 Core
  • Convert Window Image Script
    Download @  Convert-WindowsImage.ps1
  • Create a Generation 2 Sysprep VM using Convert-WindowsImage.ps1
    Run the following script using the ISO Eval Image for WS2012R2 downloaded above
    PS C:\>.\Convert-WindowsImage.ps1 -SourcePath D:\9600.16384.WINBLUE_RTM.130821-1623_X64FRE_SERVER_EVAL_EN-US-IRM_SSS_X64FREE_EN-US_DV5.ISO -VHDPath C:\Hyper-V\base\WS12R2_Server_Datacenter.vhdx -SizeBytes 50GB -VHDFormat vhdx -VHDType Dynamic -VHDPartitionStyle GPT -Edition ServerDataCenter

Choose a home base folder on the hard disk drive that has 200GB or more free space, create or pick a folder where you’ll run everything from.  In my demo, I am using the root of my C:\ SSD drive.
Put the downloaded software in the \Base folder.
Move or copy the downloaded three evaluation software files (VMM .VHD, WS2012R2 .VHDX and Hyper-V Core .ISO image) into the \Base folder. The entire contents of the \Base folder should then look like this:

Lab Folder

 

 

 

 

 

Turn on “Enhanced Session Mode” for better interaction with your virtual machines as you’re setting them up.
In Hyper-V Manager, select your host server on the left-hand side, and then under Actions on the right, click on Hyper-V Settings
In the Hyper-V Settings dialog, on the left under Server, select Enhanced Session Mode Policy.
On the right, make sure to check the box Allow enhanced session mode. Then click OK.
In the same window settings, on the left under User, select Enhanced Session Mode as well.
On the right, make sure to check the box Use enhanced session mode. Then click OK.

HVSettings01

HVSettings02

Run the VM Creation Script below:

And Voilà…

HVLab

Until next time, enjoy your day!

Cheers,
Charbel

About Charbel Nemnom 311 Articles
Charbel Nemnom is a Microsoft Cloud Consultant and Technical Evangelist, totally fan of the latest's IT platform solutions, accomplished hands-on technical professional with over 15 years of broad IT Infrastructure experience serving on and guiding technical teams to optimize performance of mission-critical enterprise systems. Excellent communicator adept at identifying business needs and bridging the gap between functional groups and technology to foster targeted and innovative IT project development. Well respected by peers through demonstrating passion for technology and performance improvement. Extensive practical knowledge of complex systems builds, network design and virtualization.

3 Comments

1 Trackback / Pingback

  1. Must Read – April 2014 Edition « The Lazyadmin.com

Leave a Reply