[lxc-users] Hotplugging devices (USB Z-Wave controller) with path value

Stéphane Graber stgraber at ubuntu.com
Fri Apr 20 16:54:31 UTC 2018


On Wed, Apr 18, 2018 at 03:41:04PM -0400, Lai Wei-Hwa wrote:
> To add another thing, even though I've removed the device (lxc config device remove hass Z-Wave), it is still seen in the container: 
> 
> lai at hass:~$ lsusb 
> Bus 002 Device 003: ID 0624:0249 Avocent Corp. Virtual Keyboard/Mouse 
> Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub 
> Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub 
> Bus 005 Device 002: ID 0624:0248 Avocent Corp. Virtual Hub 
> Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub 
> Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub 
> Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub 
> Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub 
> Bus 003 Device 002: ID 0658:0200 Sigma Designs, Inc. 
> Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub 
> 
> Thanks! 
> Lai 
> 
> 
> 
> I was trying to setup hotplugging a USB into an LXD container. I need the path, in the container, to be /dev/ttyACM0. How can I do this? 
> 
> lai at host:~$ lxc config device add hass Z-Wave unix-char vendorid=0658 productid=0200 path=/dev/ttyACM0 
> Error: Invalid device configuration key for unix-char: productid 

lxc config device add hass Z-Wave unix-char path=/dev/ttyACM0

If you have multiple devices that may end up at that path, you should
instead use something like:

lxc config device add hass Z-Wave unix-char source=/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A60337Y1-if00-port0 path=/dev/ttyACM0

This will ensure that the device at /dev/ttyACM0 in the container is always the same one.


I do this in my openhab container here where I have the following devices:
  usb-alarm:
    gid: "111"
    path: /dev/ttyUSB1
    source: /dev/serial/by-id/usb-FTDI_FT230X_Basic_UART_DQ00AXEP-if00-port0
    type: unix-char
    uid: "0"
  usb-insteon:
    gid: "111"
    path: /dev/ttyUSB0
    source: /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A60337Y1-if00-port0
    type: unix-char
    uid: "0"
  usb-z-wave:
    gid: "111"
    path: /dev/ttyACM0
    source: /dev/serial/by-id/usb-0658_0200-if00
    type: unix-char
    uid: "0"


> 
> lai at host:~$ lxc config device add hass Z-Wave usb vendorid=0658 productid=0200 path=/dev/ttyACM0 
> Error: Invalid device configuration key for usb: path 
> 
> 
> _______________________________________________ 
> lxc-users mailing list 
> lxc-users at lists.linuxcontainers.org 
> http://lists.linuxcontainers.org/listinfo/lxc-users 

> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users


-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20180420/7747af07/attachment.sig>


More information about the lxc-users mailing list