Syncing Bluetooth Pairings between Linux and Microsoft Windows 10/11 on a dual boot computer
Table of Contents
To sync the Bluetooth pairing keys between Linux and Microsoft Windows 10/11 on a dual boot computer, so that every Bluetooth device works on Linux just as well as on Microsoft Windows, without having to (re)pair it on every reboot:
- Pair the Bluetooth devices in Microsoft Windows.
- Then, in Linux, pair the Low Energy devices last, but first all other ones:
Non Low-Energy devices
-
For non-Low-Energy devices, use bt-dualboot, that exports the pairing keys to Microsoft Windows from Linux as follows:
- Install
chntpw
by your package manager, saysudo zypper install chntpw
on Opensuse. - install
bt-dualboot
bysudo pip install git+https://github.com/Simon128/bt-dualboot
- Pair the Bluetooth devices on Linux.
- run
lsblk
to find out your Microsoft Windows partition, say/dev/sdb1
, and mount it bysudo mount /dev/sdb1 /mnt
. - run it by
sudo bt-dualboot --backup --sync-all
to export the pairing keys from Linux’s/var/lib/bluetooth
folder into the Microsoft Windows registry.
- Install
Low-Energy devices
-
for newer Low Energy devices, such as Microsoft Designer Mouse and Keyboard, use this script that imports the pairing keys from Microsoft Windows to Linux, as follows:
- Install
chntpw
by your package manager, saysudo zypper install chntpw
on Opensuse. - Download the script as
export-ble-infos.py
into, say,~/bin
. - Run
lsblk
to find out your Microsoft Windows partition, say/dev/sdb1
, and mount it bysudo mount /dev/sdb1 /mnt
. -
run
$ cd ~/bin $ chmod a+x ./export-ble-infos.py $ ./export-ble-infos.py $ sudo bash -c 'cp -r ./bluetooth /var/lib && systemctl restart bluetooth' $ rm -r bluetooth
to import all Bluetooth Low Energy devices from the Microsoft Windows registry into Linux’s
/var/lib/bluetooth
folder. - Install
Manually
If you need to export your Bluetooth keys from a Windows Virtual machine to Linux, then manual effort seems called for.
To export the Bluetooth key from the Windows registry, either add your user to those having access permissions to its folder or download psexec to start regedit
by psexec -s -i regedit.exe
for additional access rights.