Skip to content

Preparing a golden image for virtualization

Introduction

Care must be taken when embedding an agent into a golden image for virtualization or duplicating an existing virtual machine. This is because, after installation, a unique asset ID is assigned to the agent, which identifies this machine within the Nanitor system. If this ID is duplicated, all machines using it will appear as the same machine to the Nanitor system. This really confuses everything, making it appear as if the machine is constantly changing.

Solution

Two approaches are possible:

Sysprep

Use Windows Sysprep to generalize the virtual machine image. Sysprep before capture — regenerates MachineGuid so clone detection works automatically. Cleanest if you're already sysprepping. Note: sysprep can't easily be run after deployment — it strips machine identity, domain membership, etc., It's a pre-capture step only.

Register later

If sysprep isn't part of your workflow, simply unregister the agent prior to capture. Then run the registration command on the clone each time you clone the machine. Do the following on the machine about to be captured as a gold image.

cd "C:\Program Files\Nanitor\Nanitor Agent" 
net stop "Nanitor Agent" 
nanitor-agent.exe unregister 

Then, on each clone after cloning

nanitor-agent.exe signup --key <signup URL> 
net start "Nanitor Agent"

For details on finding your signup URL, see this article.