About lxc/lxcfs
LXCFS is a small FUSE filesystem designed to make Linux containers feel more like virtual machines. It ensures that critical files in procfs (such as /proc/cpuinfo, /proc/meminfo, /proc/uptime, /proc/stat, /proc/diskstats, /proc/swaps, /proc/slabinfo, and /proc/pressure/*) and /sys/devices/system/cpu/online display container-aware values — reflecting the container’s own uptime and resource view rather than the host’s. Originally created as a side project of LXC, it is usable by any container runtime. LXCFS is split into a shared library (liblxcfs) and a binary, allowing in-place upgrades without restarting containers by sending SIGUSR1 to reload the library (glibc only; musl requires a full restart). Building requires fuse3 and uses the meson build system.
Key Features
Pros & Cons
- Containers report their own resource stats, improving VM-like behavior
- No container restart needed for LXCFS upgrades (on glibc)
- Small, focused FUSE filesystem with minimal overhead
- Works with any container runtime, not just LXC
- Container-aware cgroupfs feature is deprecated and relies on kernel cgroup namespaces for best security
- On musl-based systems (e.g., Alpine), LXCFS upgrades require a full restart of all containers using it
- Requires FUSE3, which may not be available on older distributions
- Only addresses procfs/sysfs files; does not virtualize other filesystem views