Can't create LXC container

Hello everyone,

Recently I encountered an unexpected error when creating LXC containers. This workflow has been working for a long time, and as far as I know nothing has changed in my environment. So far I haven’t been able to determine how to debug the issue.

Environment:

  • Windows

  • WSL2

  • Ubuntu 22.04.3 LTS

  • LXC 5.0.0

lxc-create --version
5.0.0

Steps to reproduce:

sudo DOWNLOAD_KEYSERVER="hkp://keyserver.ubuntu.com" \
lxc-create -t download -n rocky1

The image index is downloaded successfully and the list of available distributions is displayed.

For example, I select:

Distribution: rockylinux
Release: 8
Architecture: amd64

Then I get the following error:

Downloading the image index
Downloading the rootfs

ERROR: Failed to download https://images.linuxcontainers.org/images/rockylinux/8/amd64/default/20260608_02:06/rootfs.tar.xz

lxc-create: rocky1: lxccontainer.c: create_run_template: 1627 Failed to create container from template
lxc-create: rocky1: tools/lxc_create.c: main: 317 Failed to create container rocky1

The same issue occurs with every distribution I have tested (Rocky Linux, AlmaLinux, Ubuntu, etc.).

Additional information:

curl -I https://images.linuxcontainers.org/images/ubuntu/noble/amd64/default/

returns:

HTTP/1.1 200 OK

and

curl -I https://images.linuxcontainers.org/images/ubuntu/noble/amd64/default/20260608_07:42/rootfs.tar.xz

returns:

HTTP/1.1 302 Moved Temporarily
Location: https://fra1mirror01.do.images.linuxcontainers.org/...

So the image server appears to be reachable.

Has anyone seen a similar issue or can suggest additional debugging steps?

update1:

when I do:

sudo DOWNLOAD_KEYSERVER="hkp://keyserver.ubuntu.com" lxc-create  -n test -t download -l TRACE -o lxc.log -- -d ubuntu -r noble -a amd64                    The cached copy has expired, re-downloading...
Downloading the image index
Downloading the rootfs
ERROR: Failed to download https://images.linuxcontainers.org//images/ubuntu/noble/amd64/default/20260608_07:42//rootfs.tar.xz
lxc-create: test: lxccontainer.c: create_run_template: 1627 Failed to create container from template
lxc-create: test: tools/lxc_create.c: main: 317 Failed to create container test

I get (lxc.log)

sudo cat lxc.log
lxc-create test 20260610130907.229 TRACE    lxccontainer - lxccontainer.c:create_partial:197 - Created "4/partial" to mark container as partially created
lxc-create test 20260610130907.243 TRACE    dir - storage/dir.c:dir_create:87 - Created directory "/var/lib/lxc/test/rootfs"
lxc-create test 20260610130907.245 TRACE    lxccontainer - lxccontainer.c:do_lxcapi_save_config:2672 - Saved config file "/var/lib/lxc/test/config"
lxc-create test 20260610130907.247 TRACE    utils - utils.c:wait_exited:349 - Reaped child process 24600
lxc-create test 20260610130907.252 DEBUG    storage - storage/storage.c:get_storage_by_name:209 - Detected rootfs type "dir"
lxc-create test 20260610131043.927 ERROR    lxccontainer - lxccontainer.c:create_run_template:1627 - Failed to create container from template
lxc-create test 20260610131043.927 TRACE    commands - commands.c:lxc_cmd:513 - Connection refused - Command "get_state" failed to connect command socket
lxc-create test 20260610131043.927 DEBUG    storage - storage/storage.c:get_storage_by_name:209 - Detected rootfs type "dir"
lxc-create test 20260610131043.927 INFO     lxccontainer - lxccontainer.c:container_destroy:3009 - Destroyed rootfs for test
lxc-create test 20260610131043.928 INFO     lxccontainer - lxccontainer.c:container_destroy:3074 - Destroyed directory "/var/lib/lxc/test" for "test"
lxc-create test 20260610131043.928 ERROR    lxc_create - tools/lxc_create.c:main:317 - Failed to create container test

We have an option to disable GPG validation I believe and in newer LXC it’s what’s always done as the GPG key network has proved itself to be very unreliable over the years.

But you’re running a rather old version of LXC here (5.x when current is 7.x) so the version you’re using may not support that.