Installing Ubuntu 16.04 in OVMF/UEFI mode Results in bad boot?

mattlach

Renowned Member
Mar 23, 2016
181
21
83
Boston, MA
Hey all,

So I just tried installing Ubuntu in OVMF mode for the first time. I went into the options screen and changed SeaBios to OVMF and then started my install.

The install ISO appeared to boot in UEFI mode properly, and th einstall proceeded as normal. The only difference was the addition of the EFI partition during the partitioning step.

When the installation was complete and I rebooted, I was faced with the following screen:

26791771001_04f44deb61_o.jpg


It looks like it somehow is not able to boot in EFI mode and instead loads the EFI shell (which I don't ave a clue how to use).

Does anyone know what I might have done wrong? Or is this maybe a problem with Ubuntu 16.04?

Appreciate any help!

Thanks,
MAtt
 
Hi,

ovmf is looking into the uefi paritition for a "boot/bootx64.efi" file

as workaround, you can on your ubuntu uefi partition:
"
cd efi
mkdir BOOT
cp ubuntu/grubx64.efi BOOT/BOOTx64.EFI
"

Thank you for that information. I have two follow up questions if you don't mind.

1.) What causes this? Is it a difference between how OVMF and a bare metal UEFI implementation work? Or is it a bug on Ubuntu's side?

2.) If I copy the EFI file over like this, will update-grub still work when kernels are updated, or am I going to ahve to repeat this step every time I need an update to grub?

Much appreciated,
Matt
 
Would it work if I just made a symlink to it instead? That way if the ubuntu/grub64.efi changes, those changes are automatically captured.

Does EFI understand symlinks?
 
So I gave this a try, and it does not appear to be working.

So, grubx64.efi is currently located in: /EFI/ubuntu

This folder also contains the following files:
Code:
grub.cfg
grubx64.efi
MokManager.efi
shimx64.efi

So I created /EFI/BOOT, and simply copied the grubx64.efi file to /EFI/BOOT/BOOTx64.EFI as you suggested, but I still wind up in the EFI shell when I try to boot Ubuntu.

Any suggestions?
 
Alright, so I can make it boot a single time by entering the VM OVMF bios setup screen by pressing DEL and selecting:

> Boot Manager > EFI Misc Device

So, it seems like I need to set up the boot order in the OVMF VM bios, and I do so by going to:

> Boot Maintenance Manager > Boot Options > Change Boot Order.

Here I move "EFI Misc Device" to the top of the boot order and press F10 to save.

Problem is that these settings don't appear to be persistent. When I reboot the VM the "EFI Misc Device" is back at the bottom, so it never actually boots.

So, the only way I can get the VM to actually boot into Ubuntu is to - every single boot - press DEL to enter the VM's OVMF bios screen, and manually override the boot option. This won't work on a server that needs to boot on its own.

There must be some way of fixing this, right?

Thanks,
Matt
 
So I gave this a try, and it does not appear to be working.

So, grubx64.efi is currently located in: /EFI/ubuntu

This folder also contains the following files:
Code:
grub.cfg
grubx64.efi
MokManager.efi
shimx64.efi

So I created /EFI/BOOT, and simply copied the grubx64.efi file to /EFI/BOOT/BOOTx64.EFI as you suggested, but I still wind up in the EFI shell when I try to boot Ubuntu.

Any suggestions?

do you use virtio-scsi ? it should work with it.
 
Thank you for that information. I have two follow up questions if you don't mind.

>>1.) What causes this? Is it a difference between how OVMF and a bare metal UEFI implementation work? Or is it a bug >>on Ubuntu's side?
The full uefi specs allow to use differents rom name (and motherboard should scan them). But baic uefi implementation is looking for /EFI/BOOT/BOOTx64.EFI. (windows & macosx use this file for example)

>>2.) If I copy the EFI file over like this, will update-grub still work when kernels are updated, or am I going to ahve to repeat this step every time I need an update to grub?
Just copy it once. I shouldn't change in time anyway.
 
Thank you for all of your help.

I was finally able to get it to work by editing the boot order options in the proxmox setup screen for the VM. It was not enough that virtio0 was Boot Device 1, but I also had to set boot devices 2 and 3 to "none". Now it works.
 

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!