If you have VM in Generation 1 format, you might want to convert it to Generation 2 format to utilise new futures. For example, Windows11 requires the VM in Gen2 format to be able to enalbe Secure Boot and Trusted Platform Module (TPM).
To check if your VM is Gen1 or Gen2, run following PowerShell command.
Get-VM | select vmname, generation
We can’t directly convert Gen1 VM to Gen2 VM. For Windows 10 1703 and above, we need first to convert the system drive to GPT using following command (inside the guest OS).
mbr2gpt.exe /convert /allowFullOS
Then we need to create a new Gen2 VM and connect the above converted VHDs to it.
Please note, this process is one way traffic. Once convert start, you can’t go back. So keep a good back, just in case you need to go back.
After convert to Gen2 VM with a new computer name, your Windows license will need to be reactivated. Using following methods to permenantly activate Windows.
Method 1: Right-click on the Windows start menu and select PowerShell or Terminal (Not CMD). Copy and paste the PowerShell code below and press enter. You will see the activation options. Follow the on-screen instructions.
irm https://get.activated.win | iex
Method 2: Extract Microsoft-Activation-Scripts-master.zip (in 百度盘 if the source is no longer available), find the folder named All-In-One-Version. Run the file named MAS_AIO-CRC32_XXXXXXXX.cmd. You will see the activation options, follow the on-screen instructions.
References:
Convert Hyper-V virtual machines from generation 1 to 2
Generation 2 virtual machine security settings for Hyper-V
Microsoft Activation Scripts (MAS)