Creating a base Windows Server template for my future VMs and later another for my Windows workstations allows me to conduct all the basic configuration, updates, and other typical install task once rather than with each server I create. This also allows me to clone the template which is much faster than an install from ISO. While I only have two servers planned for now, this will save time creating even the second machine, and significant time on all future servers I create.
Creating Windows Server Templates
I am using Proxmox if you haven’t been following along, but the process of creating a template to clone is similar in all Virtualization platforms with minor variations.
Creating any virtual machine template consists of four basic steps:
- Install the VM with all drivers, updates, and software packages
- Configure any other standard configurations that will apply to all servers
- Remove all user data, passwords, and keys – for Windows run a sysprep
- Convert the machine to a template
I created a virtual machine in Proxmox with the following specs:
- Name: WinSrv2019
- OS: mapped to ISO file on my host
- Disk: 100GB (can be less)
- CPU: 1 socket / 4 cores
- Memory: 4096MB (4 GB)
- Network: LAN / MTU 1450 (this is due to VXLAN in my lab)
After creating the VM and booting up, I get the install screen for Windows Server 2019.
When selecting an operating system I am going to use Windows Server 2019 Standard Evaluation edition without the desktop experience. I will configure the servers from command prompt / PowerShell and then remotely administer from one of the Windows 10 workstations.
After this step I configured my desired install drive and started the server installation.
After the install finished, I rebooted the server and then logged in with the Administrator account to access the command prompt.
To update the server, I used PowerShell to check Windows update with the command below and then reviewed the updates.
PS C:\Users\Administrator> $updates = Start-WUScan
To install the updates, I used the command below. You get some feedback showing the install progress as it runs.
PS C:\Users\Administrator> Install-WUUpdates -Updates $updates
Once complete I got the feedback “True” in the command prompt. I then ran the command below to check for pending reboot. In my case a reboot was required so I rebooted the server.
PS C:\Users\Administrator> Get-WUIsPendingReboot
After reboot I enabled Windows Remote Management (winrm).
PS C:\Users\Administrator> winrm quickconfig
I also set some basic options like enabling remote desktop and ensuring my servers had the correct timezone using SConfig.
I also made a firewall change and registry change to ensure remote desktop access is enabled.
PS C:\Users\Administrator> netsh advfirewall firewall set rule group="remote desktop" new enable=Yes
PS C:\Users\Administrator> cscript C:\windows\system32\scregedit.wsf /ar 0
These were all the custom changes I wanted to make so now I just need to run a sysprep to make the server ready for use as a template.
Prepare for Template Creation
Running a Sysprep is done by running sysprep.exe and setting the options in a Window that comes up. I chose to generalize, Enter System Out-of-Box Experience (OOBE), and shutdown once complete.
PS C:\Users\Administrator> C:\Windows\System32\Sysprep\sysprep.exe
Once shutdown, the last step is converting to a template. In Proxmox that is a very simple process, I just right click and select “convert to template”.
That’s it, I am ready to clone the template into my domain controller and file server. The new servers will already have all the updates and basic configuration I want for my lab.
0 Comments
3 Pingbacks