Permission Denied and FileNotFoundError for D-Bus System Bus in WSL2 Docker Container Running Bleak BLE Script

I’m running a Docker container in WSL2 (Ubuntu, likely 22.04) on Windows 11 to perform Bluetooth Low Energy (BLE) scanning using a Python script (bt_app.py) with the bleak library. The script works fine in WSL2 directly, where bluetoothctl scan on detects BLE devices (e.g., F0:39:65:2B:EB:BC), confirming the Bluetooth adapter (USB dongle, passed via usbipd-win) and bluez are functional. However, when running the script in a Docker container, I get a FileNotFoundError for the D-Bus system bus socket, and in WSL2, dbus-monitor --system fails with Permission denied or No such file or directory.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.