Unprivileged container not starting

The host os is ubuntu 22 jammy.
The guest os is ubuntu 22 jammy
I can create and start privileged containers.
But have problem with starting unprivileged containers
I created an unprivileged container:

@ubuntu-librem:~$ lxc-ls -f
NAME       STATE   AUTOSTART GROUPS IPV4 IPV6 UNPRIVILEGED 
ubu-server STOPPED 0         -      -    -    true        

When trying to run it I get errors:

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

the log file has this output

lxc-start ubu-server 20220918222029.943 ERROR    cgfsng - cgroups/cgfsng.c:__cgfsng_delegate_controllers:2953 - Device or resource busy - Could not enable "+memory +pids" controllers in the unified cgroup 11
lxc-start ubu-server 20220918222029.962 ERROR    cgfsng - cgroups/cgfsng.c:__cgfsng_delegate_controllers:2953 - Device or resource busy - Could not enable "+memory +pids" controllers in the unified cgroup 11
lxc-start ubu-server 20220918222029.979 ERROR    start - start.c:print_top_failing_dir:99 - Permission denied - Could not access /home/sherab. Please grant it x access, or add an ACL for the container root
lxc-start ubu-server 20220918222029.979 ERROR    sync - sync.c:sync_wait:34 - An error occurred in another process (expected sequence number 1)
lxc-start ubu-server 20220918222029.980 ERROR    lxccontainer - lxccontainer.c:wait_on_daemonized_start:877 - Received container state "ABORTING" instead of "RUNNING"
lxc-start ubu-server 20220918222029.980 ERROR    lxc_start - tools/lxc_start.c:main:306 - The container failed to start
lxc-start ubu-server 20220918222029.980 ERROR    lxc_start - tools/lxc_start.c:main:309 - To get more details, run the container in foreground mode
lxc-start ubu-server 20220918222029.980 ERROR    start - start.c:__lxc_start:2074 - Failed to spawn container "ubu-server"
lxc-start ubu-server 20220918222029.980 ERROR    lxc_start - tools/lxc_start.c:main:311 - Additional information can be obtained by setting the --logfile and --logpriority options

Any advice?

This is the problem.

Try doing chmod +x on that dir.

1 Like

Thank you.
For completness - it was also needed to chmod +x /home/username/.local
and for good measure I also did chmod +x /home/username/.local /share
and for good measure I also did chmod +x /home/username/.local/share/lxc
and it seems to work now.
Again, thank you

1 Like

I am not entirely sure if this is correct solution. It surely works bu securitywise adding +x to the folder means what exactly: o+x i.e. exedcutive rights for others as I suspect that the user and the group did have that already. Adding execution rights to my folder is for me a no go.
The original info the system gives talks about ACL mods for the container root.
So I did further search as I had no clue what exactly is meant. On ubuntu there is acl package. It contains get/setacl commands. I did try to add container user id (i.e. def. is 100000) to the folder stated, so for this case it would be:
setfacl -m u:100000:x /home/sherab
that did in fact passed the “Permission denied - Could not access” issue. Now I have another but there is progress.
The diagnostics could have been a bit better.

1 Like

Thanks @Hans_Kloss this worked for me - better solution