Skip to content

Instantly share code, notes, and snippets.

@woodrow-shen
Last active June 30, 2016 10:43
Show Gist options
  • Save woodrow-shen/48643109fccaa1ab4e81 to your computer and use it in GitHub Desktop.
Save woodrow-shen/48643109fccaa1ab4e81 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