Not able to start the unprivialged lxc container

Used config file is ,
lxc.idmap = u 0 231072 10
lxc.idmap = g 0 231072 10
lxc.idmap = u 1002 1002 1
lxc.idmap = g 1003 1003 1
lxc.console.path = none
lxc.mount.auto = proc:mixed sys:mixed cgroup:mixed
lxc.rootfs.path = dir:/var/lib/lxc/test/rootfs
lxc.uts.name=test
lxc.mount.entry = tmpfs tmp tmpfs size=1M 0 0
lxc.mount.entry = /dev/null dev/null none bind,optional,create=file 0 0
lxc.mount.entry = /dev/urandom dev/urandom none bind,optional,create=file 0 0
lxc.mount.entry = /dev/random dev/random none bind,optional,create=file 0 0
lxc.cap.keep = setuid setgid
lxc.mount.entry = /bin bin none ro,bind 0 0
lxc.mount.entry = /lib lib none ro,rbind 0 0
lxc.mount.entry = /sbin sbin none ro,bind 0 0
lxc.mount.entry = /usr/bin usr/bin none ro,bind 0 0
lxc.mount.entry = /usr/lib usr/lib none ro,bind 0 0
lxc.mount.entry = /usr/sbin usr/sbin none ro,bind 0 0
lxc.mount.entry = /etc/alternatives etc/alternatives none ro,bind 0 0
lxc.mount.entry = /sys sys none ro,bind 0 0

/var/lib/lxc/test/rootfs has all the mounting points created before starting the container.

Error log while trying to start the container,

lxc-start test 20211028182552.673 INFO utils - utils.c:get_rundir:273 - XDG_RUNTIME_DIR isn’t set in the environment.
lxc-start test 20211028182552.673 INFO confile - confile.c:set_config_idmaps:1542 - Read uid map: type u nsid 0 hostid 231072 range 10
lxc-start test 20211028182552.673 INFO confile - confile.c:set_config_idmaps:1542 - Read uid map: type g nsid 0 hostid 231072 range 10
lxc-start test 20211028182552.673 INFO confile - confile.c:set_config_idmaps:1542 - Read uid map: type u nsid 1002 hostid 1002 range 1
lxc-start test 20211028182552.673 INFO confile - confile.c:set_config_idmaps:1542 - Read uid map: type g nsid 1003 hostid 1003 range 1
lxc-start test 20211028182552.673 TRACE commands - commands.c:lxc_cmd:312 - Connection refused - Command “get_init_pid” failed to connect command socket
lxc-start test 20211028182552.673 TRACE commands - commands.c:lxc_cmd:312 - Connection refused - Command “get_state” failed to connect command socket
lxc-start test 20211028182552.673 TRACE start - start.c:lxc_init_handler:717 - Created anonymous pair {4,5} of unix sockets
lxc-start test 20211028182552.673 TRACE commands - commands.c:lxc_cmd_init:1249 - Creating abstract unix socket “/home/appfw/.local/share/lxc/test/command”
lxc-start test 20211028182552.673 TRACE start - start.c:lxc_init_handler:729 - Unix domain socket 6 for command server is ready
lxc-start test 20211028182552.673 INFO lxccontainer - lxccontainer.c:do_lxcapi_start:959 - Set process title to [lxc monitor] /home/appfw/.local/share/lxc test
lxc-start test 20211028182552.674 TRACE start - start.c:lxc_start:2023 - Doing lxc_start
lxc-start test 20211028182552.674 INFO lsm - lsm/lsm.c:lsm_init:47 - LSM security driver nop
lxc-start test 20211028182552.674 TRACE start - start.c:lxc_init:746 - Initialized LSM
lxc-start test 20211028182552.674 TRACE start - start.c:lxc_init:753 - Read seccomp policy
lxc-start test 20211028182552.674 TRACE start - start.c:lxc_serve_state_clients:431 - Set container state to STARTING
lxc-start test 20211028182552.674 TRACE start - start.c:lxc_serve_state_clients:434 - No state clients registered
lxc-start test 20211028182552.674 INFO utils - utils.c:get_rundir:273 - XDG_RUNTIME_DIR isn’t set in the environment.
lxc-start test 20211028182552.674 TRACE start - start.c:lxc_init:761 - Set container state to “STARTING”
lxc-start test 20211028182552.674 TRACE start - start.c:lxc_init:824 - Set environment variables
lxc-start test 20211028182552.674 TRACE start - start.c:lxc_init:831 - Ran pre-start hooks
lxc-start test 20211028182552.674 TRACE start - start.c:setup_signal_fd:332 - Created signal file descriptor 7
lxc-start test 20211028182552.674 TRACE start - start.c:lxc_init:842 - Set up signal fd
lxc-start test 20211028182552.674 INFO terminal - terminal.c:lxc_terminal_setup:927 - No terminal requested
lxc-start test 20211028182552.674 TRACE start - start.c:lxc_init:850 - Created console
lxc-start test 20211028182552.674 TRACE start - start.c:lxc_init:857 - Chowned console
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_basecg_debuginfo:1029 - basecginfo is:
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_basecg_debuginfo:1030 - 12:hugetlb:/
11:memory:/user/appfw/0
10:rdma:/
9:devices:/user/appfw/0
8:net_cls,net_prio:/
7:pids:/user.slice/user-1001.slice/session-2.scope
6:freezer:/user/appfw/0
5:cpuset:/user/appfw/0
4:perf_event:/
3:cpu,cpuacct:/user/appfw/0
2:blkio:/user.slice
1:name=systemd:/user/appfw/0
0::/user.slice/user-1001.slice/session-2.scope

lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_basecg_debuginfo:1033 - kernel subsystem 0: hugetlb
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_basecg_debuginfo:1033 - kernel subsystem 1: memory
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_basecg_debuginfo:1033 - kernel subsystem 2: rdma
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_basecg_debuginfo:1033 - kernel subsystem 3: devices
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_basecg_debuginfo:1033 - kernel subsystem 4: net_cls
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_basecg_debuginfo:1033 - kernel subsystem 5: net_prio
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_basecg_debuginfo:1033 - kernel subsystem 6: pids
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_basecg_debuginfo:1033 - kernel subsystem 7: freezer
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_basecg_debuginfo:1033 - kernel subsystem 8: cpuset
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_basecg_debuginfo:1033 - kernel subsystem 9: perf_event
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_basecg_debuginfo:1033 - kernel subsystem 10: cpu
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_basecg_debuginfo:1033 - kernel subsystem 11: cpuacct
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_basecg_debuginfo:1033 - kernel subsystem 12: blkio
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_basecg_debuginfo:1033 - kernel subsystem 13: cgroup2
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_basecg_debuginfo:1036 - named subsystem 0: name=systemd
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:cg_hybrid_init:2417 - Writable cgroup hierarchies:
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:1010 - Hierarchies:
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:1015 - 0: base_cgroup: /user/appfw/0
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:1016 - mountpoint: /sys/fs/cgroup/systemd
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:1017 - controllers:
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:1019 - 0: name=systemd
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:1015 - 1: base_cgroup: /user/appfw/0
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:1016 - mountpoint: /sys/fs/cgroup/cpu,cpuacct
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:1017 - controllers:
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:1019 - 0: cpu
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:1019 - 1: cpuacct
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:1015 - 2: base_cgroup: /user/appfw/0
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:1016 - mountpoint: /sys/fs/cgroup/cpuset
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:1017 - controllers:
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:1019 - 0: cpuset
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:1015 - 3: base_cgroup: /user/appfw/0
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:1016 - mountpoint: /sys/fs/cgroup/freezer
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:1017 - controllers:
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:1019 - 0: freezer
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:1015 - 4: base_cgroup: /user/appfw/0
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:1016 - mountpoint: /sys/fs/cgroup/devices
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:1017 - controllers:
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:1019 - 0: devices
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:1015 - 5: base_cgroup: /user/appfw/0
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:1016 - mountpoint: /sys/fs/cgroup/memory
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:1017 - controllers:
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:1019 - 0: memory
lxc-start test 20211028182552.674 TRACE cgroup - cgroups/cgroup.c:cgroup_init:51 - Initialized cgroup driver cgfsng
lxc-start test 20211028182552.674 TRACE cgroup - cgroups/cgroup.c:cgroup_init:56 - Running with hybrid cgroup layout
lxc-start test 20211028182552.674 TRACE start - start.c:lxc_init:864 - Initialized cgroup driver
lxc-start test 20211028182552.674 INFO start - start.c:lxc_init:866 - Container “test” is initialized
lxc-start test 20211028182552.674 ERROR cgfsng - cgroups/cgfsng.c:create_path_for_hierarchy:1198 - The cgroup “/sys/fs/cgroup/systemd/user/appfw/0/lxc/test” already existed
lxc-start test 20211028182552.674 ERROR cgfsng - cgroups/cgfsng.c:cgfsng_create:1287 - Failed to create cgroup “/sys/fs/cgroup/systemd/user/appfw/0/lxc/test”
lxc-start test 20211028182552.674 TRACE cgfsng - cgroups/cgfsng.c:cg_legacy_filter_and_set_cpus:427 - No isolated cpus detected
lxc-start test 20211028182552.674 DEBUG cgfsng - cgroups/cgfsng.c:cg_legacy_handle_cpuset_hierarchy:613 - “cgroup.clone_children” was already set to “1”
lxc-start test 20211028182552.675 TRACE start - start.c:lxc_spawn:1653 - Cloned child process 9633
lxc-start test 20211028182552.675 INFO start - start.c:lxc_spawn:1657 - Cloned CLONE_NEWUSER
lxc-start test 20211028182552.675 INFO start - start.c:lxc_spawn:1657 - Cloned CLONE_NEWNS
lxc-start test 20211028182552.675 INFO start - start.c:lxc_spawn:1657 - Cloned CLONE_NEWPID
lxc-start test 20211028182552.675 INFO start - start.c:lxc_spawn:1657 - Cloned CLONE_NEWUTS
lxc-start test 20211028182552.675 INFO start - start.c:lxc_spawn:1657 - Cloned CLONE_NEWIPC
lxc-start test 20211028182552.675 DEBUG start - start.c:lxc_try_preserve_namespaces:205 - Preserved user namespace via fd 12
lxc-start test 20211028182552.675 DEBUG start - start.c:lxc_try_preserve_namespaces:205 - Preserved mnt namespace via fd 13
lxc-start test 20211028182552.675 DEBUG start - start.c:lxc_try_preserve_namespaces:205 - Preserved pid namespace via fd 14
lxc-start test 20211028182552.675 DEBUG start - start.c:lxc_try_preserve_namespaces:205 - Preserved uts namespace via fd 15
lxc-start test 20211028182552.675 DEBUG start - start.c:lxc_try_preserve_namespaces:205 - Preserved ipc namespace via fd 16
lxc-start test 20211028182552.675 DEBUG conf - conf.c:idmaptool_on_path_and_privileged:2836 - The binary “/usr/bin/newuidmap” does have the setuid bit set
lxc-start test 20211028182552.675 DEBUG conf - conf.c:idmaptool_on_path_and_privileged:2836 - The binary “/usr/bin/newgidmap” does have the setuid bit set
lxc-start test 20211028182552.675 DEBUG conf - conf.c:lxc_map_ids:2928 - Functional newuidmap and newgidmap binary found
lxc-start test 20211028182552.677 TRACE conf - conf.c:lxc_map_ids:3002 - newuidmap wrote mapping “newuidmap 9633 0 231072 10 1002 1002 1”
lxc-start test 20211028182552.679 TRACE conf - conf.c:lxc_map_ids:3002 - newgidmap wrote mapping “newgidmap 9633 0 231072 10 1003 1003 1”
lxc-start test 20211028182552.679 INFO start - start.c:do_start:1105 - Unshared CLONE_NEWNET
lxc-start test 20211028182552.679 TRACE conf - conf.c:get_minimal_idmap:4271 - Allocated minimal idmapping
lxc-start test 20211028182552.680 TRACE conf - conf.c:userns_exec_1:4351 - Establishing uid mapping for “9638” in new user namespace: nsuid 0 - hostid 231072 - range 10
lxc-start test 20211028182552.680 TRACE conf - conf.c:userns_exec_1:4351 - Establishing uid mapping for “9638” in new user namespace: nsuid 1002 - hostid 1002 - range 1
lxc-start test 20211028182552.680 TRACE conf - conf.c:userns_exec_1:4351 - Establishing gid mapping for “9638” in new user namespace: nsuid 0 - hostid 231072 - range 10
lxc-start test 20211028182552.680 TRACE conf - conf.c:userns_exec_1:4351 - Establishing gid mapping for “9638” in new user namespace: nsuid 1003 - hostid 1003 - range 1
lxc-start test 20211028182552.680 DEBUG conf - conf.c:idmaptool_on_path_and_privileged:2836 - The binary “/usr/bin/newuidmap” does have the setuid bit set
lxc-start test 20211028182552.680 DEBUG conf - conf.c:idmaptool_on_path_and_privileged:2836 - The binary “/usr/bin/newgidmap” does have the setuid bit set
lxc-start test 20211028182552.680 DEBUG conf - conf.c:lxc_map_ids:2928 - Functional newuidmap and newgidmap binary found
lxc-start test 20211028182552.681 TRACE conf - conf.c:lxc_map_ids:3002 - newuidmap wrote mapping “newuidmap 9638 0 231072 10 1002 1002 1”
lxc-start test 20211028182552.683 TRACE conf - conf.c:lxc_map_ids:3002 - newgidmap wrote mapping “newgidmap 9638 0 231072 10 1003 1003 1”
lxc-start test 20211028182552.683 TRACE conf - conf.c:run_userns_fn:4097 - Calling function “chown_cgroup_wrapper”
lxc-start test 20211028182552.683 DEBUG start - start.c:lxc_spawn:1711 - Preserved net namespace via fd 8
lxc-start test 20211028182552.684 ERROR start - start.c:lxc_spawn:1716 - Operation not permitted - Failed to allocate new network namespace id
lxc-start test 20211028182552.684 NOTICE utils - utils.c:lxc_switch_uid_gid:2183 - Switched to gid 0.
lxc-start test 20211028182552.684 NOTICE utils - utils.c:lxc_switch_uid_gid:2189 - Switched to uid 0.
lxc-start test 20211028182552.684 NOTICE utils - utils.c:lxc_setgroups:2201 - Dropped additional groups.
lxc-start test 20211028182552.684 INFO start - start.c:do_start:1213 - Unshared CLONE_NEWCGROUP
lxc-start test 20211028182552.684 TRACE conf - conf.c:remount_all_slave:3350 - Remounted all mount table entries as MS_SLAVE
lxc-start test 20211028182552.684 DEBUG storage - storage/storage.c:get_storage_by_name:229 - Detected rootfs type “dir”
lxc-start test 20211028182552.684 TRACE dir - storage/dir.c:dir_mount:200 - Mounted “/var/lib/lxc/test/rootfs” on “/usr/local/lib/lxc/rootfs”
lxc-start test 20211028182552.684 DEBUG conf - conf.c:lxc_mount_rootfs:1343 - Mounted rootfs “/var/lib/lxc/test/rootfs” onto “/usr/local/lib/lxc/rootfs” with options “(null)”
lxc-start test 20211028182552.684 INFO conf - conf.c:setup_utsname:802 - Set hostname to “test”
lxc-start test 20211028182552.684 INFO conf - conf.c:mount_autodev:1129 - Preparing “/dev”
lxc-start test 20211028182552.684 TRACE conf - conf.c:mount_autodev:1153 - Mounted tmpfs on “/usr/local/lib/lxc/rootfs/dev”
lxc-start test 20211028182552.684 INFO conf - conf.c:mount_autodev:1176 - Prepared “/dev”
lxc-start test 20211028182552.684 INFO conf - conf.c:lxc_mount_auto_mounts:732 - Mount source or target for “sysfs” on “/usr/local/lib/lxc/rootfs/sys” does not exist. Skipping
lxc-start test 20211028182552.684 INFO conf - conf.c:lxc_mount_auto_mounts:732 - Mount source or target for “/usr/local/lib/lxc/rootfs/sys” on “/usr/local/lib/lxc/rootfs/sys” does not exist. Skipping
lxc-start test 20211028182552.684 INFO conf - conf.c:lxc_mount_auto_mounts:732 - Mount source or target for “(null)” on “/usr/local/lib/lxc/rootfs/sys” does not exist. Skipping
lxc-start test 20211028182552.684 INFO conf - conf.c:lxc_mount_auto_mounts:732 - Mount source or target for “sysfs” on “/usr/local/lib/lxc/rootfs/sys/devices/virtual/net” does not exist. Skipping
lxc-start test 20211028182552.684 INFO conf - conf.c:lxc_mount_auto_mounts:732 - Mount source or target for “/usr/local/lib/lxc/rootfs/sys/devices/virtual/net/devices/virtual/net” on “/usr/local/lib/lxc/rootfs/sys/devices/virtual/net” does not exist. Skipping
lxc-start test 20211028182552.684 INFO conf - conf.c:lxc_mount_auto_mounts:732 - Mount source or target for “(null)” on “/usr/local/lib/lxc/rootfs/sys/devices/virtual/net” does not exist. Skipping
lxc-start test 20211028182552.684 ERROR conf - conf.c:lxc_mount_auto_mounts:781 - No such file or directory - Failed to mount “/sys/fs/cgroup”
lxc-start test 20211028182552.684 ERROR conf - conf.c:lxc_setup:3595 - Failed to setup remaining automatic mounts
lxc-start test 20211028182552.684 ERROR start - start.c:do_start:1234 - Failed to setup container “test”
lxc-start test 20211028182552.685 ERROR sync - sync.c:__sync_wait:59 - An error occurred in another process (expected sequence number 5)
lxc-start test 20211028182552.685 DEBUG network - network.c:lxc_delete_network:3164 - Deleted network devices
lxc-start test 20211028182552.685 TRACE start - start.c:lxc_serve_state_socket_pair:508 - Sent container state “ABORTING” to 5
lxc-start test 20211028182552.685 TRACE start - start.c:lxc_serve_state_clients:431 - Set container state to ABORTING
lxc-start test 20211028182552.685 TRACE start - start.c:lxc_serve_state_clients:434 - No state clients registered
lxc-start test 20211028182552.685 INFO utils - utils.c:get_rundir:273 - XDG_RUNTIME_DIR isn’t set in the environment.
lxc-start test 20211028182552.685 DEBUG lxccontainer - lxccontainer.c:wait_on_daemonized_start:828 - First child 9631 exited
lxc-start test 20211028182552.685 ERROR lxccontainer - lxccontainer.c:wait_on_daemonized_start:840 - Received container state “ABORTING” instead of “RUNNING”
lxc-start test 20211028182552.685 ERROR lxc_start - tools/lxc_start.c:main:330 - The container failed to start
lxc-start test 20211028182552.685 ERROR lxc_start - tools/lxc_start.c:main:333 - To get more details, run the container in foreground mode
lxc-start test 20211028182552.685 ERROR start - start.c:__lxc_start:1910 - Failed to spawn container “test”
lxc-start test 20211028182552.685 ERROR lxc_start - tools/lxc_start.c:main:336 - Additional information can be obtained by setting the --logfile and --logpriority options
lxc-start test 20211028182552.685 TRACE start - start.c:lxc_serve_state_clients:431 - Set container state to STOPPING
lxc-start test 20211028182552.685 TRACE start - start.c:lxc_serve_state_clients:434 - No state clients registered
lxc-start test 20211028182552.685 INFO utils - utils.c:get_rundir:273 - XDG_RUNTIME_DIR isn’t set in the environment.
lxc-start test 20211028182552.685 TRACE conf - conf.c:get_minimal_idmap:4271 - Allocated minimal idmapping
lxc-start test 20211028182552.685 TRACE conf - conf.c:userns_exec_1:4351 - Establishing uid mapping for “9647” in new user namespace: nsuid 0 - hostid 231072 - range 10
lxc-start test 20211028182552.685 TRACE conf - conf.c:userns_exec_1:4351 - Establishing uid mapping for “9647” in new user namespace: nsuid 1002 - hostid 1002 - range 1
lxc-start test 20211028182552.685 TRACE conf - conf.c:userns_exec_1:4351 - Establishing gid mapping for “9647” in new user namespace: nsuid 0 - hostid 231072 - range 10
lxc-start test 20211028182552.685 TRACE conf - conf.c:userns_exec_1:4351 - Establishing gid mapping for “9647” in new user namespace: nsuid 1003 - hostid 1003 - range 1
lxc-start test 20211028182552.685 DEBUG conf - conf.c:idmaptool_on_path_and_privileged:2836 - The binary “/usr/bin/newuidmap” does have the setuid bit set
lxc-start test 20211028182552.685 DEBUG conf - conf.c:idmaptool_on_path_and_privileged:2836 - The binary “/usr/bin/newgidmap” does have the setuid bit set
lxc-start test 20211028182552.685 DEBUG conf - conf.c:lxc_map_ids:2928 - Functional newuidmap and newgidmap binary found
lxc-start test 20211028182552.688 TRACE conf - conf.c:lxc_map_ids:3002 - newuidmap wrote mapping “newuidmap 9647 0 231072 10 1002 1002 1”
lxc-start test 20211028182552.691 TRACE conf - conf.c:lxc_map_ids:3002 - newgidmap wrote mapping “newgidmap 9647 0 231072 10 1003 1003 1”
lxc-start test 20211028182552.691 TRACE conf - conf.c:run_userns_fn:4097 - Calling function “cgroup_rmdir_wrapper”
lxc-start test 20211028182552.692 TRACE start - start.c:lxc_fini:971 - Closed command socket
lxc-start test 20211028182552.692 INFO utils - utils.c:get_rundir:273 - XDG_RUNTIME_DIR isn’t set in the environment.
lxc-start test 20211028182552.692 TRACE start - start.c:lxc_fini:982 - Set container state to “STOPPED”

Steps followed:

  1. Created /var/lib/lxc/test/rootfs folder
  2. Created all the mounting points inside rootfs folder
  3. created container using “lxc-create -f config -n test -P /var/lib/lxc -t none”
    Container was successfully created with no error messages
  4. Tried to start the container using lxc-start and got the error

this is seen only when i introduce the line lxc.rootfs.path = dir:/var/lib/lxc/test/rootfs in config file. Without this everything works fine.

cat /proc/self/cgroup
12:hugetlb:/
11:memory:/user/appfw/0
10:rdma:/
9:devices:/user/appfw/0
8:net_cls,net_prio:/
7:pids:/user.slice/user-1001.slice/session-2.scope
6:freezer:/user/appfw/0
5:cpuset:/user/appfw/0
4:perf_event:/
3:cpu,cpuacct:/user/appfw/0
2:blkio:/user.slice
1:name=systemd:/user/appfw/0
0::/user.slice/user-1001.slice/session-2.scope

lxc version 3.0.2 manually built and installed from sources