How to disable auto start for all containers

Hi,

How to disable auto start for all containers as default

Hi!

If this is a LXC question and not an LXD question (see https://blog.simos.info/comparison-between-lxc-and-lxd/), then you can set lxc.start.auto to 0. See more at https://linuxcontainers.org/lxc/manpages/man1/lxc-autostart.1.html

If instead you use LXD, you can get a list with all your containers with the following command.

lxc list --format=json | jq --raw-output '.[].name'

Then, for each container, you can run

lxc config set mycontainer boot.autostart false
1 Like

so there is no default setting

You are asking how to change the default setting in LXD so that any newly created container does not autostart.

In that case, you set boot.autostart to false in your default profile.

$ lxc profile set default boot.autostart=false
$ lxc profile get default boot.autostart
false
$ lxc launch ubuntu:18.04 mycontainer
$ lxc config show mycontainer --expanded
architecture: x86_64
config:
  boot.autostart: "false"
...
$ 
1 Like

Thanks