Hyper-V on Windows 10 can not duplicate the second generation virtual machine.
So create a new virtual machine by copying the disk of the virtual machine that already exists on Hyper-V.
After that, manually execute the command to complete the initial setting.
These scripts and commands should be executed by the administrator.
- You already have a copy source virtual machine.
- No checkpoint exists in the virtual machine as the copy source.
- We do not guarantee OS other than CentOS.
Open the CopyHyperVvm.ps1 file and change the variables according to your environment.
After this script completes, connect to the virtual machine and execute the following command in rescue mode.
sh-4.2# fdisk -l | less
The following commands indicate that the mount point is /dev/sda1.
sh-4.2# /sbin/efibootmgr --create --label CentOS --disk /dev/sda1 --loader "\EFI\centos\shimx64.efi"
sh-4.2# /sbin/shutdown -h now
After the execution of the command is completed, take out the ISO image from the DVD drive.
This concludes the replication of the virtual machine.
Please refer to the following site when working this script manually using Hyper-V manager.
https://qiita.com/whale_shark/items/11a2b0a36c5dfe27e9f0
Sorry, japanese only.