Table of Contents
- Introduction
- Syncing Bluetooth in Dual Boot (Windows and Linux)
- Syncing Bluetooth in Triple Boot (macOS, Windows, and Linux)
- Additional Notes
- References
Introduction
If you use dual boot or triple boot, you may have noticed that when switching operating systems, your Bluetooth devices do not connect automatically.
This can be really annoying, especially if you have a Bluetooth keyboard and mouse and have to manually connect them every time you switch OS.
Why does this happen?
When you pair a Bluetooth device on an operating system, a synchronization key (LinkKey
) is generated. Since this key is not shared between systems, when switching OS, the device cannot authenticate properly.
What’s the solution?
It’s as simple as having the same synchronization keys on all your operating systems. To do this, you need to copy the Bluetooth sync keys from one OS to another.
Syncing Bluetooth in Dual Boot (Windows and Linux)
Connecting Devices in Linux
-
Open the terminal and run
bluetoothctl
:Terminal window bluetoothctl -
Enable pairing mode:
Terminal window pairable ondiscoverable on -
Scan and pair the device:
Terminal window scan onCopy the device’s MAC address and use:
Terminal window connect XX:XX:XX:XX:XX:XX -
Verify the connection and exit
bluetoothctl
:Terminal window exit
Connecting Devices in Windows
- Connect your Bluetooth devices in Windows. Follow the usual steps in Windows Bluetooth settings.
- Ensure the device is properly connected.
Copying Bluetooth Keys from Windows to Linux
-
Download PsTools and extract
PsExec
into an easy-to-access folder, such asC:\Windows
. -
Find your MAC address.
Opencmd
and run:Terminal window getmac /V /FO LISTFind your Bluetooth device’s MAC address and note it down.
-
Run
cmd
as administrator, navigate to the folder where you savedPsExec
, and run:Terminal window psexec -s -i regeditThis will open the Registry Editor with administrator privileges.
-
In the Registry Editor, navigate to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\Keys\<MAC_ADDRESS> -
Find your device key, double-click on its name (a new window will open).
-
In the new window, copy the key value from the
Value Data
field. -
Reboot into Linux.
-
In Linux
- Open the terminal and run:
Terminal window sudo suEnter your admin password.
- Navigate to the Bluetooth folder:
Terminal window cd /var/lib/bluetooth/<MAC_ADDRESS>/<DEVICE_MAC>Replace
<MAC_ADDRESS>
with your internal Bluetooth adapter’s MAC address and<DEVICE_MAC>
with your external device’s MAC address. -
Edit the
info
fileLocate the
[LinkKey]
section and replace theKey
value with the one copied from Windows:info [LinkKey]Key=B3798087E81E306CDAB046...
Reboot Linux, and the device should connect automatically.
Syncing Bluetooth in Triple Boot (macOS, Windows, and Linux)
NOTE: The steps are the same if you only have dual boot with macOS.
Pairing Bluetooth Devices on Each System
- Pair first on Linux. (See steps 1-4 in the previous section).
- Pair on Windows.
- Finally, pair on macOS.
Extracting and Transferring the LinkKey
-
On macOS, open Spotlight and search for
KeyChain Access
. -
Search for
bluetooth
in the search bar and double-click the latestMobileBluetooth
result. -
In the new window, you will see your device’s MAC address in the Account field (
xx:xx:xx:xx:xx:xx
). Take note of it. -
Then, in the same window, check Show password, and enter your credentials (it will ask twice).
-
The revealed password is actually an XML file. Click on the field, press Option + A or Ctrl + A, then copy and save it.
Make sure to copy the full content and save it.
-
Under
<key>LinkKey</key>
, copy the value between<string>xx-xx-xx-xx</string>
into your notes.
NOTE: If you have multiple devices connected, do this for each one.
-
Reboot into Windows.
-
Transfer the
LinkKey
to Windows and Linux (or all OSes except macOS):- For Windows
- Follow the steps up to step 4 in the previous section.
- Find your device’s MAC address and double-click it.
- A new window will open with your device’s key.
- Select the values one by one (separated by spaces) and replace them with the values copied from macOS. They are the same length, so replace them in pairs.
- For Linux
- Follow the same Linux file editing steps.
- For Windows
- Note: You no longer need to reverse the key. If macOS gives
98-54-2f-...
, write98 54 2f...
in the Windows registry.
Once the keys are added, the device should automatically connect across all systems.
Additional Notes
- Some Linux distributions may store keys in slightly different paths. If the steps don’t work, check
bluetoothctl info <MAC_ADDRESS>
. - If you still have issues, try removing and re-pairing the device after transferring the key.
- If you use a USB Bluetooth dongle, the MAC address may change depending on the USB port used.
With these steps, your Bluetooth devices will be synced across all your operating systems.