Problems with networking an unprivileged container

I’ve been experimenting with lxc unprivileged containers on a unbuntu 20.04 system and I wanted to move to my larger server. I thought I did the same things, but unvfortunately, I can’t seem to get the containers to start up.
Steps:

  1. apt install lxc
  2. apt install btrfs-progs lxc-templates lxctl
  3. confirm existence of /etc/subuid /etc/subguid
  4. create .config/lxc/default.conf
    xc.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.idmap = u 0 231072 65536
    lxc.idmap = g 0 231072 65536
  5. edit /etc/lxc

USERNAME TYPE BRIDGE COUNT

dean veth lxcbr0 10
6. Download an image
lxc-create -t download -n t1 – -d ubuntu -r focal -a amd64
7. Confirm the virtual network
$ ip a | grep lxc
7: lxcbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000 inet 10.0.3.1/24 brd 10.0.3.255 scope global lxcbr0
— note there are several other vnets as I run kvm, qemu and multiple visual machines on this server (but I am also running the same on the smaller machine)
9. lxc-start -n t1 -o xxx -l all

  • the output is state ABORTING instead of RUNNING
  • The first two lines of the log file are:lxc-start t1 20240923164547.368 ERROR network - network.c:setup_hw_addr:3805 - No such device - Failed to perform ioctl
    lxc-start t1 20240923164547.369 ERROR network - network.c:lxc_network_setup_in_child_namespaces_common:3852 - No such device - Failed to setup hw address for network device “eth0”

I faintly remember something similar when setting up on the smaller server, but I forgot to write down how I solved it then. I can’t seem to find the solution now. As far as I know both machines are set up the same way. The larger server used to have docker, but before I insetalled one the larger server, I saw a post about docker interfering with the network, so I removed docker before I installed lxc.

Any pointers?

Thanks.

Testing on two more machines reveals a solution. One user (any user) has to create and start a container using the systemd-run command on the linuxcontainers howto page (not given on the ubuntu page). After that any account can use the commands without using the systeme-run command.
Not sure what the specific problem was, but running using systemd fixes it.

Reassure me, you have changed :xx:xx:xx to the MAC address of the network card.

Kind regards,
Romain