RHEL AND FEDORA KVM - WINDOWS 10 VM BIOS TO UEFI CONVERSION CHEATSHEET
CONVERTING FROM BIOS TO UEFI
This is a cheatsheet. If something doesn't make sense, DuckDuckGo it. These are from notes taken from several migrations. The last few were used to confirm that the order and steps taken are accurate. Go slow, and always -- BACKUP, BACKUP and BACKUP your data again!
-
Install any needed software.
sudo dnf install edk2-ovmf swtpm swtpm-tools
-
Create a new vm and point it at your existing BIOS disk. Ensure min 4gb ram, min 2cpu cores, and that the existing disk is min 64gb. Name it something to ensure you are aware that this is the UEFI VM.
-
Customize install and tick "Customize configuration before install"
-
Add Hardware -> TPM, select TIS and v2.0
-
In the Overview, select UEFI, x86_64 with secure boot. Apply changes.
-
Stop existing VM if it isn't stopped already and clone it. Name it something unique so you know this is the BIOS version.
-
Boot the BIOS VM, boot to advanced options, and enter the boot command prompt.
-
Login and execute the following command:
mbr2gpt /convert
-
You may have an error regarding ReAgent.xml. This is because the VM doesn't support UEFI. This is fine.
-
Close the command prompt and shutdown.
-
Boot the UEFI VM. I would advise configuring the UEFI to your liking, especially the screen size. But also ensure TPM and secure boot are enabled.
-
The VM should now be converted.
Test things to make sure that all is well for several weeks (MS can take a while to de-auth Windows or have other problems show themselves).
Once you are certain that things are all well, the cloned BIOS VM may be removed entirely (config and disk).
The steps taken to configure the new UEFI config is also what you will need to setup Windows 11, or allow for upgrade to Windows 11.
If you haven't done so, you do want to install the guest utilities and drivers, as it makes for a vastly superior experience.
GUEST TOOLS
Follow the instructions below. You want to install the host side, and guest side tools. So on RHEL/Fedora, install the virtio-win repo and virtio-win package. Then in Win10/11, install the guest tools (virtio-win-guest-tools.exe) driver package within the Win10 vm. The latter is signed by Red Hat, making Microsoft's driver signing policy happy.
REFERENCES
-
Tenforums.com : How to Convert Windows 10 from Legacy BIOS to UEFI without Data Loss
-
Tenforums.com : How to Open a Command Prompt at Boot in Windows 10
-
Tenforums.com : How to Boot to Advanced Startup Options in Windows 10
-
ITS University of Iowa : How do I shut down or restart my Windows computer via command prompt?