selkies-project / docker-nvidia-glx-desktop

KDE Plasma Desktop container designed for Kubernetes, supporting OpenGL EGL and GLX, Vulkan, and Wine/Proton for NVIDIA GPUs through WebRTC and HTML5, providing an open-source remote cloud/HPC graphics or game streaming platform.
https://github.com/selkies-project/docker-nvidia-glx-desktop/pkgs/container/nvidia-glx-desktop
Mozilla Public License 2.0
305 stars 65 forks source link

Passthrough of host usb devices to container? #39

Closed TaylorAdams closed 1 year ago

TaylorAdams commented 1 year ago

Hello, thanks for maintaining this interesting project/container, which has been awesome for the intended use case.

But an odd admittedly edge case I have use for and can't quite get to work: I've tried using --device and volume options for docker run to give the container access to host (Ubuntu 20.04.1) usb devices (specifically input devices, keyboard etc).

I've tried: --device /dev/bus/usb -v /dev/bus/usb:/dev/bus/usb --privileged

The devices appear to be visible from within a shell in the container but are not available/listed in xinput. I'm guessing there's something I don't understand going on with either the configuration that allows webRTC virtual input devices or just with containerized x in general that's preventing these from being picked up normally by the desktop environment there.

Thanks for any pointers in the right direction but feel free to close if too off-topic.

ehfd commented 1 year ago

Hi. This is definitely not off topic. Rather than this being a WebRTC issue (our input implementation integrates with X11 APIs so it should be something with the host-container interaction), do check the following links: https://stackoverflow.com/questions/72672210/xorg-xinput-does-not-recognise-evdev-devices-in-docker-alpine-base-image https://www.reddit.com/r/linuxquestions/comments/vffwfa/xorgxinput_in_docker_input_devices_via_evdev_not/ https://github.com/mviereck/x11docker/issues/89#issuecomment-441354581 https://github.com/ehough/docker-kodi/issues/16 https://dwm.suckless.org/multi-pointer/

If you did not find a solution, let me see if I can find a way to reproduce...

TaylorAdams commented 1 year ago

Thanks for your advice, I looked into these sources and others but wasn't able to figure out a solution.

ehfd commented 1 year ago

@TaylorAdams Any updates for the users that you have experienced?

TaylorAdams commented 1 year ago

Thanks for checking in. About the same as my last comment, I wasn't able to get it working, but thankfully it's not really the primary use case for the container. This issue can probably be closed but maybe if anyone else has some luck with it they can comment later.