Could not start container on Raspberry Pi 3B with

I try to setup container to run CAPT drivers for Cannon printer based on this instructions on my Raspberry Pi 3B

  1. I have setup Network Bridge
  2. Setup shared UID and GID and user.max_user_namespaces=15000
  3. I have create container with Ubuntu Bionic amd64
  4. Update it config to this:
lxc.include = /usr/share/lxc/config/common.conf
lxc.include = /usr/share/lxc/config/userns.conf
lxc.arch = linux64

# Container specific configuration
lxc.apparmor.profile = generated
lxc.apparmor.allow_nesting = 1
lxc.idmap = u 0 100000 65536
lxc.idmap = g 0 100000 65536
lxc.rootfs.path = dir:/var/lib/lxc/canon/rootfs = canon

# Network configuration = veth = lxcbr0 = up

When I start container under root I have this error:

$lxc-start -n canon
lxc-start: canon: ../src/lxc/lxccontainer.c: wait_on_daemonized_start: 878 Received container state "ABORTING" instead of "RUNNING"
lxc-start: canon: ../src/lxc/tools/lxc_start.c: main: 306 The container failed to start
lxc-start: canon: ../src/lxc/tools/lxc_start.c: main: 309 To get more details, run the container in foreground mode
lxc-start: canon: ../src/lxc/tools/lxc_start.c: main: 311 Additional information can be obtained by setting the --logfile and --logpriority options

When I start in foreground mode:

$lxc-start -F -n canon
lxc-start: canon: ../src/lxc/sync.c: sync_wait: 34 An error occurred in another process (expected sequence number 7)
lxc-start: canon: ../src/lxc/start.c: __lxc_start: 2107 Failed to spawn container "canon"
lxc-start: canon: ../src/lxc/tools/lxc_start.c: main: 306 The container failed to start
lxc-start: canon: ../src/lxc/tools/lxc_start.c: main: 311 Additional information can be obtained by setting the --logfile and --logpriority options

Additional info:

LXC version 5.0.2
Kernel configuration not found at /proc/config.gz; searching...
Kernel configuration found at /boot/config-6.1.0-rpi7-rpi-v7

--- Namespaces ---
Namespaces: enabled
Utsname namespace: enabled
Ipc namespace: enabled
Pid namespace: enabled
User namespace: enabled
Network namespace: enabled

--- Control groups ---
Cgroups: enabled
Cgroup namespace: enabled
Cgroup v1 mount points: 
Cgroup v2 mount points: 
 - /sys/fs/cgroup
Cgroup device: enabled
Cgroup sched: enabled
Cgroup cpu account: enabled
Cgroup memory controller: enabled
Cgroup cpuset: enabled

--- Misc ---
Veth pair device: enabled, loaded
Macvlan: enabled, not loaded
Vlan: enabled, not loaded
Bridges: enabled, loaded
Advanced netfilter: enabled, loaded
CONFIG_IP6_NF_TARGET_MASQUERADE: enabled, not loaded
FUSE (for use with lxcfs): enabled, loaded

--- Checkpoint/Restore ---
checkpoint restore: missing
File capabilities: enabled

Note : Before booting a new kernel, you can check its configuration
usage : CONFIG=/path/to/config /usr/bin/lxc-checkconfig

Could someone help what is the issue here? Maybe it is even impossible to run amd64 and 32bit libs on ARM arch?

Welcome to the forum and thanks for bringing this nice trick to our attention, GitHub - nerk/canon-capt-installation: Instructions on how to install Canon CAPT-based printers (LBP-***) for Ubuntu 20.04 and CUPS

Indeed, with system containers the architecture of the container has to match the architecture of the host. What we call system containers are in essence a process tree on the host that has been isolated from the rest of the system through kernel features like namespaces and cgroups.

Here is me running pstree on the host and taking a screenshot of the output. There are four system containers. The second is Alpine, the fourth is Ubuntu. Same architecture, host and containers.

The part that you need to figure out is how to run a foreign architecture in an LXC container. There was a discussion for this on this forum (start from there). It would require some more work from you (or searching if someone already done this and wrote it down). You would launch a native container (arm64) on the RPi and configure qemu-user-static as a binfmt helper to translate on the fly the Canon binaries into ARM64. I do not know whether it will work but I would like to write a tutorial if it does.

Thank you, @simos for information and you help, because I really do not know where to go and what to search. Will try to dig into qemu-user-static

1 Like