OVMF (UEFI BIOS) improvments

ghusson

Renowned Member
Feb 25, 2015
86
7
73
FRANCE
www.liberasys.com
Hello,

I installed debian-8.2.0-amd64-netinst.iso on a KVM guest with UEFI boot (OVMF BIOS).
When the guest starts, the BIOS doesn't boot over the EFI partition (Debien doesn't start, the BIOS comes to the falback EFI command line).
In the BIOS, I can start Debian when I use "boot from file".
Adding a boot entry doen't help.

I think there are four improvments to work on :

1) the BIOS should boot on the EFI on the disk by default (in my case disk is RAW over LVM over iSCSI) : maybe I am missing something in the settings of a conf file in the EFI partition ?

2) the BIOS should boot on the new boot entry when set (maybe it is a OVMF bug or it is a problem of storing the BIOS settings)

3) PVE should store modifications made to the BIOS in a dedicated virtual device (file). For the moment is seems that it is a temporary file...

4) PVE should be able to propose a user interface in order to configure boot settings (ie : not waiting to be in the BIOS for settings things up)

BR
G. HUSSON
 
As this is still a recent thread I will reply here instead of sharing my solution in an extra thread.

I had the following Problem which is related/the same as the thread opener, I think:
  • using OVMF Bios and virtio-scsi Controller + SCSI Disk, I installed Debian 8.6.0 (be careful here, as far as I know all live CD images of Debian dont support UEFI, so use a standard image)
  • the result was that I couldn´t boot after installation, the error was "Boot Failed. EFI SCSI Device" or something along those lines

I was quite stumped as the cd is also booted in UEFI mode and that works flawlessly. After some digging I found the following post on Stackexchange:
http://unix.stackexchange.com/questions/52996/how-to-boot-efi-kernel-using-qemu-kvm

In the answer post: "... EFI firmware saves boot options in NVRAM. QEMU currently does not preserve NVRAM, so boot options are lost once you close QEMU. Without boot options, the firmare tries to find \EFI\BOOT\BOOTX64.EFI to execute but it's not here, so it does not know what to boot and leaves control to you. ... "

That was spot on, after booting with "Boot from File ..." (thanks @ghusson) I looked what the path looks like in the boot folder of the Debian installation.

After installation Debian uses:
"/boot/efi/EFI/debian/grubx64.efi"
So I tried the following which works quite well:
"mkdir /boot/efi/EFI/BOOT"
"cp /boot/efi/EFI/debian/grubx64.efi /boot/efi/EFI/BOOT/BOOTX64.EFI"​

After that the bios can boot Debian without any intervention. I think that this may also apply to other distributions like e.g. Fedora.

The only thing I am not sure about is what happens if the grubx64.efi gets updated. Maybe some script which copies grubx64.efi to BOOTX64.EFI every time a shutdown/reboot is triggered would be a solution.

I know this isnt and ideal solution but at least it gets things working as long as OVMF is not configurable.

Best Regards
Jonas Stunkat
 
Thanks for the info, I was not aware of that. It works quite well indeed. Only thing is that it seems like I cant create the EFI disk on CEPH RBD Storage, even if the UI lets me choose it ;).

Best Regards
Jonas Stunkat
 
There are more things wrong with EFI Disk. I tried the workaround and it´s not working for me.
Issues:
- after removing an EFI Disk it is not possible to readd it as EFI Disk with the UI
- trying the workaround i got the following Error:
Code:
create full clone of drive efidisk0 (local-lvm:vm-200-disk-1)
rbd: create error: (17) File exists
TASK ERROR: storage migration failed: rbd create vm-200-disk-2' error: rbd: create error: (17) File exists

... and no there is no "vm-200-disk-2" disk on "vmimages", at least the UI doesn´t show it
But the error is correct, using ceph commands directly shows:
Code:
rbd ls -l vmimages
NAME             SIZE PARENT FMT PROT LOCK
vm-200-disk-1 102400M          2
vm-200-disk-2   1024k          2

It seems like Proxmox is not recognizing the new rbd block device.

After this I deleted that rdb device manually (with "rbd rm vmimages/vm-200-disk-2") and tried again .... this time it did work, I don´t know what went wrong the first time. (Its even working on a running VM :) )
Only thing is, it is still not showing under the Contents tab in "vmimages" storage.

Best regards
Jonas Stunkat
 
I'm also experiencing some issues with UEFI and RBD storage.

The webui doesn't seem to be able to create the RBD for EFI
Code:
Copying of EFI Vars image failed: command '/usr/bin/qemu-img convert -f raw -O raw /usr/share/kvm/OVMF_VARS-pure-efi.fd /dev/rbd/default/vm-110-disk-2' failed: exit code 1 (500)

I think it's a bit messy to create the EFI disk first locally and then convert it to RBD so I did this instead.

Code:
qemu-img convert -f raw -O rbd /usr/share/kvm/OVMF_VARS-pure-efi.fd rbd:default/vm-110-disk-2
Then to add the EFI entry to the config file

Code:
efidisk0: default-ceph:vm-110-disk-2,size=128K

Like previous posters in this thread I'm also not seeing the manually created rbd devices under the ceph/rbd storage content in the proxmox webui.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!