Skip to content

Instantly share code, notes, and snippets.

@chenhan1218
Forked from woodrow-shen/notes-lxd.md
Created June 30, 2016 10:43
Show Gist options
  • Save chenhan1218/6f4c3a4fe3488c9a6e35b63419eac3f2 to your computer and use it in GitHub Desktop.
Save chenhan1218/6f4c3a4fe3488c9a6e35b63419eac3f2 to your computer and use it in GitHub Desktop.

device-mapper on lxc/lxd

LXC control device mapper

lxc.cgroup.devices.allow = c 10:236 rwm
lxc.cgroup.devices.allow = b 252:* rwm

https://wiki.deimos.fr/LXC_:_Install_and_configure_the_Linux_Containers#LXC_control_device_mapper

LXC config on LXD

sudo lxc.config

lxc.cgroup.devices.allow = c 10:236 rwm
lxc.cgroup.devices.allow = b 252:* rwm
lxc.aa_profile = unconfined

cat lxc.config | lxc config set ubuntu-vivid raw.lxc -
lxc config show <container-name>

Add devices into container

lxc config device add <container> <device-tagname> <type> <key=value>
lxc config device add ubuntu-vivid loop-control unix-char path=/dev/loop-control
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment