Can't start LXC Containers

cursedstranger

New Member
Dec 30, 2023
3
1
3
I've just installed proxmox under WSL (latest version) and it all seems to be running fine, except for one rather critical component: I can't run LXC containers.

When I run a container I see:
run_buffer: 322 Script exited with status 1
lxc_setup: 4437 Failed to run mount hooks
do_start: 1272 Failed to setup container "100"
sync_wait: 34 An error occurred in another process (expected sequence number 4)
__lxc_start: 2107 Failed to spawn container "100"
TASK ERROR: startup for container '100' failed

Running lxc-start -n 100 -F -lDEBUG -o lxc-100.log gives (I've had to chop out some of the INFO messages to fit the forum limits):
...
lxc-start 100 20231230063402.336 INFO cgfsng - ../src/lxc/cgroups/cgfsng.c:cgfsng_setup_limits_legacy:3172 - Limits for the legacy cgroup hierarchies have been setup
lxc-start 100 20231230063402.336 WARN cgfsng - ../src/lxc/cgroups/cgfsng.c:cgfsng_setup_limits:3232 - Invalid argument - Ignoring cgroup2 limits on legacy cgroup system
lxc-start 100 20231230063402.337 DEBUG conf - ../src/lxc/conf.c:idmaptool_on_path_and_privileged:3549 - The binary "/usr/bin/newuidmap" does have the setuid bit set
lxc-start 100 20231230063402.337 DEBUG conf - ../src/lxc/conf.c:idmaptool_on_path_and_privileged:3549 - The binary "/usr/bin/newgidmap" does have the setuid bit set
lxc-start 100 20231230063402.337 INFO conf - ../src/lxc/conf.c:lxc_map_ids:3632 - Caller maps host root. Writing mapping directly
lxc-start 100 20231230063402.337 NOTICE utils - ../src/lxc/utils.c:lxc_drop_groups:1367 - Dropped supplimentary groups
lxc-start 100 20231230063402.337 WARN cgfsng - ../src/lxc/cgroups/cgfsng.c:fchowmodat:1619 - No such file or directory - Failed to fchownat(74, memory.oom.group, 65536, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc-start 100 20231230063402.337 WARN cgfsng - ../src/lxc/cgroups/cgfsng.c:fchowmodat:1619 - No such file or directory - Failed to fchownat(74, memory.reclaim, 65536, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc-start 100 20231230063402.338 INFO start - ../src/lxc/start.c:do_start:1104 - Unshared CLONE_NEWNET
lxc-start 100 20231230063402.338 NOTICE utils - ../src/lxc/utils.c:lxc_drop_groups:1367 - Dropped supplimentary groups
lxc-start 100 20231230063402.338 NOTICE utils - ../src/lxc/utils.c:lxc_switch_uid_gid:1343 - Switched to gid 0
lxc-start 100 20231230063402.338 NOTICE utils - ../src/lxc/utils.c:lxc_switch_uid_gid:1352 - Switched to uid 0
lxc-start 100 20231230063402.338 INFO start - ../src/lxc/start.c:do_start:1204 - Unshared CLONE_NEWCGROUP
lxc-start 100 20231230063402.338 DEBUG start - ../src/lxc/start.c:lxc_try_preserve_namespace:139 - Preserved net namespace via fd 5 and stashed path as net:/proc/4984/fd/5
lxc-start 100 20231230063402.340 INFO conf - ../src/lxc/conf.c:run_script_argv:338 - Executing script "/usr/share/lxc/lxcnetaddbr" for container "100", config section "net"
lxc-start 100 20231230063402.732 DEBUG network - ../src/lxc/network.c:netdev_configure_server_veth:852 - Instantiated veth tunnel "veth100i0 <--> veth3iP9HT"
lxc-start 100 20231230063402.733 DEBUG conf - ../src/lxc/conf.c:lxc_mount_rootfs:1437 - Mounted rootfs "/var/lib/lxc/100/rootfs" onto "/usr/lib/x86_64-linux-gnu/lxc/rootfs" with options "(null)"
lxc-start 100 20231230063402.733 INFO conf - ../src/lxc/conf.c:setup_utsname:876 - Set hostname to "CT100"
lxc-start 100 20231230063402.792 DEBUG network - ../src/lxc/network.c:setup_hw_addr:3821 - Mac address "BC:24:11:2B:F1:D6" on "eth0" has been setup
lxc-start 100 20231230063402.792 DEBUG network - ../src/lxc/network.c:lxc_network_setup_in_child_namespaces_common:3962 - Network device "eth0" has been setup
lxc-start 100 20231230063402.792 INFO network - ../src/lxc/network.c:lxc_setup_network_in_child_namespaces:4019 - Finished setting up network devices with caller assigned names
lxc-start 100 20231230063402.792 INFO conf - ../src/lxc/conf.c:mount_autodev:1220 - Preparing "/dev"
lxc-start 100 20231230063402.792 INFO conf - ../src/lxc/conf.c:mount_autodev:1281 - Prepared "/dev"
lxc-start 100 20231230063402.792 DEBUG conf - ../src/lxc/conf.c:lxc_mount_auto_mounts:736 - Invalid argument - Tried to ensure procfs is unmounted
lxc-start 100 20231230063402.793 DEBUG conf - ../src/lxc/conf.c:lxc_mount_auto_mounts:759 - Invalid argument - Tried to ensure sysfs is unmounted
lxc-start 100 20231230063402.793 INFO conf - ../src/lxc/conf.c:lxc_mount_auto_mounts:813 - Mount source or target for "/usr/lib/x86_64-linux-gnu/lxc/rootfs/proc/sysrq-trigger" on "/usr/lib/x86_64-linux-gnu/lxc/rootfs/proc/sysrq-trigger" does not exist. Skipping
lxc-start 100 20231230063402.793 INFO conf - ../src/lxc/conf.c:lxc_mount_auto_mounts:813 - Mount source or target for "(null)" on "/usr/lib/x86_64-linux-gnu/lxc/rootfs/proc/sysrq-trigger" does not exist. Skipping
lxc-start 100 20231230063402.793 DEBUG conf - ../src/lxc/conf.c:mount_entry:2445 - Remounting "/sys/fs/fuse/connections" on "/usr/lib/x86_64-linux-gnu/lxc/rootfs/sys/fs/fuse/connections" to respect bind or remount options
lxc-start 100 20231230063402.793 DEBUG conf - ../src/lxc/conf.c:mount_entry:2464 - Flags for "/sys/fs/fuse/connections" were 4110, required extra flags are 14
lxc-start 100 20231230063402.793 DEBUG conf - ../src/lxc/conf.c:mount_entry:2508 - Mounted "/sys/fs/fuse/connections" on "/usr/lib/x86_64-linux-gnu/lxc/rootfs/sys/fs/fuse/connections" with filesystem type "none"
lxc-start 100 20231230063402.793 DEBUG conf - ../src/lxc/conf.c:mount_entry:2508 - Mounted "proc" on "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/.lxc/proc" with filesystem type "proc"
lxc-start 100 20231230063402.794 DEBUG conf - ../src/lxc/conf.c:mount_entry:2508 - Mounted "sys" on "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/.lxc/sys" with filesystem type "sysfs"
lxc-start 100 20231230063402.794 INFO conf - ../src/lxc/conf.c:run_script_argv:338 - Executing script "/usr/share/lxcfs/lxc.mount.hook" for container "100", config section "lxc"
lxc-start 100 20231230063402.797 DEBUG conf - ../src/lxc/conf.c:run_buffer:311 - Script exec /usr/share/lxcfs/lxc.mount.hook 100 lxc mount produced output: missing /var/lib/lxcfs/proc/ - lxcfs not running?

lxc-start 100 20231230063402.797 ERROR conf - ../src/lxc/conf.c:run_buffer:322 - Script exited with status 1
lxc-start 100 20231230063402.797 ERROR conf - ../src/lxc/conf.c:lxc_setup:4437 - Failed to run mount hooks
lxc-start 100 20231230063402.797 ERROR start - ../src/lxc/start.c:do_start:1272 - Failed to setup container "100"
lxc-start 100 20231230063402.797 ERROR sync - ../src/lxc/sync.c:sync_wait:34 - An error occurred in another process (expected sequence number 4)
lxc-start 100 20231230063402.797 DEBUG network - ../src/lxc/network.c:lxc_delete_network:4173 - Deleted network devices
lxc-start 100 20231230063402.797 ERROR start - ../src/lxc/start.c:__lxc_start:2107 - Failed to spawn container "100"
lxc-start 100 20231230063402.797 WARN start - ../src/lxc/start.c:lxc_abort:1036 - No such process - Failed to send SIGKILL via pidfd 76 for process 4995
lxc-start 100 20231230063402.800 INFO conf - ../src/lxc/conf.c:run_script_argv:338 - Executing script "/usr/share/lxcfs/lxc.reboot.hook" for container "100", config section "lxc"
lxc-start 100 20231230063403.302 INFO conf - ../src/lxc/conf.c:run_script_argv:338 - Executing script "/usr/share/lxc/hooks/lxc-pve-poststop-hook" for container "100", config section "lxc"
lxc-start 100 20231230063404.408 ERROR lxc_start - ../src/lxc/tools/lxc_start.c:main:306 - The container failed to start
lxc-start 100 20231230063404.409 ERROR lxc_start - ../src/lxc/tools/lxc_start.c:main:311 - Additional information can be obtained by setting the --logfile and --logpriority options

Looking through those logs, I noticed:
lxc-start 100 20231230063402.797 DEBUG conf - ../src/lxc/conf.c:run_buffer:311 - Script exec /usr/share/lxcfs/lxc.mount.hook 100 lxc mount produced output: missing /var/lib/lxcfs/proc/ - lxcfs not running?

Looking at the referenced script, and then took a look at /var/lib/lxcfs/proc/
!#: ls -al /var/lib/lxcfs/
total 8
drwxr-xr-x 2 root root 4096 Dec 1 20:44 .
drwxr-xr-x 33 root root 4096 Dec 30 15:28 ..

The script aborts with the above error message since the proc doesn't exist.

I'm not sure where to go from here. I've searched for information, but I'm not familiar with lxcfs and my understanding is that proxmox uses its own flavor or lxc.
Any help is appreciated, I'd really like to get started with my home servering!
 
Turns out the lxcfs.service wasn't loading because it's configured to be disabled when containerised.
I commented out the following line and am now onto the next problem :-/

/lib/systemd/system/lxcfs.service
Code:
[Unit]
Description=FUSE filesystem for LXC
# ConditionVirtualization=!container
Before=lxc.service
Documentation=man:lxcfs(1)

Bash:
systemctl start lxcfs
systemctl status lxcfs
 
  • Like
Reactions: xavimaes

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!