Quickly deploying VMs using a template

Creating new virtual machines in Hyper-V is a relatively simple and automatable process, however the installation of an operating system on the VM can still take an extended period of time. Existing automated deployment tools help in the installation process, but most are slow and can be improved in a virtual environment.

Getting ready

In this recipe we will be using a VM with a basic installation of Server 2012 named Server2012_template:

  1. Create a new VM using the steps in the Creating virtual machines recipe.
  2. Install the Windows operating system on the new VM.
  3. Execute C:\Windows\System32\Sysprep\Sysprep.exe.
  4. Select Enter System Out-of-Box Experience (OOBE), Generalize, and Shutdown:
  5. Click on OK to reconfigure and ...

Get Windows Server 2012 Automation with PowerShell Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.