lxc container can't use nfc usb device

1.3k views Asked by At

I have been trying to use libnfc in a lxc container running debian wheezy. Having tried several things and libraries, thus justifying the lxc way, I finally reached a point where I don't know where to look.

The problem is that the hosts sees my usb device, but not the container.

I added the following in the container's lxc config file:

lxc.cgroup.devices.allow = c 189:* rwm

When I try lsusb on the container I get:

root@nfc:~/libnfc# lsusb
unable to initialize libusb: -99

Whereas the host gives:

Bus 006 Device 003: ID 072f:2200 Advanced Card Systems, Ltd

Which is the device I'm looking for.

Surprisingly the container can see the device:

root@nfc:~/libnfc# usb-devices
[...]
T:  Bus=06 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  3 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=072f ProdID=2200 Rev=02.14
S:  Manufacturer=ACS
S:  Product=ACR122U PICC Interface
C:  #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=200mA
I:  If#= 0 Alt= 0 #EPs= 3 Cls=0b(scard) Sub=00 Prot=00 Driver=(none)

I have checked libusb versions, kernel modules, dependencies, but being quite ignorant there I'm a bit lost.

Any ideas ?

1

There are 1 answers

1
rubiojr On

Adding:

lxc.mount.entry = /dev/bus/usb dev/bus/usb none bind,optional,create=dir

To the container configuration file in addition to lxc.cgroup.devices.allow = c 189:* rwm worked for me.