Noob-Question: Where are the config-files for LXC 5.2 containers

Hello, I am an absolute beginner with lxc. To learn, how to use them, I watched some Youtube-Videos.
I want to configure the containers in a way, that they are directly reachable from other systems on my WLAN.
In the videos, there are directories with config-files under /var/lib/lxc. On my snap-installation on an Ubuntu 22.04, there are no such directories.
How should I configure my containers? Should I create the directories and config -files? Is there another way.
In thankfull advance

There is no such thing as LXC 5.2, so you likely mean LXD 5.2 which is a different beast.
LXD 5.2 uses a database and generates the configs on the fly.

@stgraber thank you very much for your answer!

hm, if I type
lxc --version
the output is
5.2

So this is the LXD - version, although I run lxc with argument --version?
This is a bit confusing :wink:

In all the Youtube videos, I watched so far, they create a container for example with
lxc launch images:ubuntu/focal my_container
and than they find the directory
/var/lib/lxc/my_container with a file config within it.
And then they edit this file, to configure the container, as they like it to have.

But on my installation, there is no such directory and no such config-file.

Is this, because in “reality” I use lxd and work on a DB instead on config-files?

Is there a thread or tutorial or something, that tells me, how to configure my_container, so that it is reachable from all my machines in my WLAN and not to use config-files for this?

I doubt that, because lxc launch is a LXD command and will not create containers in /var/lib/lxc which is a LXC directory.

The command lxc-create will create a container in /var/lib/lxc/.

LXD uses a database stored in /var/snap/lxd/common/lxd/database

Thank you for your answer!
Ok, so obviously does not understand this LXD/LXC-concept at all.
Why is lxc a LXD command? I call lxC, don’t I?

The LXC commands are “lxc-*” e.g “lxc-start” and the LXD client command is “lxc”.

It is very confusing.

indeed :wink:

And what type of commands should I use, if I work with the containers?
The lxc-* - commands?

Both LXD and LXC support containers. So it depends if your containers are using LXD or LXC as to which command you should use.

See Comparing LXD vs. LXC

1 Like