In one of my previous posts I explained how to Clone a virtual machine with the Virtual Machine Manager, but before Clone our virtual machine we need prepare the virtual machine for cloning.
As you probably know by now, Microsoft-based operating systems use SIDs (Security IDs) that are generated as part of the initial setup of Windows. If you have more than one computer with the same SID, this could cause problems, and cloning a computer (either physical or virtual) without re-generating this SID can cause SID duplication.
Due to the above, we need to prepare virtual machine image for cloning.
This guide assumes that you’ve got some sort of virtualization infrastructure in place. In my case this is a Microsoft Hyper-V. It also assumes that you’ve got some sort of virtualization management tool like System Center Virtual Machine Manager.
In addition, it’s important that you have a basic knowledge about how to set up and run your virtualization product, that you are knowledgeable about setting up virtual machines, and about the proper procedure to install and configure a Windows-based operating system on these virtual machines.
Also, , this guide assumes that you’re knowledgeable about the proper procedures needed to be taken prior to creating a virtual machine clone, how to use SYSPREP (the system preparation tool from Microsoft), and how to create proper answer files for the preparation procedure.
In this post I ‘ll describe how to prepare virtual machine images for Windows Server 2008 R2 and Windows 7. In Windows Server 2008 R2 and Windows 7 the SYSPREP tool is already included in the operating system, therefore there’s no need to download it like for Windows XP.
To create the proper answer file under Windows Server 2008 R2, Windows 7, you need to either manually edit an existing answer file, or create one for your needs.
To create an answer file for Windows Server 2008 R2 or Windows 7, you must use the tools available in the Windows Automated Installation Kit (AIK) and you can download here.
Preparing the System for Cloning
Prior to cloning the virtual machine there are several steps that you need accomplish. This is not a requirement but is recommended.
- Log on to the computer as an administrator.
- Install and customize applications.
- Customize the Default User profile.
- Update Windows and other software components.
- Clean temporary files.
- Defragment the disk, and compact the VHD file.
Create the UNATTEND.xml Answer File for Windows Server 2008 or Windows 7
Unattended Windows Setup answer file in Windows Server 2008 R2 and Windows 7, is an XML file typically called Unattend.xml. This is the answer file for Windows Setup that is created by using Windows System Image Manager (Windows SIM). The answer file enables the configuration of default Windows settings, as well as the addition of drivers, software updates, and other applications.
The unattended Windows Setup answer file in Windows Server 2008 R2 and Windows 7 needs to be specified during the running of SYSPREP. To do so, run the SYSPREP tool with the /unattend:filename option.
If you wish to manually configure the Windows settings after SYSPREP, run SYSPREP from the C:\Windows\System32\sysprep folder.
Make sure you do NOT FORGET to select the “Generalize” option if you need to change the computer’s SID. It seems that this version will NOT change the SID unless you pick that option.
Sysprep is working.
When the process is complete the virtual machine will shut down.
OK, our VM is prepared for Cloning and if you want to know how to Clone VM with System Center Virtual Machine Manager read my previous post about that.
After starting cloned machine, you will be prompted to configure few settings like the user name, computer name, language and some other settings.
I need to mention, creating an answer file will greatly ease this process, and the entire process will automatically run.
Folks that’s it!