LXD configuration notes

Update snap to latest version

sudo snap refresh lxd --channel=latest

Autostart

lxc config set <container> boot.autostart 1

Disable firewall

By editing network bridge

config
  ipv4.firewall: "false"
  ipv6.address: none

or by calling

lxc network set lxdbr0 ipv4.firewall false
lxc network set lxdbr0 ipv6.firewall false

Fixed ip

lxc stop <container>
lxc network attach lxdbr0 <container> eth0 eth0
lxc config device set <container> eth0 ipv4.address 192.168.45.45
lxc start <container>

Add mountpoint from host

lxc config device add <container> <new-device-name> disk source=<path> path=<path>

Enabling domain

Edit the network with

lxc network edit lxdbr0

then make config look like this:

config:
  dns.domain: lxd.40.lan

Enable nested containers

lxc config set <container> security.nesting true

Listing images on images: remote

list all images

lxc image list images:

filter images only for certain distros

lxc image list images: 'alpine'
lxc image list images: 'opensuse'

changed formats

lxc image list images: --columns lfast --format csv

formats

columns: