My lxc.conf looks like this,
# tail -1 /var/snap/lxd/common/lxd/logs/zmvm/lxc.conf
lxc.mount.entry = /var/snap/lxd/common/lxd/devices/zmvm/unix.webcam0.dev-bus-usb-004-002 dev/bus/usb/004/002 none bind,create=file
lsusb on the host shows the same device id’s,
Bus 004 Device 002: ID 045e:076d Microsoft Corp. LifeCam HD-5000
so the device definition is correct.
Finally the log file shows,
# grep -E 'webcam|usb' /var/snap/lxd/common/lxd/logs/zmvm/lxc.log
lxc zmvm 20180705222140.948 DEBUG lxc_conf - conf.c:mount_entry:1965 - Remounting "/var/snap/lxd/common/lxd/devices/zmvm/unix.webcam0.dev-bus-usb-004-002" on "/var/lib/lxc/rootfs/dev/bus/usb/004/002" to respect bind or remount options
lxc zmvm 20180705222140.948 DEBUG lxc_conf - conf.c:mount_entry:1986 - Flags for "/var/snap/lxd/common/lxd/devices/zmvm/unix.webcam0.dev-bus-usb-004-002" were 0, required extra flags are 0
lxc zmvm 20180705222140.948 DEBUG lxc_conf - conf.c:mount_entry:2042 - Mounted "/var/snap/lxd/common/lxd/devices/zmvm/unix.webcam0.dev-bus-usb-004-002" on "/var/lib/lxc/rootfs/dev/bus/usb/004/002" with filesystem type "none"
The log seems to indicate the device is mounted correctly. In the container i see,
# ls -la /dev/bus/usb/004/002
crw-rw-r-- 1 root root 189, 385 Jul 6 03:51 /dev/bus/usb/004/002
# v4l2-ctl --list-devices -d /dev/bus/usb/004/002
VIDIOC_QUERYCAP: failed: Inappropriate ioctl for device
/dev/bus/usb/004/002: not a v4l2 node
Why dont i get a /dev/video0 though?
The container is running Ubuntu 16.04.4 LTS.