Https://ubuntu.com/tutorials/how-to-run-docker-inside-lxd-containers

Ubuntu Version

Ubuntu 24.04 LTS

Desktop Environment (if applicable)

GNOME

please update this tutorial and while you are at it please add gui instructions.

Problem Description

been trying to follow this tutorial on

  1. lxd cluster built on 3 raspberry pi 5’s running core 24.
  2. on a stand alone intel based mac mini running nobel desktop .because some things lxd do not work on arm version of ubuntu.

just can’t successfully get a lxd container running docker. using either the gui or terminal.

Moved to LXD Support.

Please post error messages or screenshots relevant to the issues being encountered.

Thanks

copying and pasting from the tutorial.

my-user-name@my-host-name:~$ lxc storage create docker btrfs
Storage pool docker created
my-user-name@my-host-name:~$ lxc launch images:ubuntu/24.04 demo
Launching demo
Error: Failed instance creation: Failed getting remote image info: Failed getting image: The requested image could not be found for fingerprint “ubuntu/24.04”
my-user-name@my-host-name:~$

if i switch to the gui. i can create a container but it gets created in the default zfs pool rather than the docker btrfs pool. the tutorial starts out warning that docker can not run on zfs.

stumbling around in the dark in the gui’s on the mac mini (noble desktop) never managed to get the container onto the docker pool.

on the rpi’s (core 24) did manage to get it to the right pool (don’t know how) when i ran it i got error virtiofsd missing. found out that virtiofsd is only available for amd not arm.

@ubuntu-one-sci thanks for the command output snippet. images: no longer provides regular Ubuntu images and users are expected to use ubuntu:24.04 instead which is a more “official” image than the old images:ubuntu/24.04 community one.

@mionaalex the guide on ubuntu.com is quite dated. I think it should either be refreshed or removed.

just tried substituting ubuntu:24.04 as you suggested.

my-user-name@my-host-name:~$ lxc launch images:ubuntu:24.04 demo
Launching demo
Error: Failed instance creation: Failed getting remote image info: Failed getting image: The requested image could not be found for fingerprint “ubuntu:24.04”
my-user-name@my-host-name:~$

update – trying variations of the command. found that “lxc launch ubuntu:24.04 demo”, succeeds at creating a container. but just like container created with the gui it is created in the zfs pool.

second update – by trial and error: i found that by creating a new project “docker” able to create container in right pool. ***(using the gui)***
could not figure out how to mount the demo volume at var/lib/docker as the tutorial instructs. so using the terminal copied and pasted from the tutorial.

my-user-name@my-host-name:~$ lxc config device add demo docker disk pool=docker source=demo path=/var/lib/docker
Error: Failed fetching instance “demo” in project “default”: Instance not found
my-user-name@my-host-name:~$

so need to know how to modify the command to fetch from the docker project instead of the default project….. or how to use the gui to do the var/lib/docker part. then can go to next steps in the tutorial.

images: specifies a remote. You need to use the ubuntu: remote.

The command is lxc launch ubuntu:24.04 demo. This will use the default profile in the project, which likely still specifies the zfs pool for the root disk device. You can specify a storage pool at create time with the --storage flag:

lxc launch ubuntu:24.04 demo --storage docker

Can you please post a link to the tutorial that you are following? It is likely very out-of-date. Thanks.

Also to switch to your new project you can use lxc project switch docker or alternatively specify the --project flag when running the command:

lxc config device add demo docker disk pool=docker source=demo path=/var/lib/docker --project docker

OR:

lxc project switch docker
lxc config device add demo docker disk pool=docker source=demo path=/var/lib/docker

Ah I now see that the tutorial in question is in the title!

I’ll flag this internally so that we can get the page updated. Thanks

1 Like

when i try the modified line i get

just thought of another possible reason why it can not find a volume that is there (shows up in the gui listing of volumes) is that both the container and the volume are named demo.

when you update it .. please tell how to do it using both the cli and gui

i think this is how to describe a bug in the gui.

when you create a volume there is a place to specify a path. but once created there is no way to edit the path. being able to edit it is necessitated because volumes get created automatically at container or vm creation. with the path set at either nothing or root.

This topic was automatically closed after 30 days. New replies are no longer allowed.