How to install Ubuntu Server 12.04 in a Virtualbox VM with UEFI boot enabled [closed]

I have a server which I'd like to install Ubuntu 12.04 on, but I've had some problems and thought it would be nice to get things working in a Virtualbox VM with the same features as the server.

I want to enable UEFI-boot in the VM. I "Enable EFI" in the System / Motherboard settings for the VM.

System settings for the Virtualbox VM

I make sure the Ubuntu Server 12.04 ISO is inserted when I boot.

The CD/DVD device has the Ubuntu Server 12.04 ISO inserted in the Virtualbox VM when booting it

And yet I get stuck in the UEFI boot console when I start the VM.

enter image description here

How do I install Ubuntu Server 12.04 in a UEFI boot-enabled Virtualbox machine?


Solution 1:

If you are getting to the EFI shell you likely already installed Ubuntu in EFI mode. The caveat I have found it that thought the OS installs fine using the grub-efi bootloader, an EFI boot entry for that boot loader is not written into the EFI variables correctly. This means the EFI firmware does not know how to load the boot loader and thus the OS and drops into the shell. See if you can load the boot loader and the OS from the shell:

fs0:

cd EFI/ubuntu

grubx64.efi

If this works that is definitely your issue (and mine). Supposedly the installed efibootmgr and can set this up for you but evidently is it confused in this release as it requires efivars and wants you to load this as a kernel module but in 12.04 kernels this is monolithically compiled in (meaning always in the kernel and not as a module) so it fails with an error message telling you to "modprobe efivars".