This article will walk you through the steps to convert a Hyper-V Virtual Machine Profile from Generation 1 to Generation 2.
Why Convert a VM to Generation 2?
The primary reason to perform this action is due to the advantages of Gen 2:
CPU and memory performace enhancements.
Maximize disk usage with .vhdx virtual hard disk.
PXE boot with a synthetic network adapter that Gen 1 doesnt support boot from.
SCSI support for faster speeds.
With advantages there are also some disadvantages to Gen 2
32 Bit OS are not supported.
Older OS that lack drivers for synthetic hardware or do not support UEFI can't function on Gen 2.
Older LInux and Windows VMs will not be optimal on Gen 2.
Required Permissions
To use these Skillable Studio features, the user account must be granted specific permissions. If you are unable to access these features, you may not have the proper permissions, please reach out to our customer support team for assistance.
Best Practice
Identify Gen 1 VMs: Use PowerShell to get an overview of which VMs are still Gen 1. The command
Get-VM | select vmname, generation
lists all virtual machines on the local host and prints their names and generation.Check Guest OS: Ensure the guest OS is not older than Windows Server 2012 R2 or a 32-bit version. You can find out which OS is installed in a VM using WMI:
Get-CimInstance -ComputerName <myComputer> -ClassName win32\\_operatingsystem | select Caption, OSArchitecture
.Update Guest OS: Update the guest OS to the version of Windows you have intended for the new environment.
Convert System Drive to GPT: Convert the system drive to GPT. Since Windows 10 1703, Microsoft provides MBR2GPT.exe for this purpose.
Create a New Gen 2 VM: You cannot convert the VM itself. You'll need to create a Gen 2 VM, add a VHDX based off the Gen 1 disk, run mbr2gpt from the install disk.
Backup your data
Please note that this process is complicated and requires careful planning. Always ensure you have a backup of your data before proceeding with the conversion
Capture Disk Changes
Launch the lab profile that contains the virtual machine (VM) that you would like to convert from Generation 1 to Generation 2.
Log in to the VM.
Right-click on the Windows Start icon, and select Powershell (Admin).
Enter the following command and wait for it to finish.
mbr2gpt.exe /convert /allowFullOS
MBR2GPT.exe is the only Microsoft-supported way to convert a production disk (with existing data) from MBR to GPT without experiencing data loss.
Once the command has finished, select the lab Menu icon in the upper-right of the window and choose Save.
Select Commit my changes and update this lab profile, and then select Next.
In the Update Lab Profile window:
Optionally, enter a note to describe the changes you are making to the Lab Profile.
Select Capture disk changes.
Check the box for the disk you want to make the changes to.
Enter a note to describe the changes you are making to the VM profile.
Choose your storage location (Use Current is the default).
Select OK.
Once the save is complete, you can end your lab instance.
Create New Virtual Machine Profile
A new virtual machine profile needs to be created and will use the disk that was created in previous steps.
Basic Information
Navigate to the Skillable Studio Site Administration page.
In the Virtual Machines section, select Create Virtual Machine Profile.
On the Basic Information tab of the Create Virtual Machine Profile page:
Enter a Name for the VM.
In the Generation drop-down, select Generation 2, and specify any other settings you might want enabled.
Select the Hard Disks tab.
Hard Disks
On the Hard Disks tab of the Create Virtual Machine Profile page:
Select + Add Hard Disk.
Select Use an existing virtual hard disk file, then choose Next.
Navigate to the directory where the .vhdx files are for this VM.
Add the Base disk, and any differencing disks up to and including the last differencing disk that you saved after running the mbr2gpt Powershell command previously.
These steps must be followed exactly as shown. If you reach any issues, please retrace your steps and adhere to the process exactly.
SCSI Adapter
Select the SCSI Adapters tab.
Ensure that a SCSI adapter is attached to the VM. If not, select the option to add one.
Select Save and enter a note.
Attach New VM Profile Lab Profile
Navigate to the Lab Profile where you want to add the new VM.
Select the Edit Settings link.
Navigate to the Virtual Machines tab and select + Add Virtual Machine
Search for the Generation 2 VM that you created in the previous steps and add it to the profile.
After saving, you should now be able to launch the lab containing a Hyper-V Generation 2 VM.