Quantcast
Channel: Ubuntu Forums - Virtualisation
Viewing all articles
Browse latest Browse all 4211

lxc unprivileged container and usb device

$
0
0
Hello,

I am using lxc unprivileged containers launched by root.

I want to pass to the container this usb device :
crw-rw---- 1 root dialout 188, 0 Aug 16 17:07 /dev/ttyUSB0

Once the container started, I run :
lxc-device -n c1 add /dev/ttyUSB0
(same if I just do a touch on /var/lib/lxc/c1/rootfs/dev/ttyUSB0)
And it appears this way inside the container :
crw-r----- 1 nobody nogroup 188, 0 Aug 16 15:17 /dev/ttyUSB0

I need the device to be writable at least by root inside the container. But if I try to run anyone of those commands :
chmod 777 /dev/ttyUSB0
or chown root /dev/ttyUSBO
I get this error :
chmod: changing permissions of '/dev/ttyUSB0': Operation not permitted

My container config file includes :
lxc.id_map = u 0 100000 65536
lxc.id_map = g 0 100000 65536
lxc.cgroup.devices.allow = c 188:* rwm
lxc.mount.entry = /dev/ttyUSB0 dev/ttyUSB0 none bind,optional


host+container OS : ubuntu 14.04
lxc : 1.0.7

Thanks for any help to better understand how it should be configured.

JP

Viewing all articles
Browse latest Browse all 4211

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>