[TOS 6.0] Unpriviledged LXC containers

Hi,

I am trying to recreate the configuration from:

But it started to fail on some net device. Anybody got it working? I was wondering about docker but thats overcomplicating things and currently its not possible to use Docker on more than one device (no docker swarm option)

Thanks!
AreYouLoco?

root@ap:/srv/lxc# lxc-start -F bitcoin                          
lxc-start: bitcoin: utils.c: safe_mount: 1198 Operation not permitted - Faile
d to mount "(null)" onto "/usr/lib/lxc/rootfs/sys/devices/virtual/net"
lxc-start: bitcoin: conf.c: lxc_mount_auto_mounts: 801 Operation not permitte
d - Failed to mount "(null)" on "/usr/lib/lxc/rootfs/sys/devices/virtual/net"
 with flags 46
lxc-start: bitcoin: conf.c: lxc_setup: 4094 Failed to setup first automatic m
ounts
lxc-start: bitcoin: start.c: do_start: 1291 Failed to setup container "bitcoi
n"
lxc-start: bitcoin: sync.c: sync_wait: 36 An error occurred in another proces
s (expected sequence number 3)
lxc-start: bitcoin: start.c: __lxc_start: 2053 Failed to spawn container "bit
coin"
lxc-start: bitcoin: tools/lxc_start.c: main: 308 The container failed to star
t
lxc-start: bitcoin: tools/lxc_start.c: main: 314

So I realized that the problem exists because I introduced VLANs to my network setup. And it should be the same on TOS 5.x. I tried to use options mentioned in Linux Containers - LXC - Manpages - lxc.container.conf.5

But they are not recognized by lxc on Omnia. Anybody is doing some VLANs with LXC?

Your LXC errors seem to relate to mounting volumes though. How did you come to the conclusion that vlans are the cause?

Because its trying to mount in /virtual/net and the only thing that changed in my setup from TOS5.x is VLANs

EDIT: Now I am sure its VLANs because when I change the LXC config for particular container to type vlan and vlan id it spits out different error:

@ap:/srv/lxc# lxc-start -F bitcoin
lxc-start: bitcoin: network.c: netdev_configure_server_vlan: 1102 File exists
 - Failed to create vlan interface "vlan1337-0" on "br-lan"
lxc-start: bitcoin: network.c: lxc_create_network_priv: 3419 File exists - Fa
iled to create network device
lxc-start: bitcoin: start.c: lxc_spawn: 1826 Failed to create the network
lxc-start: bitcoin: start.c: __lxc_start: 2053 Failed to spawn container "bit
coin"
lxc-start: bitcoin: tools/lxc_start.c: main: 308 The container failed to star
t
lxc-start: bitcoin: tools/lxc_start.c: main: 314 Additional information can b
e obtained by setting the --logfile and --logpriority options
root@ap:/srv/lxc#

I think I will ask on openwrt forum then as the problem is not Turris specific.

1 Like

Seems like I need newer lxc:

https://linuxcontainers.org/lxc/news/#vlan-support-on-veth-devices

Edit: Nope I managed to set containers on VLAN using LuCi and lxc 4.0.10 and it works!

1 Like

I am trying to compile it for HBL branch. Will see if it works. Its still compiling…

No it didnt work. It needs ninja/meson that is available only in openwrt 22.03. I asked for a backport we will see

1 Like

Regardless of what I said that it would be nice to have lxc 5.0.1 the problem goes away when I comment out two lines about lxc.idmap. Then the container starts.

So it seems like the unprivileged part is broken on TOS 6.0. For today I am fed up of trying to make it work

@psiegl Hi do you have any idea why it fails on TOS 6.0? You are the OP of the Unprivileged LXC container on Turris OS 5.0.0

1 Like

There is a workaround to that issue but it should be fixed in lxc 4.0.12. And I was wrong its not VLAN related.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.