Its an appliance image which should work on KVM, so I think it would work with LXD.
This is the instructions for virsh (super old but anyway):
On Ubuntu 12.04 LTS:
# sudo apt-get install virtinst python-virtkey python-libvirt libvirt0 libvirt-bin kvm kvm-ipxe qemu qemu-kvm
B) Virtual Appliance Installation:
1. UnTAR aloha-albkvm-4.1.tar.gz
2. Copy aloha-albkvm-4.1.img to /var/lib/libvirtd/images
3. Create a new virtual machine with virtinstall:
[root@ubuntu] # virt-install \
-n aloha1 \ # virtual machine name
-r 512 \ # MB RAM
--accelerate \ # hardware virtualization
--disk path=/var/lib/libvirt/images/aloha-albkvm-4.1.img,bus=ide,cache=none \ # disk image
--os-type linux \
--os-variant virtio26 \ # kvm specific driver
--network=network:default \ # virtual network parameter ( or --network bridge=br0 on a bridge)
--nographics \
--import
I’ve been trying to get it to start with lxc as follows, replacing the boot disk with the downloaded image:
# Create a new container-vm with a minimal root disk (since I'm not going to use it, but rather replace it with the applicance disk).
$ lxc init aloha1 --empty --vm -c security.secureboot=false -d root,size=1MiB
Creating aloha1
# Add the applicance disk and set it to prio=10.
$ lxc config device add aloha1 aloha-disk disk source=/home/erik/Downloads/aloha-albva/aloha-albva.img boot.priority=10
Device aloha-disk added to aloha1
It might have helped, but I also did some changes in the process of going from the raw image I had and skipped converting it to a qcow2 - but simply used the .img as it was (It was probably already a qcow2).
There’s also lxd-migrate which allows importing a raw image (not qcow2) file into a VM directly rather than having to go via the intermediate image step.
This also avoids having 2 disks, one root disk and one boot disk.