[lxc-users] Running LXD on Jessie

Micky Del Favero micky at mesina.net
Mon Jun 22 12:49:44 UTC 2015


Hi everybody!

In the last few days I've managed to setup lxd on Devuan Jessie
(http://devuan.org/) but the same applied to Debian Jessie, I think it
may be helpful to other and so I'll explain what I've done.

First of all you need to compile the last version of lxc (1.1.2
https://linuxcontainers.org/downloads/lxc/lxc-1.1.2.tar.gz) and of lxd
(0.11 https://linuxcontainers.org/downloads/lxd/lxd-0.11.tar.gz), it's a
simple job so I won't explain it, and install them.

I've also prepare 3 packages: lxc_1.1.2-micky0_amd64.deb, built copying
debian script from debian packaged version 1.0.6 changing what have to
be changed, and lxd_0.11-micky0_amd64.deb
lxd-client_0.11-micky0_amd64.deb porting debian/* scripts from Ubuntu to
Jessie, you can simply do a make install if you don't need the packages.

Once you've installed lxc and lxd you need some packages:

# apt-get install apparmor bridge-utils cgmanager cgroupfs-mount dnsmasq

configure /etc/lxc/default.conf and /etc/default/lxc-net as you
prefer, mine are:

root at nabla:~# cat /etc/lxc/default.conf
lxc.network.type = empty
root at nabla:~#

root at nabla:~# cat /etc/default/lxc-net
USE_LXC_BRIDGE="true"
root at nabla:~# 

To runnign lxd you'll also need a kernel with the following options
enabled:

  CONFIG_SECURITY_APPARMOR=y
  CONFIG_SECURITY_APPARMOR_BOOTPARAM_VALUE=1
  CONFIG_SECURITY_APPARMOR_UNCONFINED_INIT=y
  CONFIG_SECURITY_APPARMOR_HASH=y
  CONFIG_DEFAULT_SECURITY_APPARMOR=y

Jessie's kernel has only:

  CONFIG_SECURITY_APPARMOR=y
  CONFIG_SECURITY_APPARMOR_BOOTPARAM_VALUE=1
  CONFIG_SECURITY_APPARMOR_HASH=y

enabled, so I've try to compile my own kernel starting from Debian ones
(linux-source-3.16) but I wasn't able to find how to enable
CONFIG_SECURITY_APPARMOR_UNCONFINED_INIT, without it lxd doesn't work so
for the moment i've installed ubuntu's kernel:
linux-image-3.16.0-41-generic_3.16.0-41.55~14.04.1_amd64.deb
linux-image-extra-3.16.0-41-generic_3.16.0-41.55~14.04.1_amd64.deb and
the package that the last one required, booting using ubuntu's kernel
all work as expected:

micky at nabla:~$ lxd-images import lxc debian wheezy amd64 --alias debian --alias debian/wheezy --alias debian/wheezy/amd64
...
Setup alias: debian/wheezy/amd64
micky at nabla:~$ lxc launch debian debbie
Creating container...done
Starting container...done
micky at nabla:~$ lxd-images import lxc ubuntu trusty amd64 --alias ubuntu --alias ubuntu/trusty --alias ubuntu/trusty/amd64
...
Setup alias: ubuntu/trusty/amd64
micky at nabla:~$ lxc launch ubuntu utuba                                       
Creating container...done
Starting container...done
micky at nabla:~$  lxc list
+--------+---------+------------+------+-----------+-----------+
|  NAME  |  STATE  |    IPV4    | IPV6 | EPHEMERAL | SNAPSHOTS |
+--------+---------+------------+------+-----------+-----------+
| debbie | RUNNING | 10.0.3.115 |      | NO        | 0         |
| utuba  | RUNNING | 10.0.3.118 |      | NO        | 0         |
+--------+---------+------------+------+-----------+-----------+
micky at nabla:~$ lxc exec debbie bash
root at debbie:~# hostname
debbie
root at debbie:~# exit
exit
micky at nabla:~$

Ciao, Micky
-- 
The sysadmin has all the answers, expecially "No"


More information about the lxc-users mailing list