Preparing a workstation to be turned into an image
Before we turn a workstation into an image, there are a few things that we need to do to generalise the image.
You should have made any customisations to the workstation before continuing with this article, as it will not be possible to make further changes afterwards. It’s highly recommended to follow the steps in the ‘Snapshotting your changes’ section of this article.
Snapshotting your changes
Once the SysPrep process has started, it will not be possible to log in to the workstation, as all user accounts, Active Directory domain joins etc will be removed as part of the process.
To ensure that you can easily make changes to your image, it’s highly recommended to snapshot the workstation's hard drive, so that it can be easily restored to a state pre-SysPrep.
See your Cloud provider or virtualisation platform's documentation on how to do this. Below are some examples:
AWS
VMware
Bare metal
Snapshotting bare-metal workstations can be a bit more involved and time-consuming, but the following tools can help:
Preparing the image
Lens Workstation Agent
The Lens Workstation Agent runs on startup and registers the workstation with the Lens system. Each workstation has a unique pairing with the Lens system for security. Before we create an image, we need to remove the existing pairing so that the new workstation registers successfully. To do this:
Stop and disable the Lens service
Log in to the workstation as an administrator
From the Windows start menu, search for
Services
and open it.Alternatively, you can enter the following in the run prompt by pressing
+ R, and entering
services.msc
.
In the
Services
window, select the7fivefive Lens Workstation Agent
service. Right-click this and selectProperties
from the menu.The Lens Workstation Agent service
In the Properties window
Set the
Startup type
field toDisabled
Click the
Stop
button
The service properties modal
The Lens Workstation Agent has now been stopped and will not start on the next startup
Reset the API key
If the workstation had been registered with the Lens system, then its registration needs to be removed before imaging.
Follow the 'Removing the API key' section from this KB article.
Sysprepping the workstation
Sysprepping a Windows machine is not reversible, and the workstation will need to be reconfigured before being usable. See this article to understand the SysPrep process.
On AWS EC2 instances
Use Remote Desktop Protocol (RDP) to connect to your Windows instance. Using alternative protocols such as HP Anyware or AWS/Nice DCV may work, but RDP is recommended.
From the Windows Start menu:
For Windows Server 2008-2012 R2, open
EC2ConfigService Settings
, and then chooseImage
.For Windows Server 2016 or later, open
EC2LaunchSettings
.
In the
Administrator Password
field, chooseRandom
.Choose
Shutdown with Sysprep
, and then chooseYes
.
For the full article, see here.
All other platforms
Follow the guide here on how to SysPrep your workstation: