Cloning a virtual machine is the process of making a copy of an existing virtual machine without the need to install it again. This saves you time and stress even though the process may not seem straightforward on Hyper-V. In this guide, I will be showing you “how to clone a Virtual Machine via Export and Import: How to copy a Virtual Hard Disk on Hyper-V”. Please see how to clone a Windows Server running on VirtualBox, How to Find Security Identifier on Windows, and How to integrate TestRail with Jira.
But note that Each time you install Windows OS on a computer there is a unique SID (Security Identifier) that is attached to it, which means if you are not careful while trying to install or clone the same Windows OS on multiple systems, the SID info will be copied on all the devices, and this will result to system issues. Here is a YouTube video discussing this topic.
Microsoft provided Sysprep which help to prepare Windows image for deployment by resolving the issue of SID duplications, it will clear the unique SID information and generalize new SIDs for the cloned system. Read these if you want to know How to Increase Disk Size in Hyper-V, how to Fix Hyper-V VM Stuck in Stopping State, 3 Ways to Convert VMware VMs to Hyper-V, How to start HyperV VMs in safe mode.
How to prepare for VM Cloning
On the VM Machine run Sysprep or navigate to C drive >Windows>System32>Sysprep. Double-click on the Sysprep.exe file to run the clean-up process. This would clear the unique security identifier (SID) and prevent two computers from having the same IP or name.
2. Select Enter System Out-of-Box Experience (OOBE) from the drop-down and check Generalize and from the Shutdown Options select Shutdown and click OK.
Here are some exciting guides: How to clone a repository and install software from GitHub on Windows, Security Identifier: Find User SID in Windows, and How to Clone and Sysprep (generalize ) a Windows Server running on VMware Workstation.
Clone a Virtual Machine via Export and Import
4. On the Hyper-V Manager, select the virtual machine you want to clone and click on Export below the right panel.
4. Specify the location you want to save the VM files and click Export.
5. Immediately you click the Export button the export process will start.
After a successful export all files will be exported to the new location.
6. On the Hyper-V Manager windows, select the virtual machine you want to clone and on the right panel, click Import Virtual Machine and follow the Wizard.
7. Click on Next and locate and select the folder that you exported above.
8. Select the Virtual Machine to import and click Next.
9. Choose the type of Import to perform. Select Copy the virtual machine (create a new unique ID) and click Next.
10. Choose the Folders for the Virtual Machine files or leave the Default Hyper-V Folders and click Next.
11. Choose the Folders to Store Virtual Hard Disks or leave the default folder and click Next.
12. Complete the Import process by clicking on the Finish button. The Cloned VM will appear on the Hyper-V Manager Virtual Machines.
Please see Best Free Disk Cloning Software to Clone a Hard Drive, What are System Partition and Boot Partition in Windows?, how to Setup VirtualHost with SSL on WAMP Server, and How to Remove Quick Access from Google Drive Online.
Clone a Virtual Machine by Copying the Virtual Hard Disk
13. Click on Hard Drive in the left panel. Confirm the location of the virtual hard disk file. Copy the file to your desired location and rename the file. On the Actions Pane click on New > Virtual Machine.
14. Follow the New Virtual Machine Wizard to create a new Virtual Machine. In the Connect Virtual Hard Disk, select Use an existing virtual hard disk and browse to where you copied the VM files. Click Next to complete the cloning of the VM.
I hope you found this blog post on how to Clone a Virtual Machine via Export and Import: How to copy a Virtual Hard Disk on Hyper-V Interesting and helpful. In case you have any questions do not hesitate to ask in the comment section.