Boot LXD VM from USB

Hi,

is there currently a way to boot a LXD VM from a physical USB device?
I’m trying to boot Unraid, which can only be booted from USB. Nothing for production usage, just some experiments.

I created the VM and added the USB device:

lxc init unraid --empty --vm -c security.secureboot=false -c limits.cpu=4 -c limits.memory=4GB
lxc config device add unraid sda usb vendorid=XXXX productid=XXXX

On boot it just ends in this:

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

>>Start PXE over IPv4.

Porbably the VM doesn’t even try to boot the USB device. I was out of ideas pretty fast, and googling didn’t give anything. Is this even possible?

Cheers

Try hitting ESC and then access the boot menu see if the device appears in the list?

The boot manager contains the QEMU disk, network boot devices, and “UEFI Misc Device”.
I tried “UEFI Misc Device”, but that didn’t do anything:

BdsDxe: failed to load Boot0001 "UEFI Misc Device" from VenHw(93E34C7E-B50E-11DF-9223-2443DFD72085,00): Not Found

Don’t know if this is the USB device. It’s vendor/product ID is “0781:5571” (a SanDisk Cruzer Fit stick). UEFI booting from the device on bare metal or inside of a Proxmox VM works. Gonna try if the USB stick is shown in a regular lxd ubuntu vm if I add it there, and give feedback as soon as I have news.

It took some time as I was busy, but now came back to this. I created a normal Ubuntu 20.04 VM and added the USB drive. Within the Ubuntu VM I can see the device as /dev/sdb with its only partition beeing /dev/sdb1. I can mount this partition and it seems to be a correct unraid root (no great surprise, as booting from the USB drive on bare metal works as expected).

In the boot manager there is an option Boot Maintenance Manager >> Boot From File. I would expect two entries there, one for the regular disk which contains the Ubuntu boot partition, and an entry for the USB drive. But there is only one, refereing to the first harddisk, which is the Ubuntu boot drive. So I guess, the current boot process doesn’t have the USB drive ready to use. I tried to set reuired=true for the device, but I guess this option has nothing to do with the boot process, and just avoids starting the instance without the device being present.

So I’m again out of ideas pretty fast. Actually I’m quite happy with that result too, LOL, it’s a really good point about LXD: It’s so clear and reduced about it’s options, that you don’t need to mess around for hours or even days reading cryptic, outdated and useless documentations like with other tools. Although I would be happier if it just would have worked :smiley: But I’m sure, what I try to accomplish, is not yet thought to be done easy in the current state of VMs in LXD.

Is there any option left to try? Something to make the USB drive accessible during boot?

Thanks! Cheers!

Might be worth booting into the EFI shell and seeing what devices it detects.
There’s no good reason it couldn’t boot from the stick unless it’s missing USB support for some reason (but it’s not something we turned off in our firmware build).