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:
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..
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.