For all of the config files, only those in locations that required root permissions, were made with sudo. I have read both official and downstream debian documentation at least twice and also read all the manpages. Ran on Ubuntu based OS with up to date kernel, mint 20.3 cinnamon.
export DOWNLOAD_KEYSERVER="hkp://keyserver.ubuntu.com"
systemd-run --unit=test --scope -p “Delegate=yes” – lxc-create -n test -t download
debian
bullseye
amd64
Downloading the image index
Downloading the rootfs
Downloading the metadata
mkdir: cannot create directory ‘/home/user’: Permission denied
lxc-create: test: lxccontainer.c: create_run_template: 1616 Failed to create container from template
lxc-create: test: utils.c: lxc_rmdir_onedev: 191 Permission denied - Failed to stat “/media/user/x/test/rootfs”
lxc-create: test: storage/dir.c: dir_destroy: 104 Permission denied - Failed to delete “/media/user/x/test/rootfs”
lxc-create: test: storage/storage_utils.c: storage_destroy_wrapper: 477 Failed to destroy storage
lxc-create: test: lxccontainer.c: container_destroy: 3008 Error destroying rootfs for test
lxc-create: test: tools/lxc_create.c: main: 319 Failed to create container test
cat /etc/subuid
user:100000:65536
cat /etc/subgid
user:100000:65536
default.conf
lxc.net.0.type = veth
lxc.net.0.link = lxcbr0
lxc.net.0.flags = up
lxc.net.0.hwaddr = 00:16:3e:xx:xx:xx
lxc.mount.auto = proc:mixed sys:mixed cgroup:rw:force
lxc.ephemeral = 0
lxc.apparmor.profile = unconfined
lxc.arch = amd64
# this config has these 2 lines appended
~/.config/lxc/default.conf
lxc.idmap = u 0 100000 65536
lxc.idmap = g 0 100000 65536
# both files have the same content
#this path is owned by the same user.
/etc/lxc/lxc.conf
~/.config/lxc/lxc.conf
lxc.lxcpath = /media/user/x
/etc/lxc/lxc-usernet
user veth lxcbr0 255
/etc/default/lxc-net
USE_LXC_BRIDGE=“true”
LXC_BRIDGE=“lxcbr0”
LXC_ADDR=“10.0.3.1”
LXC_NETMASK=“255.255.255.0”
LXC_NETWORK=“10.0.3.0/24”
LXC_DHCP_RANGE=“10.0.3.2,10.0.3.254”
LXC_DHCP_MAX=“253”
LXC_DHCP_CONFILE=""
LXC_DOMAIN=""
#installed with
sudo apt-get install apparmor libpam-cgfs uidmap bridge-utils libvirt0 lxc
lxc-checkconfig
#See below…