How to Remove UEFI Boot in KVM Virtualization

kvm-virtualizationqemuubuntu-16.04

I have Ubuntu 16.04. VM which is running in KVM.
VM is using UEFI boot and it has /boot/efi defined in fstab

[19:40]Test*ROOT: ~ cat /etc/fstab | grep efi
# /boot/efi was on /dev/sda1 during installation
UUID=A095-115F  /boot/efi       vfat    defaults        0       1

I want to remove UEFI and put bios boot because AWS is not supporting UEFI.
When I try to import VM from my local server it says:

ClientError: EFI partition detected. UEFI booting is not supported in EC2.

How to properly without deleting data from VM remove UEFI.

VM imaage type is qcow2.

Thank you

Best Answer

The most probably as UEFI is installed (grub-efi-*) the bios boot loader is not installed. You should install boot loader for bios boot (grub-installer, grub-pc-bin, may be some other) and set up the boot using grub installer and customize the parameters if needed.

Once everything is working (the easiest way is to try to boot locally with bios boot) you can easily remove the line from fstab and remove the partition. Optionally you can also remove grub-efi-* package(s). In case you would remove it directly you will not be able to boot it normal way.

I am not sure if it is still the case but it used to be that the boot loader has been installed based on how did you boot / start the installation process so once you boot into installation using UEFI the UEFI boot is set up and once you boot using bios boot the bios boot is set up on the system. So in the worst case try to install VM again but start installation process using bios boot instead of UEFI ;-).

Related Topic