Today I installed LXD on my Lenovo ThinkPad T530 running Voidlinux. However, trying to start containers fails:
> lxc launch images:voidlinux test
Error: Failed to run: /usr/bin/lxd forkstart test /var/lib/lxd/containers /var/log/lxd/test/lxc.conf:
Try lxc info --show-log local:test for more info
> lxc info --show-log local:test
Name: test
Location: none
Remote: unix://
Architecture: x86_64
Created: 2021/06/28 12:53 UTC
Status: Stopped
Type: container
Profiles: default
Log:
lxc test 20210628125337.487 INFO lxccontainer - lxccontainer.c:do_lxcapi_start:979 - Set process title to [lxc monitor] /var/lib/lxd/containers test
lxc test 20210628125337.488 INFO start - start.c:lxc_check_inherited:286 - Closed inherited fd 4
lxc test 20210628125337.488 INFO start - start.c:lxc_check_inherited:286 - Closed inherited fd 5
lxc test 20210628125337.488 INFO start - start.c:lxc_check_inherited:286 - Closed inherited fd 6
lxc test 20210628125337.488 INFO lsm - lsm/lsm.c:lsm_init:40 - Initialized LSM security driver nop
lxc test 20210628125337.488 INFO conf - conf.c:run_script_argv:333 - Executing script “/proc/762/exe callhook /var/lib/lxd “default” “test” start” for container “test”
lxc test 20210628125337.679 INFO seccomp - seccomp.c:parse_config_v2:807 - Processing “[all]”
lxc test 20210628125337.679 INFO seccomp - seccomp.c:parse_config_v2:807 - Processing “reject_force_umount # comment this to allow umount -f; not recommended”
lxc test 20210628125337.679 INFO seccomp - seccomp.c:do_resolve_add_rule:524 - Set seccomp rule to reject force umounts
lxc test 20210628125337.679 INFO seccomp - seccomp.c:do_resolve_add_rule:524 - Set seccomp rule to reject force umounts
lxc test 20210628125337.679 INFO seccomp - seccomp.c:do_resolve_add_rule:524 - Set seccomp rule to reject force umounts
lxc test 20210628125337.679 INFO seccomp - seccomp.c:parse_config_v2:807 - Processing “[all]”
lxc test 20210628125337.679 INFO seccomp - seccomp.c:parse_config_v2:807 - Processing “kexec_load errno 38”
lxc test 20210628125337.679 INFO seccomp - seccomp.c:do_resolve_add_rule:564 - Adding native rule for syscall[246:kexec_load] action[327718:errno] arch[0]
lxc test 20210628125337.679 INFO seccomp - seccomp.c:do_resolve_add_rule:564 - Adding compat rule for syscall[246:kexec_load] action[327718:errno] arch[1073741827]
lxc test 20210628125337.679 INFO seccomp - seccomp.c:do_resolve_add_rule:564 - Adding compat rule for syscall[246:kexec_load] action[327718:errno] arch[1073741886]
lxc test 20210628125337.679 INFO seccomp - seccomp.c:parse_config_v2:807 - Processing “open_by_handle_at errno 38”
lxc test 20210628125337.679 INFO seccomp - seccomp.c:do_resolve_add_rule:564 - Adding native rule for syscall[304:open_by_handle_at] action[327718:errno] arch[0]
lxc test 20210628125337.679 INFO seccomp - seccomp.c:do_resolve_add_rule:564 - Adding compat rule for syscall[304:open_by_handle_at] action[327718:errno] arch[1073741827]
lxc test 20210628125337.679 INFO seccomp - seccomp.c:do_resolve_add_rule:564 - Adding compat rule for syscall[304:open_by_handle_at] action[327718:errno] arch[1073741886]
lxc test 20210628125337.679 INFO seccomp - seccomp.c:parse_config_v2:807 - Processing “init_module errno 38”
lxc test 20210628125337.679 INFO seccomp - seccomp.c:do_resolve_add_rule:564 - Adding native rule for syscall[175:init_module] action[327718:errno] arch[0]
lxc test 20210628125337.679 INFO seccomp - seccomp.c:do_resolve_add_rule:564 - Adding compat rule for syscall[175:init_module] action[327718:errno] arch[1073741827]
lxc test 20210628125337.679 INFO seccomp - seccomp.c:do_resolve_add_rule:564 - Adding compat rule for syscall[175:init_module] action[327718:errno] arch[1073741886]
lxc test 20210628125337.679 INFO seccomp - seccomp.c:parse_config_v2:807 - Processing “finit_module errno 38”
lxc test 20210628125337.679 INFO seccomp - seccomp.c:do_resolve_add_rule:564 - Adding native rule for syscall[313:finit_module] action[327718:errno] arch[0]
lxc test 20210628125337.679 INFO seccomp - seccomp.c:do_resolve_add_rule:564 - Adding compat rule for syscall[313:finit_module] action[327718:errno] arch[1073741827]
lxc test 20210628125337.679 INFO seccomp - seccomp.c:do_resolve_add_rule:564 - Adding compat rule for syscall[313:finit_module] action[327718:errno] arch[1073741886]
lxc test 20210628125337.679 INFO seccomp - seccomp.c:parse_config_v2:807 - Processing “delete_module errno 38”
lxc test 20210628125337.679 INFO seccomp - seccomp.c:do_resolve_add_rule:564 - Adding native rule for syscall[176:delete_module] action[327718:errno] arch[0]
lxc test 20210628125337.679 INFO seccomp - seccomp.c:do_resolve_add_rule:564 - Adding compat rule for syscall[176:delete_module] action[327718:errno] arch[1073741827]
lxc test 20210628125337.679 INFO seccomp - seccomp.c:do_resolve_add_rule:564 - Adding compat rule for syscall[176:delete_module] action[327718:errno] arch[1073741886]
lxc test 20210628125337.679 INFO seccomp - seccomp.c:parse_config_v2:1017 - Merging compat seccomp contexts into main context
lxc test 20210628125337.679 INFO start - start.c:lxc_init:837 - Container “test” is initialized
lxc test 20210628125337.685 WARN cgfsng - cgroups/cgfsng.c:mkdir_eexist_on_last:1152 - File exists - Failed to create directory “/sys/fs/cgroup/cpuset//lxc.monitor.test”
lxc test 20210628125337.686 INFO cgfsng - cgroups/cgfsng.c:cgfsng_monitor_create:1368 - The monitor process uses “lxc.monitor.test” as cgroup
lxc test 20210628125337.687 WARN cgfsng - cgroups/cgfsng.c:mkdir_eexist_on_last:1152 - File exists - Failed to create directory “/sys/fs/cgroup/cpuset//lxc.payload.test”
lxc test 20210628125337.688 INFO cgfsng - cgroups/cgfsng.c:cgfsng_payload_create:1471 - The container process uses “lxc.payload.test” as cgroup
lxc test 20210628125337.689 INFO start - start.c:lxc_spawn:1700 - Cloned CLONE_NEWUSER
lxc test 20210628125337.689 INFO start - start.c:lxc_spawn:1700 - Cloned CLONE_NEWNS
lxc test 20210628125337.689 INFO start - start.c:lxc_spawn:1700 - Cloned CLONE_NEWPID
lxc test 20210628125337.689 INFO start - start.c:lxc_spawn:1700 - Cloned CLONE_NEWUTS
lxc test 20210628125337.689 INFO start - start.c:lxc_spawn:1700 - Cloned CLONE_NEWIPC
lxc test 20210628125337.697 INFO start - start.c:do_start:1085 - Unshared CLONE_NEWNET
lxc test 20210628125337.713 NOTICE utils - utils.c:lxc_setgroups:1420 - Dropped additional groups
lxc test 20210628125337.713 WARN cgfsng - cgroups/cgfsng.c:fchowmodat:1570 - No such file or directory - Failed to fchownat(29, memory.oom.group, 65536, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc test 20210628125337.726 NOTICE utils - utils.c:lxc_setgroups:1420 - Dropped additional groups
lxc test 20210628125337.726 NOTICE utils - utils.c:lxc_switch_uid_gid:1398 - Switched to gid 0
lxc test 20210628125337.726 NOTICE utils - utils.c:lxc_switch_uid_gid:1407 - Switched to uid 0
lxc test 20210628125337.726 INFO start - start.c:do_start:1198 - Unshared CLONE_NEWCGROUP
lxc test 20210628125337.727 ERROR conf - conf.c:lxc_mount_rootfs:1245 - No such file or directory - Failed to access to “/var/lxc/containers”. Check it is present
lxc test 20210628125337.727 ERROR conf - conf.c:lxc_setup_rootfs_prepare_root:3142 - Failed to setup rootfs for
lxc test 20210628125337.727 ERROR conf - conf.c:lxc_setup:3278 - Failed to setup rootfs
lxc test 20210628125337.727 ERROR start - start.c:do_start:1218 - Failed to setup container “test”
lxc test 20210628125337.728 ERROR sync - sync.c:__sync_wait:36 - An error occurred in another process (expected sequence number 5)
lxc test 20210628125337.731 WARN network - network.c:lxc_delete_network_priv:3183 - Failed to rename interface with index 0 from “eth0” to its initial name “veth0ffdf889”
lxc test 20210628125337.731 ERROR start - start.c:__lxc_start:1999 - Failed to spawn container “test”
lxc test 20210628125337.731 WARN start - start.c:lxc_abort:1012 - No such process - Failed to send SIGKILL via pidfd 31 for process 6090
lxc test 20210628125337.731 INFO conf - conf.c:run_script_argv:333 - Executing script “/usr/bin/lxd callhook /var/lib/lxd “default” “test” stopns” for container “test”
lxc test 20210628125337.732 ERROR lxccontainer - lxccontainer.c:wait_on_daemonized_start:859 - Received container state “ABORTING” instead of “RUNNING”
lxc test 20210628125337.894 NOTICE utils - utils.c:lxc_setgroups:1420 - Dropped additional groups
lxc 20210628125337.903 WARN commands - commands.c:lxc_cmd_rsp_recv:124 - Connection reset by peer - Failed to receive response for command “get_state”
lxc test 20210628125337.903 INFO conf - conf.c:run_script_argv:333 - Executing script “/usr/bin/lxd callhook /var/lib/lxd “default” “test” stop” for container “test”
Same thing when trying to start an Ubuntu container. Please let me know, if you need any further information.
lxc test 20210628125337.727 ERROR conf - conf.c:lxc_mount_rootfs:1245 - No such file or directory - Failed to access to “/var/lxc/containers”. Check it is present
/usr/share/lxc/config/common.conf.d/ just contains a README file.
/etc/lxc does not exist
Maybe I messed something up when I had legacy LXC installed a few years ago. But the package is long gone from my system already. Other than that there is only docker running for testing my builds.
This isn’t the actual rootfs path but rather where the rootfs will be mounted to and where we pivot_root() into. So LXC seems to think that /var/lxc/containers is where to mount the rootfs to whereas on Ubuntu this would be /usr/lib/x86_64-linux-gnu/lxc . So this might just be Voidlinux specific? In this case just a mkdir /var/lxc/containers might be enough to fix this.
Indeed I manually created that directory yesterday and everything seems to work now. Weirdly enough my other Void system does not show that behavior so maybe it was just specific to this machine.