[lxc-users] LXD Container - Unable To Use Connected Device

rob e redgerhoo at yahoo.com.au
Sat Jul 2 05:41:41 UTC 2016


hi,
I have created a new unprivileged LXD Xenial container on a new Ubuntu 
Xenial install (now 7 days old)
This is a stock standard build, no PPAs etc.

$ uname -a
Linux virt-host 4.4.0-28-generic #47-Ubuntu SMP Fri Jun 24 10:09:13 UTC 
2016 x86_64 x86_64 x86_64 GNU/Linux

I have allocated USB DVB tuners to this container and attempted to use 
them, without success. Unfortunately I have little or nothing in the way 
of error messages)

The container starts ok and the devices appear correctly in the 
containers /dev/dvb .... and they appear useable.

Mostly I see DVB utilities just failing when they attempt to use the 
/dev/dvb/adapterN/dmux0   device, without providing much information

This may be a host Apparmor issue (see syslog lines below)

I've tried mapping the offending device (dmux0) as both a character and 
block device .. makes no difference to the outcome.  When mapped as 
block devices the frontend0 device won't open either so am persisting 
with character device approach (consistent with the way they appear on 
the host
-----------------------------------------------------------
Container Config

$lxc config show xenial-mythserver
name: xenial-mythserver
profiles:
- default
config:
   boot.autostart: "false"
   limits.cpu: 1,2,3
   limits.memory: 6GB
   volatile.base_image: 
f452cda3bccb2903e56d53e402b9d35334b4276783d098axxxxxxxxxxxxxxxxx
   volatile.eth0.hwaddr: xxxxxxxxxxxxxxx
   volatile.last_state.idmap: 
'[{"Isuid":true,"Isgid":false,"Hostid":165536,"Nsid":0,"Maprange":65536},{"Isuid":false,"Isgid":true,"Hostid":165536,"Nsid":0,"Maprange":65536}]' 

devices:
dvb0_dmux:
     gid: "44"
     major: "212"
     minor: "0"
     path: /dev/dvb/adapter0/dmux0
     type: unix-char
dvb0_dvr:
     gid: "44"
     major: "212"
     minor: "1"
     path: /dev/dvb/adapter0/dvr0
     type: unix-char
dvb0_frontend:
     gid: "44"
     major: "212"
     minor: "3"
     path: /dev/dvb/adapter0/frontend0
     type: unix-char
   dvb0_net:
     gid: "44"
     major: "212"
     minor: "2"
     path: /dev/dvb/adapter0/net0
     type: unix-char
   dvb1_dmux:
     gid: "44"
     major: "212"
     minor: "4"
     path: /dev/dvb/adapter1/dmux0
     type: unix-char
   dvb1_dvr:
     gid: "44"
     major: "212"
     minor: "5"
     path: /dev/dvb/adapter1/dvr0
     type: unix-char
   dvb1_frontend:
     gid: "44"
     major: "212"
     minor: "7"
     path: /dev/dvb/adapter1/frontend0
     type: unix-char
   dvb1_net:
     gid: "44"
     major: "212"
     minor: "6"
     path: /dev/dvb/adapter1/net0
     type: unix-char
   dvb2_dmux:
     gid: "44"
     major: "212"
     minor: "8"
     path: /dev/dvb/adapter2/dmux0
     type: unix-char
   dvb2_dvr:
     gid: "44"
     major: "212"
     minor: "9"
     path: /dev/dvb/adapter2/dvr0
     type: unix-char
   dvb2_frontend:
     gid: "44"
     major: "212"
     minor: "11"
     path: /dev/dvb/adapter2/frontend0
     type: unix-char
   dvb2_net:
     gid: "44"
     major: "212"
     minor: "10"
     path: /dev/dvb/adapter2/net0
     type: unix-char
   dvb3_dmux:
     gid: "44"
     major: "212"
     minor: "12"
     path: /dev/dvb/adapter3/dmux0
     type: unix-char
   dvb3_dvr:
     gid: "44"
     major: "212"
     minor: "13"
     path: /dev/dvb/adapter3/dvr0
     type: unix-char
   dvb3_frontend:
     gid: "44"
     major: "212"
     minor: "15"
     path: /dev/dvb/adapter3/frontend0
     type: unix-char
   dvb3_net:
     gid: "44"
     major: "212"
     minor: "14"
     path: /dev/dvb/adapter3/net0
     type: unix-char
   dvd_data:
     path: /mnt/dvd_rips
     source: /mnt/dvd_rips
     type: disk
   eth0:
     name: eth0
     nictype: bridged
     parent: rebr0
     type: nic
   music_data:
     path: /mnt/music
     source: /mnt/music
     type: disk
   root:
     path: /
     type: disk
   video_data:
     path: /mnt/video
     source: /mnt/video
     type: disk

-----------------------------------------------------------
Syslog - showing Apparmor messages

Jul  2 15:18:40 virt-host kernel: [114573.780920] audit: type=1400 
audit(1467436720.274:1296): apparmor="DENIED" operation="mount" 
info="failed flags match" error=-13 
profile="lxd-xenial-mythserver_</var/lib/lxd>" name="/" pid=3232 
comm="(kManager)" flags="rw, rslave"
Jul  2 15:18:41 virt-host kernel: [114574.682255] audit: type=1400 
audit(1467436721.178:1297): apparmor="DENIED" operation="file_lock" 
profile="lxd-xenial-mythserver_</var/lib/lxd>" pid=3275 
comm="(ostnamed)" family="unix" sock_type="dgram" protocol=0 addr=none
Jul  2 15:18:41 virt-host kernel: [114574.682260] audit: type=1400 
audit(1467436721.178:1298): apparmor="DENIED" operation="file_lock" 
profile="lxd-xenial-mythserver_</var/lib/lxd>" pid=3275 
comm="(ostnamed)" family="unix" sock_type="dgram" protocol=0 addr=none
Jul  2 15:18:41 virt-host kernel: [114574.682265] audit: type=1400 
audit(1467436721.178:1299): apparmor="DENIED" operation="file_lock" 
profile="lxd-xenial-mythserver_</var/lib/lxd>" pid=3275 
comm="(ostnamed)" family="unix" sock_type="dgram" protocol=0 addr=none
Jul  2 15:18:41 virt-host kernel: [114574.682269] audit: type=1400 
audit(1467436721.178:1300): apparmor="DENIED" operation="file_lock" 
profile="lxd-xenial-mythserver_</var/lib/lxd>" pid=3275 
comm="(ostnamed)" family="unix" sock_type="dgram" protocol=0 addr=none

-----------------------------------------------------------
Container starts ok, and /dev/dvb are mapped. The Frontend device eg. 
/dev/dvb/adapter0 is usable, but the dmux device is not eg. 
/dev/dvb/adapter0

$ lxc exec xenial-mythserver bash

root at xenial-mythserver:~# ls /dev/dvb
adapter0  adapter1  adapter2  adapter3

root at xenial-mythserver:~# ls /dev/dvb/adapter0
dmux0  dvr0  frontend0  net0

root at xenial-mythserver:~# ls -l /dev/dvb/adapter0
total 0
crw-rw---- 1 root video 212, 0 Jul  2 15:18 dmux0
crw-rw---- 1 root video 212, 1 Jul  2 15:18 dvr0
crw-rw---- 1 root video 212, 3 Jul  2 15:18 frontend0
crw-rw---- 1 root video 212, 2 Jul  2 15:18 net0

-----------------------------------------------------------
And then when I try to use the devices, DMUX is unuseable.

root at xenial-mythserver:~# w_scan -c AU
w_scan -c AU
w_scan version 20141122 (compiled for DVB API 5.10)
using settings for AUSTRALIA
DVB aerial
DVB-T AU
scan type TERRESTRIAL, channellist 3
output format vdr-2.0
WARNING: could not guess your codepage. Falling back to 'UTF-8'
output charset 'UTF-8', use -C <charset> to override
Info: using DVB adapter auto detection.
         /dev/dvb/adapter0/frontend0 -> TERRESTRIAL "DiBcom 7000PC": 
good :-)
         /dev/dvb/adapter1/frontend0 -> TERRESTRIAL "DiBcom 7000PC": 
good :-)
         /dev/dvb/adapter2/frontend0 -> TERRESTRIAL "DiBcom 7000PC": 
good :-)
         /dev/dvb/adapter3/frontend0 -> TERRESTRIAL "DiBcom 7000PC": 
good :-)
Using TERRESTRIAL frontend (adapter /dev/dvb/adapter0/frontend0)
-_-_-_-_ Getting frontend capabilities-_-_-_-_
Using DVB API 5.10
frontend 'DiBcom 7000PC' supports
INVERSION_AUTO
QAM_AUTO
TRANSMISSION_MODE_AUTO
GUARD_INTERVAL_AUTO
HIERARCHY_AUTO
FEC_AUTO
FREQ (45.00MHz ... 860.00MHz)
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
Scanning DVB-T...
Scanning 7MHz frequencies...
177500: (time: 00:00.127)         signal ok:    QAM_AUTO f = 177500 kHz 
I999B7C999D999T999G999Y999 (0:0:0)
WARNING: start_filter: could not open demux.

-----------------------------------------------------------
Host definitions for same devices

$ ls /dev/dvb
adapter0  adapter1  adapter2  adapter3

$ ls /dev/dvb/adapter0
demux0  dvr0  frontend0  net0

$ ls -l /dev/dvb/adapter0
total 0
crw-rw----+ 1 xxxxxx video 212, 0 Jul  2 14:51 demux0
crw-rw----+ 1 xxxxxx video 212, 1 Jul  2 14:51 dvr0
crw-rw----+ 1 xxxxxx video 212, 3 Jul  2 14:51 frontend0
crw-rw----+ 1 xxxxxx video 212, 2 Jul  2 14:51 net0

and I had previously added

Note that I changed ownership to ensure they;d be readable
-----------------------------------------------------------

No messages in Host Syslog

No messages in container Syslog

Apparmor issue  (given the messages above, as the container starts) ?

Is / Should this use case be supported out of the box ?

R







More information about the lxc-users mailing list