Displaylink monitor

Hello everyone
Has anyone tested or knows if it is possible to use a displaylink monitor in an lxd container?


DisplayLink uses USB, and it should be possible to share the device to the container.
I do not have such hardware.
See https://stgraber.org/2017/03/27/usb-hotplug-with-lxd-containers/ for more.

Alternatively, you may be able to make available to the container whatever device is created by the Ubuntu DisplayLink software, using proxy devices.

So that kinda depends, if it’s a simple libusb device which shows up in /dev/usb and then has a purely userspace driver making use of it, this should be fine.

If instead there is a kernel driver which makes this show up as some kind of graphics card, then you’re unlikely to have much luck with a usb device, but maybe a gpu device would work. I’m just not familiar enough with displaylink to know how this works.

Thanks for the replies Simos and Stéphane.
Unfortunately it does not seem to be simple to make the displaylink adapter work in a container.
This is the result of when I plug it into my computer:
higor@medusa:~$ sudo udevadm monitor --kernel
monitor will print the received events for:
KERNEL - the kernel uevent

KERNEL[127.486004] add /devices/pci0000:00/0000:00:14.0/usb3/3-2 (usb)
KERNEL[127.491157] add /devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0 (usb)
KERNEL[127.491445] bind /devices/pci0000:00/0000:00:14.0/usb3/3-2 (usb)
KERNEL[127.508014] add /module/udl (module)
KERNEL[127.508513] add /devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0/drm/card1 (drm)
KERNEL[127.509185] add /devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0/drm/card1/card1-DVI-I-1 (drm)
KERNEL[127.509306] change /devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0/drm/card1 (drm)
KERNEL[127.662378] add /devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0/graphics/fb1 (graphics)
KERNEL[127.662441] bind /devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0 (usb)
KERNEL[127.662572] add /bus/usb/drivers/udl (drivers)
KERNEL[128.811967] change /devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0/drm/card1 (drm)

Passing the adapter to the container using “lxc config device add con-01 displaylink usb vendorid=17e9 productid=0199” is not disabled on the host.
I also tried to pass using unix-char:
lxc config device add-01 fb1 unix-char path =/dev/fb1 mode=0660
Device fb1 added to con-01
lxc config device add con-01 card1 unix-char path=/dev/dri/card1 mode=0660
Device card1 added to con-01
But it still works on the host, do you have any suggestions for me to try before giving up using this adapter?

So except for the nictype=physical for nic and infiniband, all other device types add things to the container without taking it away from the host.

If your problem is that your host’s X server is using that device, preventing it from being used from the container, then you will need to configure the software on the host to stop doing that.

It’s generally not possible to have block/char devices only be visible in a container and not on the host.