How To Install lxcfs on CentOS 8

lxcfs is FUSE based filesystem for LXC

Introduction

In this tutorial we learn how to install lxcfs on CentOS 8.

What is lxcfs

LXCFS is a simple userspace filesystem designed to work around some current limitations of the Linux kernel. Specifically, it’s providing two main things - A set of files which can be bind-mounted over their /proc originals to provide CGroup-aware values. - A cgroupfs-like tree which is container aware. The code is pretty simple, written in C using libfuse. The main driver for this work was the need to run systemd based containers as a regular unprivileged user while still allowing systemd inside the container to interact with cgroups. Now with the introduction of the cgroup namespace in the Linux kernel, that part is no longer necessary on recent kernels and focus is now on making containers feel more like a real independent system through the proc masking feature.

We can use yum or dnf to install lxcfs on CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install lxcfs.

Install lxcfs on CentOS 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install lxcfs using dnf by running the following command:

sudo dnf -y install lxcfs

Install lxcfs on CentOS 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install lxcfs using yum by running the following command:

sudo yum -y install lxcfs

How To Uninstall lxcfs on CentOS 8

To uninstall only the lxcfs package we can use the following command:

sudo dnf remove lxcfs

lxcfs Package Contents on CentOS 8

/usr/bin/lxcfs
/usr/lib/.build-id
/usr/lib/.build-id/46
/usr/lib/.build-id/46/fce5491cd6e8678ce6dcf46f68678213c04a55
/usr/lib/.build-id/cc
/usr/lib/.build-id/cc/3a86a8000acce947a84e049673da1ecece4173
/usr/lib/systemd/system/lxcfs.service
/usr/lib64/lxcfs
/usr/lib64/lxcfs/liblxcfs.so
/usr/share/doc/lxcfs
/usr/share/doc/lxcfs/AUTHORS
/usr/share/licenses/lxcfs
/usr/share/licenses/lxcfs/COPYING
/usr/share/lxc/config/common.conf.d/00-lxcfs.conf
/usr/share/lxcfs
/usr/share/lxcfs/lxc.mount.hook
/usr/share/lxcfs/lxc.reboot.hook
/usr/share/man/man1/lxcfs.1.gz
/var/lib/lxcfs

References

Summary

In this tutorial we learn how to install lxcfs on CentOS 8 using yum and dnf.