Как переслать HCI0 (Bluetooth) в LXD (Ubuntu 18.04) внутри контейнера? - PullRequest
0 голосов
/ 14 апреля 2020

В Ubuntu 18.04 есть хост, я использую LXD и хочу, чтобы устройство hci0 было доступно внутри контейнера. Все мои попытки привели к тому, что само устройство находится внутри контейнера, но служба bluetoothd не видит его при запуске.

Что я сделал:

  • создан контейнер
  • добавил два параметра в конфигурацию контейнера:
    1. security.nesting: "истина"
    2. security.privileged: "истина"
  • также пытался переслать само устройство:
 blue:
    productid: "8087"
    type: usb
    vendorid: 0a2b

Что я вижу внутри контейнера:

# ls -la / sys / class / bluetooth / hci0

lrwxrwxrwx 1 root root 0 Apr 12 15:36 / sys / class / bluetooth / hci0 -> ../../devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/ bluetooth / hci0



service bluetooth status
● bluetooth.service - bluetooth service
   Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man: bluetoothd (8)

bluetoothd [3129]: Adapter handling initialization failed
systemd [1]: bluetooth.service: Main process exited, code = exited, status = 1 / FAILURE
systemd [1]: bluetooth.service: Failed with result 'exit-code'.
systemd [1]: Starting Bluetooth service ...
bluetoothd [11817]: bluetooth daemon 5.48
systemd [1]: Started Bluetooth service.
bluetoothd [11817]: Failed to access management interface
bluetoothd [11817]: Adapter handling initialization failed
systemd [1]: bluetooth.service: Main process exited, code = exited, status = 1 / FAILURE
systemd [1]: bluetooth.service: Failed with result 'exit-code'.



#hciconfig hci0

Can't open HCI socket .: Address family not supported by protocol
...