Trying to Boot a Debian Live Image in a LXD VM

I am trying to boot a Debian Live image in a LXD VM. I am receiving an error saying that the live file system can’t be found. The interesting part is that the boot menu does come up when I start the LXD VM.

Here’s the error:
image

Here’s how I am creating the LXD VM:

    lxc init Test01 --empty -c limits.cpu=2 -c limits.memory=4GB -c security.secureboot=false -c migration.stateful=true
    lxc config device override Test01 root size=20GB size.state=4GB
    lxc config device add Test01 install disk source=/home/scott/Downloads/myimage.img boot.priority=10

Interesting part is that I see the Boot menu, but once I continue, I get the graphical “…” dots on the screen showing the boot process. After about a minute, it fails with the “initramfs” error. This same image boots just fine in virt-manager as long as the disk type is set to “disk bus” USB.

Any ideas?

Hi,

I just tried this on latest/edge channel with the https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/debian-live-12.1.0-amd64-xfce.iso image and it worked fine.

Please could you advise which image you were using and if latest/edge fixes it.

@tomp Thomas, I received this error in trying to boot an image for android-x86_64 and in trying to boot TailsOS.

So not Debian as the subject said?

Do you have links to the specific files?

@tomp Thomas, I am guessing that the core image is Debian based. Here is the link to the image.
TailsOS
I am able to use this exact image in Virt-Manager and here’s a couple of screens showing how.

The notable change was that I had to specify the disk in KVM/QEMU as type USB and “removeable” before I could get it to boot. If I could build a LXD VM with the same attributes, I am likely to have success.

@tomp I titled this thread “debian” because there were other images that used Debian that had this booting issue. Hopefully the “TailsOS” is a specific use case that might home in on what exactly I might have overlooked. Thanks, Scott

Can you try renaming them to .iso and see if that works or check if they have an iso option to download.

I actually had tried that about a week ago. They do have a “.iso” and I tried booting it with the same result and I also renamed the “.img” to “.iso” and it booted with the same error as well. From my experience with KVM, it appears that the bus type of “USB” fixed the error over there along with specifying the removable attribute. Does that make any sense?

Does the Debian iso I linked to work? So we can check its indeed an image difference that is the issue.

@tomp Yes, the Debian that you linked works.


Here’s the resulting booted Debian Live instance.

1 Like

@tomp My inclination here is to believe that the “busybox” error that I get at the top of this thread is related to the fact that the Debian image being tested (TailsOS) is looking for media that looks like a removable USB drive rather than a CD Rom. I don’t know what difference that should make, but my example of booting the TailsOS sucessfully in QEMU/KVM by specifying that the TailsOS image was disk bus type “USB” made all of the difference. I’m not sure what that equivalent option might be in a LXD VM.

There’s not an equivalent option at this time.

@tomp have you ever heard of this “USB Bus” type as being a requirement for booting an image before? The thing that is baffling to me is that if KVM/QEMU has support for this capability, isn’t it true that under the covers that a LXD VM uses KVM as the Virtual Machine engine?

At the moment block disk devices are attached as either scsi-hd or scsi-cd devices.

But it sounds like some images require being attached as a USB storage device.

https://qemu-project.gitlab.io/qemu/system/devices/usb.html

You could add this as a feature request here https://github.com/canonical/lxd/issues

1 Like

@tomp Thanks Thomas. I added a feature request as you indicated. After much testing, this does appear to be a functionality gap that exists in KVM/QEMU, but not in LXD VM’s.

1 Like