Where to set lxc config defaults on a snap installation


Trying to find the correct file/path to set lxc defaults like;


for lxc that gets installed als part of the lxd snap package.

So I want to set a default instead of having to set it for all individual containers.

Gr, Justin

These are instance level settings, see Instance configuration - LXD documentation

lxc config set <instance> <key>=<value>

@tomp , thank you for your reply.

Sure I was aware these are instance settings. But I was looking to set the default for new instances.


So I think I’m looking for the /etc/lxc/default.conf /etc/lxc/lxc.conf equivalents in a snap install

You are confusing LXC and LXD.

LXD doesn’t use any of the config files from LXC (in fact it has no config files).

You can’t set defaults for all new containers in LXD, but you can set it to apply to all containers using a specific profile, e.g.

lxc profile set default key=value

You are confusing LXC and LXD

Might be.

“lxc config set =” looked to me as being in the lxc domain, so as lxc is included in the lxd snap I was looking for the lxc config files mentioned in the lxc configuration.

But the profile option you mention looks to be workable for my scenario too.

Thank you.

Regards, Justin

It often confuses newcomers. The LXC project is made up of the liblxc container manager and the lxc-* commands.

LXD uses liblxc for running containers, and provides a REST API, which the LXD client command lxc interacts with.