Importing OVF Templates of VMs that use UEFI Boot Mode

Runbooks Sep 12, 2020

It has come to my attention that OVF templates created from VMs that utilize UEFI boot mode generally won't boot without manual intervention after import to a new hypervisor. Example screenshots of failed boot due to missing UEFI boot records:

VMware Workstation / ESXi
Oracle VirtualBox

This behavior, cause, and a work around (migrate the nvram file) can be found in the following VMware KB article: https://kb.vmware.com/s/article/2061784

I found migrating the nvram file a bit hacky personally - it's just about as much overhead to perform this migration as reinstalling the bootloader, and differences in VM configuration may render the nvram migration operation unsuccessful anyway. Because of this, I will not be providing nvram files for OVF templates I share.

This article aims to collect the required steps to remediate this issue for UEFI OVF templates hosted at https://vms.amanshortly.com.

Arch Linux

These steps apply to any images matching the naming pattern *arch-linux*.

VMware Hypervisors

These steps were last verified on 2020-09-12 in VMware Workstation version 15.5.6 build-16341506

  1. Import the OVF template
  2. Update VM settings as follows:
    • Options > General: Set Guest operating system to Linux > Other Linux 5.x or later kernel 64-bit
    • Options > Advanced: Set Firmware type to UEFI
  3. Run the VM
  4. Press Esc at the EFI boot screen to enter Boot Manager
  5. Select Enter setup, then press Enter
  6. Select Boot from a file, then press Enter
  7. Proceed to the All Hypervisors section below

Oracle VirtualBox

These steps were last verified on 2020-09-12 in Oracle VirtualBox version 6.1.14r140239

Note that the Arch Linux VM was created in a VMware hypervisor, and as a result does not include VirtualBox specific drivers - this is why the storage controller type change is necessary. If you intend to use VirtualBox to run this image, I strongly recommend removing the open-vm-tools package, and installing VirtualBox Guest Additions as soon as you get the operating system to boot successfully.

  1. Import the OVF template
  2. Update VM settings as follows:
    • General > Basic: Set Type to Linux
    • General > Basic: Set Version to Arch Linux (64-bit)
    • System > Motherboard: Check Enable I/O APIC
    • System > Motherboard: Check Enable EFI (special OSes only)
    • Storage > Controller: SCSI: Set Type to AHCI
    • Storage > Controller: SCSI: Set Name to SATA
  3. Run the VM
  4. At the UEFI Interactive Shell run the command exit
  5. Select Boot Maintenance Manager, then press Enter
  6. Select Boot From File, then press Enter
  7. Proceed to the All Hypervisors section below

All Hypervisors

Starting point for these steps is the "boot from file" UEFI firmware menu:

  1. Select the device with UUID 8EA1A56E-901F-4348-B574-0976286EF4EA, then press Enter
  2. Select directory <EFI>, then press Enter
  3. Select directory <arch>, then press Enter
  4. Select file grubx64.efi, then press Enter (grub bootloader should have launched, and system should have booted - if not, double check hypervisor specific configuration steps)
  5. Log in to the VM with root / TempP@ss
  6. Run the command grub-install --target=x86_64-efi --efi-directory=/efi, or use the shortcut command !21 to run the same command from history
  7. Shut down, power back on, and verify that UEFI boot is successful

Tags