Introduction

A lot of people have been asking us how to run LXD on Centos/RHEL 7 in the past.

Up until now, our answer has usually been to use some of the Fedora packages for liblxc, combined with a hand built version of LXD that you then have to manually integrate with your system. So certainly doable but not exactly clean or easy.

But now there is finally a cleaner, much more supportable way for you to get LXD on those systems as there is now a build of snapd that works with Centos/RHEL, letting you use the official LXD snap on those systems.

Note that the state of snapd on Centos/RHEL is still considered early days, so some features may be missing or broken. We did add automatic testing on our side as we do for all the other distributions and so far everything looks good.

Setting things up

The instructions below are based on a clean Centos 7.4 installation.

# Install snapd yum install yum-plugin-copr epel-release yum copr enable ngompa/snapcore-el7 yum install snapd systemctl enable --now snapd.socket # Install ZFS (skip if you don't want it) yum install http://download.zfsonlinux.org/epel/zfs-release.el7_4.noarch.rpm yum-config-manager --disable zfs yum-config-manager --enable zfs-kmod yum install zfs # Configure the kernel grubby --args="user_namespace.enable=1" --update-kernel="$(grubby --default-kernel)" grubby --args="namespace.unpriv_enable=1" --update-kernel="$(grubby --default-kernel)" echo "user.max_user_namespaces=3883" > /etc/sysctl.d/99-userns.conf reboot # Install the LXD snap snap install lxd # Configure LXD lxd init # Launch containers lxc launch ubuntu:16.04 c1

Let us know if you notice anything missing/broken!