Migrating VM from KVM to LXD

Hi everyone,

I am attempting to migrate a VM to LXD (it’s a debian 10 installation), so what I did so far:

  1. got the qcow2 image
  2. created the metadata and compressed it
  3. imported the image into lxc
  4. created the VM
  5. disabled secure boot (checked it with lxc config edit …)

but the VM fails to start, I get the error:

BdsDxe: failed to load Boot0001 "UEFI QEMU QEMU HARDDISK " from PciRoot(0x0)/Pci(0x1,0x1)/Pci(0x0,0x0)/Scsi(0x0,0x1): Not Found

What am I missing? Thank you.
PS: I pressed ‘Esc’ but on the boot order I only UEFI options. I don’t know what i’m doing wrong.

The VM config looks like this:

architecture: x86_64
config:
image.description: Test VM HDD
image.os: Debian
image.release: buster 10.10
security.secureboot: “false”
volatile.base_image: 009887adfbc854aacdabe4280dc539fff068d66693f6c819b520c92b239aa47f
volatile.eth0.hwaddr: 00:16:3e:14:74:2e
volatile.last_state.power: STOPPED
volatile.uuid: 52162898-36bc-4211-864d-f6b68adf11b7
volatile.vsock_id: “10”
devices: {}
ephemeral: false
profiles:

  • medium
    stateful: false
    description: “”

Was your source VM using UEFI?
If not, that may be the problem and you may need to do a bunch of filesystem re-shuffling to give it a UEFI compatible bootloader.

It was not using UEFI, but plain old BIOS. Does LDX only support UEFI boot?

Indeed, LXD’s VM feature is effectively legacy free, we only support UEFI, default to using secureboot and rely almost exclusively on virtio devices.

Oh, ok, I didn’t know that, so that’s what I missed, thank you.

Sencond attempt. I installed a new debian 10 in UEFI mod on a local KVM, transfered the image but I get the same error.

BdsDxe: failed to load Boot0001 "UEFI QEMU QEMU HARDDISK " from PciRoot(0x0)/Pci(0x1,0x1)/Pci(0x0,0x0)/Scsi(0x0,0x1): No
t Found

#1. shouldn’t the disk image be present in the vm config? Although it imported the .qcow2 image, the currently the config looks like this (disk is not mentioned):

architecture: x86_64
config:
image.description: Test 2 VM HDD
image.os: Debian
image.release: buster 10.10
security.secureboot: “false”
volatile.base_image: 0b09be24a75213c706374418de99cfbed3a57f080f65b4cc9f8bb4e9d08925ba
volatile.eth0.hwaddr: 00:16:3e:0a:61:36
volatile.last_state.power: STOPPED
volatile.uuid: 6179c37e-fdab-4b82-9124-42af8a401862
volatile.vsock_id: “12”
devices: {}
ephemeral: false
profiles:

  • default
    stateful: false
    description: “”

#2. I wanted to boot from a CD, I added it with the following command:

lxc config device add VM-name custom-device-name disk source=/home/user/pathtoiso/isoname.iso

in the VM bootmenu it appeared but selecting it, i just got an empty screen. What is the proper way to boot an .iso image? (the remote system doesn’t have a GUI, I can only connect via terminal to it).

#3. I am using the lxc 4.0.8 (installed it with snap install lxd --channel=4.0/stable as suggested on debian’s tutorial). What is the latest stable version I should use?

Help is very much appreciated, thank you.

Pressing ESC and then selecting the drive works fine usually. You could also try setting boot.priority=10 on it which should have it booted immediately without having to go through the menu.

I cannot boot any iso files. With secureboot on, I get
error: Secure Boot forbids loading module from (cd0)/boot/grub/x86_64-efi/part_sunpc.mod.
and without secureboot I just get a blank screen (tried different iso files downloaded from the debian official website). Just to make sure, I can boot any CD iso files, like debian-10.11.0-amd64-netinst.iso right or do these images need to be modified in some way to work lxd?

Booting ISOs works fine unmodified, only Windows needs a lot of rework through distrobuilder.

I’ve not booted a Debian 10 ISO recently but I did boot a Debian 11 one this week without issues.

I think I figured the problem out. It’s the terminal connection. Even “mc” runs in black and white via the terminal. I don’t know what the exact issue is here.
So I installed lxc on the local machine, set up the cluster, connected to cluster, and started the console on the local machine, and it works just fine.

Sorry for wasting you time. If you could be so nice to help me with one more questions:
#1. how to disable the clustering on the remote machine (set up by lxc config set core.https_address :8443) as this solution exposes the 8443 port to the whole internet. Setting these values to empty string is enough?

Thank you very much.