Written by Joseph Piggee
With all the updates out there, it can take quite sometime to get a a new Virtual machine up and running. To save yourself some time, create a base template. With Hyper-V and using sysprep, it’s pretty quick & easy. You’ll want to use sysprep in order to generate a different SSID & MAC address. Sysprep in now included with Windows 7 & Server 2008 R2. Sysprep can be found in %systemroot%\Windows\System32\Sysprep.
* Note: When you run sysprep, be sure to select the OOBE option.(OOBE=Out Of Box Experience)
- First create your virtual machine, and install all applicable updates.
- Set all default settings:
- Workgroup or Domain membership
- Update settings
- Enable RDP
- Disable unnecessary Services
- Power off you VM, and backup your VHD.
- Now power on your virtual machine.
- Open a command line, and navigate to the sysprep directory.
- At the prompt type: sysprep /oobe /shutdown.
The alternative is to just type sysprep with no options, and you’ll get a GUI, which I will show below.
- Example of sysprep GUI:
- Open command-line
- Navigate to %systemroot%\windows\system32\sysprep
- At the command prompt type: sysprep
- press enter
- You’ll see the Sysprep gui popup.
- Select the following:
- Enter Stem Out-Of-Box Experience (OOBE)
- Check Generalize (This will generate a new SSID)
- Click OK
- After the VM shuts down, make a copy of the VHD. I’d recommend marking as read-only so you don’t accidentally boot from it and alter it.
- That’s it your done.
To create a VM from you template, using best practices, create a directory for your new server. For my example, the server name will be Server03.
- Copy the the VHD template you created in step 7 above to your new directory. In my case, I copied my template VHD to a directory called Server03.
- Changed the read-only attribute.
- From inside your Hyper-V manager, right-Click your Hyper-V server, Select New –> Virtual Machine
- The New Virtual Machine Wizard will open.
- Type in the name of your Server, Select store VM in different location
- Browse to the location where you copied the VHD intended for this installation.
- Click Next.
- Configure the amount of memory, click Next.
- If necessary, connect network. Click Next.
- In this section, this is where you select, Use existing virtual hard disk. Browse to the VHD for this installation. Click next.
- Now start your new VM.
- You'll encounter the usual prompts as shown below.