I recently learned how to make my own LXD VM image based on Home Assistant’s QCOW2 VM images. This blog post is a short write-up how to do that! This is of course useful for other qcow2 images as well.
Download a image
I downloaded the Home Assistant OS image in the qcow2 format, and uncompressed it. The image is intended for KVM, and LXD runs VM:s with Qemu/KVM so it’s a good fit for LXD VM:s.
|
|
Write a metadata.yaml file
LXD need some metadata, the format is documented here. A minimal example that I used for Home Assistant can be found below:
|
|
Save it as metadata.yaml, and make it a tarball with:
|
|
Import the image
Import the image as haos
with an image import:
|
|
Launch it!
That’s all, now start it like any other VM with the --vm
flag. LXD will only launch signed images with secure boot by default, to disable that add -c security.secureboot=false
. The full command I used to launch this specific VM was:
|
|
That’s all!