Clone Windows Server 2008 KVM Virtual Machine
I recently needed to make several copies of an already configured Windows Server 2008 virtual machine. We are using the Linux KVM hypervisor library libvirt. These are the steps I took:
- Run Sysprep on the existing Windows Server 2008 to clear out any unique info such as IP address and hostname that might cause interference later.
- Run
C:WindowsSystem32SysprepSysprep.exe
- Select “System Out-of-Box Experience (OOBE)”
- Check “Generalize” and select “Shut Down” from the drop down.
- Run
- Once the machine has shut down, clone the virtual machine:
- Run the command:
virt-clone --original Server1 --name Server2 --file /var/lib/libvirt/images/Server2.img
where
--original
is the name of the virtual machine to be cloned (You can get the list of names by runningvirsh list --all
),--name
is the name of the new virtual machine and--file
is clone image to be created.
- Run the command:
- Rinse and repeat as needed.
- Start the clones and give them computer names and IP addresses.