Qubes 4.2 Bluetooth

Hi,

I’m trying to configure a wireless mouse on Qubes 4.2.

Bluetooth is installed on the template (debian-12-xfce).

The bluetooth icon on the tray is missing.

sudo service bluetooth status’ gives following message:
○ bluetooth.service - Bluetooth service
Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; preset: enabled)
Active: inactive (dead)
Docs: man:bluetoothd(8)

Feb 10 14:22:07 debian-12-xfce systemd[1]: bluetooth.service - Bluetooth service was skipped because of an unmet condition check (ConditionPathIsDirectory=/sys/class/bluetooth).
Feb 10 14:25:27 debian-12-xfce systemd[1]: bluetooth.service - Bluetooth service was skipped because of an unmet condition check (ConditionPathIsDirectory=/sys/class/bluetooth).

The service is enabled but not started.
No success with ‘sudo service bluetooth start’

The file/directory (or what else) ‘/sys/class/bluetooth’ does not exist.
(‘ConditionPathIsDirectory=/sys/class/bluetooth’)

This is the configuration file:
# /lib/systemd/system/bluetooth.service
[Unit]
Description=Bluetooth service
Documentation=man:bluetoothd(8)
ConditionPathIsDirectory=/sys/class/bluetooth

[Service]
Type=dbus
BusName=org.bluez
ExecStart=/usr/libexec/bluetooth/bluetoothd
NotifyAccess=main
#WatchdogSec=10
#Restart=on-failure
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
LimitNPROC=1

# Filesystem lockdown
ProtectHome=true
ProtectSystem=strict
PrivateTmp=true
ProtectKernelTunables=true
ProtectControlGroups=true
StateDirectory=bluetooth
StateDirectoryMode=0700
ConfigurationDirectory=bluetooth
ConfigurationDirectoryMode=0555

# Execute Mappings
MemoryDenyWriteExecute=true

# Privilege escalation
NoNewPrivileges=true

# Real-time
RestrictRealtime=true

[Install]
WantedBy=bluetooth.target
Alias=dbus-org.bluez.service

Any suggestions?

Thanks!

For all those who are interested in configuring a MagicMouse:
1. Create a dvm
• qvm-create --template debian-12-xfce --label red debian-12-xfce-dvm
• qvm-prefs debian-12-xfce-dvm template_for_dispvms True
• qvm-features debian-12-xfce-dvm appmenus-dispvm 1

2. Restart
• qvm-shutdown --wait sys-usb; qvm-prefs sys-usb template debian-12-xfce-dvm; qvm-start sys-usb

3. Install bluetooth, bluez and blueman
• qvm-run --pass-io -u root debian-12-xfce “apt install bluetooth bluez blueman”

4. Install dkms
• qvm-run --pass-io -u root debian-12-xfce “apt install dkms”

<reboot/restart qubes>

5. Install MagicMouse driver (latest)
Latest version:

user@debian-12-xfce:~$ git clone deb package

user@debian-12-xfce:~$ sudo apt install ./magicmouse-hid_2.1.0-0.deb

[AFAIK on fedora the HID driver is embedded in the shipped kernel]

<reboot/restart qubes>

6. Check bluetooth status and adapt configuration if necessary
user@sys-usb:~$ sudo systemctl status bluetooth

In case that you get any warnings/errors like those, turn Experimental on:

user@debian-12-xfce:~$ sudo vi /etc/bluetooth/main.conf
#Experimetal = false
Experimetal = true

<reboot/restart qubes>, and check the bluetooth status again.

user@sys-usb:~$ sudo systemctl status bluetooth

You should now be clean.

7. Add service ‘blueman’ to sys-usb

8. MagicMouse configuration
Optional - Backup initial bluetooth configuration
user@sys-usb:~$ sudo cp -rpv /var/lib/bluetooth/AA:BB:CC:DD:EE:FF ~/Downloads
Save the backup outside of the dvm
user@sys-usb:~$ sudo su
root@sys-usb: /home/user# qvm-copy ./AA:BB:CC:DD:EE:FF

At this point I decided to copy an existing configuration from a kali system installed on another partition, because I don´t want to avoid the annoying re-pairing with every system switch.

9. Get an existing configuration of MagicMouse, and overwrite existing one on debian-12-xfce
user@debian-12-xfce:~$ sudo su
root@debian-12-xfce: /home/user# cp -R ./AA:BB:CC:DD:EE:FF /var/lib/bluetooth

<reboot/restart qubes>

You should now be ready.

Any suggestions for improvement are wellcome.