HA OS installation fails on UEFI in qemu-kvm

Doing a new install to libvirt (qemu-kvm x86_64) on headless Ubuntu Server 22.04 as described here Linux - Home Assistant

And it ends up in UEFI shell. In BIOS, Secure Boot is Disabled (and cannot be enabled). I have no previous HAOS image from which I could restore EFI partition (like other users suggested on UEFI issues after update of existing HAOS).

This is the autoselected platform stuff by virt-manager GUI (“Generic or Unknown OS: Usage not recommended”):

 <os>
    <type arch="x86_64" machine="pc-i440fx-jammy">hvm</type>
    <loader readonly="yes" type="pflash">/usr/share/OVMF/OVMF_CODE_4M.fd</loader>
    <nvram>/var/lib/libvirt/qemu/nvram/ha36_VARS.fd</nvram>
    <boot dev="hd"/>
  </os>

I have tried multiple times other platform variants (Linux 2018, BIOS, various UEFI loaders…) but no go.

Any idea?

Since I’m on Ubuntu 20.04 Desktop, the setup options may differ. For the OS, I picked Generic default. For the Customization UEFI x86_64:… - I seem to recall I just had one option.

Anyway, here is the resulting XML file:

  <os>
    <type arch="x86_64" machine="pc-i440fx-focal">hvm</type>
    <loader readonly="yes" type="pflash">/usr/share/OVMF/OVMF_CODE.fd</loader>
    <nvram>/var/lib/libvirt/qemu/nvram/hassio_VARS.fd</nvram>
    <boot dev="hd"/>
  </os>

Eh, call me stupid - I was not aware that qemu cannot handle compressed xz files on the fly.
I had to decompress the downloaded qcow2.xz image first. Too much time spent with Arch Linux’ xz packages :slight_smile:

Lesson learned:

  • virt-manager shows any file as available storage.
  • the Home Assistant installation guide should mention that the downloaded file must be manually uncompressed.
2 Likes