[LXD 4.11] Any way/workaround to pass bluetooth gamepad into a container (for retropie etc)?

I’m trying to understand if I can move Retropie into a container.
Though setup of RPie is known, I’m wondering if there is any way (“clean”/workaround/whatever) to pass bluetooth gamepads into a container.
I don’t care if it’s done “clean” (via BT that seems is not possible yet), or through a valid workaround (speculating - by creating networking or USB proxy device using 3rd party utility and passing it through). Or, I dunno maybe by passing through /dev/ttyAMA0 somehow

Environment: Raspberry Pi 4, LXC 4.11, host/container - Ubuntu server 20.10 arm64
Bluetooth is either built-in or USB stick (CSL BSN300419) as I can use both

I’ve seen How to forward HCI0 (Bluetooth) in LXD inside the container?, but as there may be other known ways to pass that type of device either through kinda proxy/idk, I’m posting the thread.
I would not like to try 4 wrong paths if someone knows a working one.


Try this, search for /dev/input/ which device your gamepad created
Then just add this device to your container.
In my case I need to pass these two devices

lxc config device add c-03 js0 unix-char path=/dev/input/js0

lxc config device add c-03 eventxx unix-char path=/dev/input/eventxx

1 Like

tnx, will try and respond so other knows!

I do have 8BitDo SN30 pro that I would like to use for RetroPie running in LXD container

Ok, just to explain my silence. I’ve hit severe issues with getting X11 up and running on DeskEenv-less host, so I had to stop my attempts to get RetroPie up and running within LXD cont.

Once I solve that blocker, I’ll come back to bluetooth question.