Lab Build Guide: Hyper-V VMs, Cloning, File Sharing… For a Friend.

Lab Build Guide: Hyper-V VMs, Cloning, File Sharing… For a Friend.

3. Sysprep.

Sysprep is a Windows utility that removes system specific information such as the computer’s security identifier (SID). Using this utility to package our Windows installation will allow us to clone the virtual machine without having any conflicts. Randomizing the SID is especially important for systems that will be joining a domain.

Open a console session on your VM template and launch the sysprep utility ( %WinDir%\System32\Sysprep\sysprep.exe ).

The Generalize option will strip the SID and since we will be copying the machine, choose Shutdown from the dropdown.


Don’t Break the Template

We want to clone this virtual machine (the virtual hard disk) a few times. Let’s be sure to protect it from powering it up. If it does, we’ll have to sysprep once again. Navigate to the virtual hard disk -> properties and mark the file Read-only.

Below is the error you will see if you attempt to start the VM template. This is a good thing.


Create the First Clone

Now that we have established a baseline image, making a new one is as simple as copying and pasting the virtual hard disk (.vhd file) and creating a new VM. I named my first clone SQL01.

The only differences between this virtual machine and the template setup are that we will attach our virtual network and we will select the new virtual hard disk. Back in the Hyper-V Manager, click New -> Virtual Machine to get started.

Right-click the virtual machine and select Settings. Add 4GB of RAM and assign two virtual processors.

Next, start the new VM and set up your administrative account. In the next step, we will setup the host and virtual server for some file sharing.