Use Ubuntu cloud images to launch a VM

I want to launch a VM based on a cloud image from ubuntu:
http://cloud-images.ubuntu.com/releases/jammy/release/

I tried to import it

lxc image import ubuntu.img --alias ubuntuimg

it fails with: Error: Metadata tarball is missing metadata.yaml

Any guide how to use cloud images with lxd?

Use

“lxc launch ubuntu:22.04 v1 --vm”

See “lxc remote list” for the different image repositories available by default.

I have custom cloud image, not one from the registry.

Which file did you download from Ubuntu 22.04 (Jammy Jellyfish) [20230210] ?

One easy way to do this is to launch a new instance using the command I suggested above, then make the desired modifications inside the instance, and once finished use lxc publish <instance> --alias foo to create an image from it to use to create new instances.

See https://linuxcontainers.org/lxd/docs/master/image-handling/#publishing-an-instance-or-snapshot-as-a-new-image

1 Like

Thank you, that’s what I need

1 Like