operating-system: Bluetooth no longer working on VirtualBox after upgrade

Describe the issue you are experiencing

While running Homeassistant OS 7.6 on VirtualBox, Bluetooth works (bluetoothctl shows the controller). After upgrading to 8.1, Bluetooth stops working: “No default controller available” Downgraded again, works, upgraded: stops working.

What operating system image do you use?

ova (for Virtual Machines)

What version of Home Assistant Operating System is installed?

8.1

Did you upgrade the Operating System.

Yes

Steps to reproduce the issue

  1. Install the OVA image on a VirtualBox machine
  2. Note: version installed 7.6
  3. Add to yaml configuration
device_tracker:
  - platform: bluetooth_tracker
  1. Connect to the VM, hit ‘login’ and run bluetoothctl scan on The cli returns the controller and relevant information
  2. Upgrade to 8.1 and restart
  3. Notice the issue
  4. Additionally you can repeat step 4: "No default controller available Note: none are displayed

Anything in the Supervisor logs that might be useful for us?

A warning:
22-05-21 11:59:51 WARNING (MainThread) [supervisor.host.network] Requested to update interface enp0s3 which does not exist or is disabled.

Anything in the Host logs that might be useful for us?

[    0.194225] acpi PNP0A03:00: fail to add MMCONFIG information, can't access extended PCI configuration space under this bridge.
[    0.194386] PCI host bridge to bus 0000:00
...
[    2.606952] usb usb1-port2: Cannot enable. Maybe the USB cable is bad?
..

System Health information

Home Assistant Core 2022.5.5
Home Assistant Supervisor 2022.05.2
Home Assistant OS 8.1
Kernel version 5.15.41
Agent version 1.2.1
Path to configuration.yaml: /config
[...]
Frontend version: 20220504.1 - latest

<html> <body>
Version core-2022.5.5
Installation Type Home Assistant OS
Development false
Supervisor true
Docker true
User root
Virtual Environment false
Python Version 3.9.9
Operating System Family Linux
Operating System Version 5.15.41
CPU Architecture x86_64
Timezone Europe/Bucharest
</body> </html> <html> <body>
Host Operating System Home Assistant OS 8.1
Update Channel stable
Supervisor Version supervisor-2022.05.2
Docker Version 20.10.14
Disk Total 30.8 GB
Disk Used 3.3 GB
Healthy true
Supported true
Board ova
Supervisor API ok
Version API ok
Installed Add-ons File editor (5.3.3), Samba share (9.6.1), Terminal & SSH (9.4.0), Git pull (7.13.1), Google Assistant SDK (2.5.0)
</body> </html> <html> <body>
Dashboards 2
Resources 0
Views 1
Mode storage
</body> </html> ### Additional information

Card: Gigabyte Intel Wireless-AC 9260 2x2 802.11AC Dual-Band WiFi+ Bluetooth

Other logs:

File "/usr/src/homeassistant/homeassistant/components/bluetooth_tracker/device_tracker.py", line 167, in perform_bluetooth_update
    friendly_name = await hass.async_add_executor_job(lookup_name, mac)
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/bluetooth_tracker/device_tracker.py", line 127, in lookup_name
    return bluetooth.lookup_name(mac, timeout=5)  # type: ignore[no-any-return]
  File "/usr/local/lib/python3.9/site-packages/bluetooth/bluez.py", line 61, in lookup_name
    sock = _gethcisock ()
  File "/usr/local/lib/python3.9/site-packages/bluetooth/bluez.py", line 291, in _gethcisock
    raise BluetoothError ("error accessing bluetooth device")
bluetooth.btcommon.BluetoothError: error accessing bluetooth device
2022-05-21 12:02:29 ERROR (SyncWorker_4) [homeassistant.components.bluetooth_tracker.device_tracker] Couldn't discover bluetooth devices: [Errno 19] No such device
2022-05-21 12:02:29 ERROR (MainThread) [homeassistant.components.bluetooth_tracker.device_tracker] Error looking up Bluetooth device
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/bluetooth/bluez.py", line 289, in _gethcisock
    sock = _bt.hci_open_dev (device_id)
_bluetooth.error: no available bluetoot devices
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/bluetooth_tracker/device_tracker.py", line 167, in perform_bluetooth_update
    friendly_name = await hass.async_add_executor_job(lookup_name, mac)
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/bluetooth_tracker/device_tracker.py", line 127, in lookup_name
    return bluetooth.lookup_name(mac, timeout=5)  # type: ignore[no-any-return]
  File "/usr/local/lib/python3.9/site-packages/bluetooth/bluez.py", line 61, in lookup_name
    sock = _gethcisock ()
  File "/usr/local/lib/python3.9/site-packages/bluetooth/bluez.py", line 291, in _gethcisock
    raise BluetoothError ("error accessing bluetooth device")
bluetooth.btcommon.BluetoothError: error accessing bluetooth device
2022-05-21 12:02:34 WARNING (MainThread) [homeassistant.components.sensor] Updating mitemp_bt sensor took longer than the scheduled update interval 0:00:30
2022-05-21 12:02:35 WARNING (SyncWorker_3) [homeassistant.components.mitemp_bt.sensor] Polling error Exit read_ble, no data (<Thread(SyncWorker_3, started 140258255567664)>)
2022-05-21 12:02:41 ERROR (SyncWorker_5) [homeassistant.components.bluetooth_tracker.device_tracker] Couldn't discover bluetooth devices: [Errno 19] No such device
2022-05-21 12:02:41 ERROR (MainThread) [homeassistant.components.bluetooth_tracker.device_tracker] Error looking up Bluetooth device
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/bluetooth/bluez.py", line 289, in _gethcisock
    sock = _bt.hci_open_dev (device_id)
_bluetooth.error: no available bluetoot devices
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/bluetooth_tracker/device_tracker.py", line 167, in perform_bluetooth_update
    friendly_name = await hass.async_add_executor_job(lookup_name, mac)
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/bluetooth_tracker/device_tracker.py", line 127, in lookup_name
    return bluetooth.lookup_name(mac, timeout=5)  # type: ignore[no-any-return]
  File "/usr/local/lib/python3.9/site-packages/bluetooth/bluez.py", line 61, in lookup_name
    sock = _gethcisock ()
  File "/usr/local/lib/python3.9/site-packages/bluetooth/bluez.py", line 291, in _gethcisock
    raise BluetoothError ("error accessing bluetooth device")
bluetooth.btcommon.BluetoothError: error accessing bluetooth device
2022-05-21 12:02:53 ERROR (SyncWorker_2) [homeassistant.components.bluetooth_tracker.device_tracker] Couldn't discover bluetooth devices: [Errno 19] No such device
2022-05-21 12:02:53 ERROR (MainThread) [homeassistant.components.bluetooth_tracker.device_tracker] Error looking up Bluetooth device
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/bluetooth/bluez.py", line 289, in _gethcisock
    sock = _bt.hci_open_dev (device_id)
_bluetooth.error: no available bluetoot devices
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/bluetooth_tracker/device_tracker.py", line 167, in perform_bluetooth_update
    friendly_name = await hass.async_add_executor_job(lookup_name, mac)
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/bluetooth_tracker/device_tracker.py", line 127, in lookup_name
    return bluetooth.lookup_name(mac, timeout=5)  # type: ignore[no-any-return]
  File "/usr/local/lib/python3.9/site-packages/bluetooth/bluez.py", line 61, in lookup_name
    sock = _gethcisock ()
  File "/usr/local/lib/python3.9/site-packages/bluetooth/bluez.py", line 291, in _gethcisock
    raise BluetoothError ("error accessing bluetooth device")
bluetooth.btcommon.BluetoothError: error accessing bluetooth device
2022-05-21 12:03:04 WARNING (SyncWorker_6) [homeassistant.components.mitemp_bt.sensor] Polling error Could not read data from Mi Temp sensor 58:2D:34:3A:86:79
2022-05-21 12:03:04 WARNING (SyncWorker_4) [homeassistant.components.mitemp_bt.sensor] Polling error Could not read data from Mi Temp sensor 58:2D:34:3A:86:79
2022-05-21 12:03:05 ERROR (SyncWorker_0) [homeassistant.components.bluetooth_tracker.device_tracker] Couldn't discover bluetooth devices: [Errno 19] No such device
2022-05-21 12:03:05 ERROR (MainThread) [homeassistant.components.bluetooth_tracker.device_tracker] Error looking up Bluetooth device
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/bluetooth/bluez.py", line 289, in _gethcisock
    sock = _bt.hci_open_dev (device_id)
_bluetooth.error: no available bluetoot devices
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/bluetooth_tracker/device_tracker.py", line 167, in perform_bluetooth_update
    friendly_name = await hass.async_add_executor_job(lookup_name, mac)
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/bluetooth_tracker/device_tracker.py", line 127, in lookup_name
    return bluetooth.lookup_name(mac, timeout=5)  # type: ignore[no-any-return]
  File "/usr/local/lib/python3.9/site-packages/bluetooth/bluez.py", line 61, in lookup_name
    sock = _gethcisock ()
  File "/usr/local/lib/python3.9/site-packages/bluetooth/bluez.py", line 291, in _gethcisock
    raise BluetoothError ("error accessing bluetooth device")
bluetooth.btcommon.BluetoothError: error accessing bluetooth device
2022-05-21 12:03:14 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.mitemp_bt_battery is taking over 10 seconds

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 27 (4 by maintainers)

Most upvoted comments

I am having the same problem with KVM on a NUC. The host OS is Ubuntu 22.04, and can see the Bluetooth controller. I’ve exported the Bluetooth controller (USB ID 8087:0a2b) to the guest HAOS. bluetoothctl devices says No default controller available.

Here’s the output of journalctl | grep -i blue in the guest OS:

Aug 29 14:27:03 homeassistant kernel: Bluetooth: Core ver 2.22
Aug 29 14:27:03 homeassistant kernel: NET: Registered PF_BLUETOOTH protocol family
Aug 29 14:27:03 homeassistant kernel: Bluetooth: HCI device and connection manager initialized
Aug 29 14:27:03 homeassistant kernel: Bluetooth: HCI socket layer initialized
Aug 29 14:27:03 homeassistant kernel: Bluetooth: L2CAP socket layer initialized
Aug 29 14:27:03 homeassistant kernel: Bluetooth: SCO socket layer initialized
Aug 29 14:27:04 homeassistant systemd[1]: Mounting Bluetooth persistent state...
Aug 29 14:27:04 homeassistant systemd[1]: Mounted Bluetooth persistent state.
Aug 29 14:27:04 homeassistant systemd[1]: Starting Bluetooth service...
Aug 29 14:27:04 homeassistant bluetoothd[309]: Bluetooth daemon 5.63
Aug 29 14:27:04 homeassistant systemd[1]: Started Bluetooth service.
Aug 29 14:27:04 homeassistant systemd[1]: Reached target Bluetooth Support.
Aug 29 14:27:04 homeassistant bluetoothd[309]: Starting SDP server
Aug 29 14:27:04 homeassistant bluetoothd[309]: profiles/network/bnep.c:bnep_init() kernel lacks bnep-protocol support
Aug 29 14:27:04 homeassistant bluetoothd[309]: src/plugin.c:plugin_init() System does not support network plugin
Aug 29 14:27:04 homeassistant bluetoothd[309]: Bluetooth management interface 1.21 initialized
Aug 29 14:27:04 homeassistant dbus-daemon[117]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.7' (uid=0 pid=309 comm="/usr/libexec/bluetooth/bluetoothd ")
Aug 29 14:27:05 hass kernel: Bluetooth: hci0: command 0xfc05 tx timeout
Aug 29 14:27:05 hass kernel: Bluetooth: hci0: Reading Intel version command failed (-110)
Aug 29 14:27:44 hass ghcr.io/home-assistant/qemux86-64-homeassistant:2022.8.7/homeassistant[378]: 2022-08-29 16:27:44.285 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Bluetooth' for bluetooth integration not ready yet: Failed to start Bluetooth: adapter 'hci0' not found; Retrying in background
[    2.606952] usb usb1-port2: Cannot enable. Maybe the USB cable is bad?

Hm, that sounds like there is an issue with forwarding the USB device. It sounds like with Linux 5.15 something broke OS forwarding. I am not aware of any driver changes which could have caused that.

What Host OS do you use? Do you use the VirtualBox Extension Pack?

Can you attach the full host logs (dmesg) of 7.6 and 8.1?

It was a pitty! 😦 I’m runnig HA OS 8.4, 8.5 (switching in the boot from one to other) in VirtualBox over Windows 11. I’m using the last versions of the rest of components. Bluetooth doesn’t run. I tried several adapter: 1rs- Hw computer integrated, Intel 2º One based in Realte BT 5.0 3rd. ASU BT500, one of the recommended.

My last error messages (in the guest console) are: - Bluetooth: hci0: command 0xfc20 tx timeout - Bluetooth: hci0: RTL: download fw command failed (-110) and the bluetoth adapter is rejected.

When is running there are continous messages, like these: (at least one per operation I suppose) - Bluetooth: hci0: command 0x2042 tx timeout - Bluetooth: hci0: No gpio to reset Realtek device, ignoring - Bluetooth: hci0: unexxpected event for opcode 0x2042 - Bluetooth: hci0: failed to disable LE scan: stauts 0x1f

Almost all the issues described in this thread hapenned to me. 😉 It was a pitty, but in next days I will be impeled to use the EspHome BT Gw. Best regards

I also tried fixing this by throwing money at it and it did the trick for me. I purchased an ASUS USB-BT500, disabled the onboard Intel Wireless Bluetooth from Control Panel and restarted the PC. Windows 10 picked up the drivers right away, Home Assistant also displayed a new button “setup Bluetooth” (or something like this) on the integrations page and them Bluetooth devices started to show up. Sumup:

  • Intel bluetooth still doesn’t work on HA > 7.6
  • Intel bluetooth works on HA 7.6
  • ASUS bluetooth works on HA 8.5 (didn’t try older versions)

I still suspect the iwlwifi drivers are to blame.

Confirmed Intel Wireless 9260 Bluetooth does not work on 8.0 and 8.1

Found this? https://bugzilla.kernel.org/show_bug.cgi?id=215167