Create an Ubuntu VM with desktop using LXD provider in Terraform
Tony Arnold
a.c.arnold at gmail.com
Mon Jun 2 15:03:47 UTC 2025
Hello All,
If there are better places to ask this, then please let me know.
I'm using Terraform to create a virtual machine using the LXD provider.
I'd like to the VM to have a desktop environment so I can use it to
test a PyQt application.
I can create such a VM using the lxc CLI with this:
lxc launch images:ubuntu/noble/desktop ubuntu --vm -c limits.cpu=4 -c limits.memory=4GiB --console=vga
but I'm trying to figure out how to do this in Terraform with the LXD
provider. I currently have this to specify the image I want to use:
resource "lxd_cached_image" "envtest" {
source_remote = "ubuntu"
source_image = "noble"
type = "virtual-machine"
}
Taking a clue from the CLI example above, I tried changing the
source_image entry to "noble/desktop" but that failed with this:
Failed getting image: The requested image couldn't be found for
fingerprint "noble/desktop"
I've googled this but not found any answers. Has anyone on here got any
ideas either how to fix this or where I can look to find an answer?
All help gratefully received.
Regards,
Tony.
--
Tony Arnold; Retired computer scientist; a.c.arnold at gmail.com
More information about the ubuntu-users
mailing list