Pairing a Bluetooth device across different operating systems⚓︎
Shared chipset for Wi-Fi and bluetooth functionalities⚓︎
Some machines -- especially laptops -- feature a single chip handling both wireless and bluetooth connections. Certain Linux drivers have a hard time communicating with microcontrollers using this architecture. This means that you may run into issues when trying to pair up or connect a bluetooth device. If this is the case:
- Turn off all network connections (enable "Fly mode", represented with an airplane icon in most Linux desktop environments.)
- Enable bluetooth, and pair up or connect the device.
- Turn on network connections (disable "Fly mode").
This should allow you to have both functional and bluetooth connections.
Pairing up the same device across different operating systems on the same machine⚓︎
When you pair up a bluetooth device to your machine for the first time, they negotiate a single identifier key that will be used to authenticate the device whenever you actually connect it. An important caveat is that there is no built-in mechanism to allow you to connect the bluetooth device to an operating system (on the same machine) that is different from the operating system where the pairing up took place. This is unpleasant if you happen to use several operating systems on the machine (multi-boot scenario).
You can however circumvent this issue by manually re-applying the same key across operating systems. The procedure below has been tested across any operating system (except macOS). It works across different Linux distributions (you will just need steps 10-14 then).
Windows 10 and Linux (adapted from StackExchange)
- Pair all devices on Linux
- Pair all devices on Windows
- From Windows, go to Device & Printers in Control Panel and go to your Bluetooth device's properties. Then, in the Bluetooth section, you can find the unique identifier. Copy it as you will need it.
- Download PsExec from here.
- Unzip the zip you downloaded and open a CMD window with elevated privileges. (Click the Start menu, search for cmd, then right-click the CMD and click Run as Administrator.)
cdinto the folder where you unzipped your download.
psexec -s -i regedit.exe
- Navigate to find the keys under
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\BTHPORT\Parameters\Keys. If there is no CurrentControlSet, try ControlSet001.
- You should see a few keys labels with the MAC addresses -- write down the MAC address associated with the unique identifier you copied before.
- Go back to Linux (if not in Linux) and add your Windows key to your Linux config entries. Just note that the Bluetooth port's MAC address is formatted differently when moving from Windows to Linux - referenced as aa1122334455 in Windows in my example above. The Linux version will be in all caps and punctuated by ':' after every two characters - for example
- Switch to root: do
cdto your Bluetooth config location at
/var/lib/bluetooth/[bth port MAC addresses]
- Here you'll find folders for each device you've paired with. The folder names being the Bluetooth devices' MAC addresses and contain a single file info. In these files, you'll see the link key you need to replace with your Windows ones, like so:
[LinkKey] Key=< NEW KEY, ex. B99999999FFFFFFFFF999999999FFFFF >
- Finally restart your bluetooth systemd service with
sudo systemctl restart bluetooth