Skip to content

Cloning Win 10 VM on Hyper-V Server 2016

Share this Post
  • 1
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Clone via Export/Import

I wanted to clone Win10 after installing so i would not need to install it for new VM’s.

To do this i installed a VM with Win10. As soon as getting into the desktop I ran sysprep from:
C:\Windows\system32\sysprep

Note: This is not required if the VM has not had much setup.

Select OOBE, tick generalise and then shutdown. This will clear all the settings on the VM.
Export the VM to a location in Hyper-V manager.
Select Import and choose the VM folder where it was exported > select path where the new disk and vm will be stored. I had to rename the disk filename to match the new VM name.

When starting the new VM the sysprep caused an error on one of the VMs. On other ones this did not happen. I had to do the following:
Press Shift + F10, run regedit

  In the Registry Editor..

                Browse to….

        HKLM/SYSTEM/SETUP/STATUS/ChildCompletion on the right hand side check for setup.exe. if the value is 1 change it to 3.(by double clicking on setup.exe and changing the value shown in the box).
Then close the registry editor and then also close the black window.
Then click on OK for the error and the computer will restart and the installation may complete

Clone via Command line

This clones the VHDX but renames it to your new name.

PS Admin > browse to directory where the VHD to copy is stored > enter cmd:
xcopy .\HP-Win10-3.vhdx .\PC02.vhdx
(for help: xcopy /?)
explorer . (this opens explorer so you can view the file has been cloned)

In Hyper-V manager create new VM > Set the name of VM to PC02 same as the VHDX file > Choose the new VHDX file you created.

 

Links:
https://techjourney.net/how-to-clone-vm-virtual-machine-in-hyper-v/
https://answers.microsoft.com/en-us/windows/forum/all/error-message-the-computer-restarted-unexpectedly/b770f14d-e345-e011-90b6-1cc1de79d2e2

 


Share this Post
  • 1
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Leave a Reply

avatar
  Subscribe  
Notify of
Scroll Up