Generalize Your Master Image

DiskPart window showing five volumes, including a CD-ROM with an ISO image, a 78 GB primary partition (C:), and two hidden volumes.

In this new chapter, we will finally use the system preparation tool I already mentioned: Sysprep. 😉

It will help us generalize the image of our master, meaning it will make the Windows installation independent from the machine it was created on so it can adapt during deployment to different machines.

Use Sysprep

Sysprep is a native Windows tool used to prepare an operating system for deployment. Its main purpose is to generalize an installation by removing computer-specific information such as unique identifiers (SIDs), hardware-specific configuration, or device-specific drivers.

This stage of the master image creation process is very important. It ensures that the master system image can be used on other machines with different hardware configurations, and that each machine receives its own unique identifier so there are no conflicts or compatibility issues.

Sysprep will be used from the command line. On your master image, open Command Prompt and move to the folder that contains Sysprep:

cd C:\Windows\System32\Sysprep

You will run Sysprep with the following options:

  • /generalize: removes computer-specific information so the system image can be used on other machines without conflicts

  • /oobe : configures Windows to display the first-run experience at the next startup

  • /shutdown: shuts down the master image after Sysprep finishes running

  • /unattend: specifies the path and name of an XML answer file to automate Windows configuration at the next startup

Remember that my XML answer file is named "unattend" and is stored at the root of C:. Adjust the path and file name to match your own configuration. If you are not using an answer file, you do not need the/unattendoption.

Here is the full command:

sysprep.exe /generalize /oobe /shutdown /unattend:C:\unattend.xml

Sysprep will keep running until the master image shuts down.

Command Prompt showing the contents of drive C:, including several system folders and an unattend.xml file that is 713 bytes in size.
Sysprep running in Command Prompt

If Sysprep encounters an error, it will not be able to generalize the image and will stop, prompting you to check a file for more information.

DISM command running to capture an image from drive C: to S:\install.wim, with progress shown at 48 percent.
Error message

This file is namedsetuperr, and you can find it inC:\Windows\System32\Sysprep\Panther. Fix the detected error and run Sysprep again. Use this link to help identify the issue: Most common Sysprep startup errors.

Disable Boot from Disk

Later, the master image will need to boot from physical media, or from the network only if you use a deployment server such as FOG or WDS.

To do that, and to avoid handling mistakes, you may need to configure the boot order or disable Secure Boot in UEFI, the firmware built directly into the computer’s motherboard.

If you are using a virtual machine, these options are easy to manage in the virtual machine settings under the System menu.

Here is an example of how to configure the master image in VirtualBox:

Fenêtre des paramètres système d’une machine virtuelle montrant la mémoire allouée, l’ordre d’amorçage, le chipset, le TPM et d’autres options avancées.
Example of configuration in the System menu in VirtualBox

This configuration lets you:

  • Disable Secure Boot;

  • Disable EFI to return to a traditional BIOS mode;

  • Disable booting from the storage disk;

  • Enable booting from the network in addition to the optical drive.

Your master image is now ready. In the next chapter, we will move on to the final stage of the master image creation process: capturing the master image so it becomes a deployable system image.

Let's Recap!

  • Sysprep is the native Windows tool used to prepare a system for deployment.

  • The generalization step for a master image is very important. It consists of:

    • Making the image compatible with multiple hardware configurations;

    • Removing the master image’s unique security identifier (SID) so a new one is generated during each deployment and conflicts are avoided;

    • Returning the machine to OOBE at the next startup;

    • Specifying an answer file (optional).

  • If Sysprep throws an error, check the setuperr log file located in C:\Windows\System32\Sysprep\Pantherto identify the problem.

  • Once generalization is complete, the master image must not boot again from its storage disk until the reference image has been captured, so it remains intact.

Your master image is ready to be captured. In the next chapter, we will create the final system image and make it deployable.

Et si vous obteniez un diplôme OpenClassrooms ?
  • Formations jusqu’à 100 % financées
  • Date de début flexible
  • Projets professionnalisants
  • Mentorat individuel
Trouvez la formation et le financement faits pour vous