LXC 3.0 and Slackware
I saw "new" release of LXC https://discuss.linuxcontainers.org/...-released/1449
Is it possible to upgrade LXC from LTS branch to version 3 on Slackware current? The cgmanager is removed and I don't know if it is possible to use containers without systemd or cgmanager. |
I've created unprivileged Ubuntu containers, with networking, with LXC 3 on -current. There's some system configuration necessary to make it work, though. I don't think LXC needs cgmanager. Strange thing: removing cgmanager breaks the power manager applet in XFCE.
|
Great! I will try LXC 3 ASAP.
If you can, write up what changes have you made in ored to make it work. |
Setting up LXC 3.x to run unprivileged containers.
As you: 1) Download the source for lxc-3.0.3.tar.gz and lxcfs-3.0.3.tar.gz. 2) Untar lxc-3.0.3 and lxcfs-3.0.3 3) cd lxc-3.0.3 4) ./configure --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib64 --localstatedir=/var --mandir=/usr/man --docdir=/usr/doc/lxc-3.0.3 --infodir=/usr/info --infodir=/usr/info --with-global-conf=/etc/lxc/lxc.conf --with-rootfs-path=/var/lib/rootfs-lxc 5) make -j8 6) cd ../lxcfs-3.0.3 7) ./configure --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib64 --localstatedir=/var --mandir=/usr/man --docdir=/usr/doc/lxcfs-3.0.3 --infodir=/usr/info --with-rootfs-path=/var/lib/rootfs-lxc 8) make -j8 9) Create the file $HOME/.config/lxc/default.conf with the following contents: Code:
lxc.idmap = u 0 131072 65536 10) removepkg lxc-2.0.9 11) cd lxc-3.0.3 12) make install 13) cd ../lxcfs-3.0.3 14) make install 15) Create the file /etc/subuid with the following contents: Code:
root:65536:65536 16) Create the file /etc/subgid with the following contents: Code:
root:65536:65536 17) mount -t cgroup -o rw,noexec,nosuid,nodev,none,name=systemd systemd /sys/fs/cgroup/systemd 18) cgcreate -g name=systemd:lxc -g *:lxc -a <your uid>:<your gid> -t <your uid>:<your gid> Replace <your uid> and <your gid> with your user ID and your group ID, respectively. 19) /usr/libexec/lxc/lxc-net start 20) lxcfs -s -o allow_other /var/lib/lxcfs/ & 21) modprobe autofs4 As you: 22) cgexec -g *:lxc bash 23) Create a Debian container: lxc-create -t download -n debian -- -d debian -r stretch -a amd64 24) Start the container: lxc-start debian 25) Attach to the container: lxc-attach debian You should now be able to run 'apt install' to install packages. |
Thank you Alex!
I have fixed power manager applet in XFCE by recompiling ConsoleKit2 with Code:
--enable-cgroups=no \ |
Quote:
Quote:
|
Quote:
|
Quote:
|
Quote:
|
I made some changes to the instructions to allow automatically starting the network when starting the container.
There is a Slackware LXC template, but currently it can only be run as a privileged container. |
All times are GMT -5. The time now is 02:54 AM. |