Ref: https://community.spiceworks.com/topic/2329130-disk2vhd-created-vhdx-won-t-boot-system-is-uefi-and-vm-is-gen-2
Option one: Altaro
Download Altaro Physical Server backup. Run a Backup. Then using the same software run a "Restore to VM". Takes 2x as long as below method but works great, and is free (for 30 days).
Option two: bcdedit
Run DISK2VHD on the source server then configure the VM as a
Generation2 VM with the VHD attached and boot to a Windows Server ISO
run the recovery console to access the command prompt
• diskpart
• sel disk 0
• list vol
• sel vol (number of the RAW volume should be around 99MB or 100MB)
• format fs=fat32 quick
• assign letter=A
• exit
• bcdboot C:\Windows /s A: /f UEFI
exit and reboot, the server will boot normally.