How to Sync Bluetooth in Dual Boot, Multi Boot (Windows, Linux, macOS)
Guide to syncing Bluetooth devices in multi-boot environments, preventing connection issues when switching operating systems.
- Tutorials
- Windows
- Linux
- macOS
- Dual Boot
- Multiboot
- Hackintosh
Introduction
If you use dual boot or multi boot, you may have noticed that when you switch operating systems, your Bluetooth devices do not connect automatically.
This is really annoying, especially if you have a Bluetooth keyboard and mouse and need to connect them manually every time you switch operating systems.
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 you switch operating systems, the device cannot authenticate correctly.
What is the solution?
It is as simple as having the same synchronization keys on all your operating systems. To do this, you need to copy the Bluetooth synchronization keys from one operating system to another.
Sync Bluetooth in dual boot (Windows and Linux)
Connect devices in Linux
- Open the terminal and run
bluetoothctl:
bluetoothctl- Enable pairing mode:
pairable on discoverable on- Scan and pair the device:
scan onCopy the device MAC address and use:
connect XX:XX:XX:XX:XX:XX- Verify the connection and exit
bluetoothctl:
exitConnect devices in Windows
- Connect your Bluetooth devices in Windows. Follow the usual steps from the Windows Bluetooth settings.
- Verify that the device was connected successfully.
Copy Bluetooth keys from Windows to Linux
- Download PsTools and extract
PsExecinto a quickly accessible folder, for example:C:\Windows. - Find your MAC address.
Open
cmdand run:
getmac /V /FO LISTLook for the MAC address of your Bluetooth device and write it down.
- Run
cmdas administrator, navigate to the folder where you savedPsExec, and run:
psexec -s -i regeditThis will open the Registry Editor with administrator permissions.
- In the Registry Editor, navigate to:
" HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\Keys\<MAC_ADDRESS>- Find your device key and double-click its name. A new window will open.
- In the new window, copy the key value found under
Value data. - Reboot into Linux.
- In Linux
- Open the terminal and run:
sudo suEnter your administrator password.
- Navigate to the Bluetooth folder:
cd /var/lib/bluetooth/<MAC_ADDRESS>/<DEVICE_MAC>Replace <MAC_ADDRESS> with the MAC address of your internal Bluetooth adapter and <DEVICE_MAC> with the MAC address of your external device.
-
Edit the
infofileLocate the
[LinkKey]line and replace the value of theKeyproperty with the key copied from Windows:
title="info" {2} [LinkKey] Key=B3798087E81E306CDAB046...Restart Linux and the device should connect automatically.
Sync Bluetooth in multi boot (macOS, Windows, and Linux)
NOTE: The steps are the same if you only have dual boot with macOS.
Pair Bluetooth devices on each system
- Pair first on Linux. You can follow steps 1 through 4 from the first section.
- Pair on Windows.
- Finally, pair on macOS.
Extract and transfer the LinkKey
-
On macOS, open Spotlight and search for
Keychain Access. -
Search for
bluetoothin the search bar and double-click the latestMobileBluetoothresult. -
In that new window, you will see your device MAC address in the Account field (
xx:xx:xx:xx:xx:xx). Write it down. -
Then, in the same window, check the Show password box and enter your credentials. You will be asked for them twice.
-
The revealed password is actually a full XML file. Click inside the field, press Option + a or Ctrl + a, then copy it and paste it somewhere else.
Make sure to copy the entire content and save it in your notes.
-
Under
<key>LinkKey</key>, copy the value between the<string>xx-xx-xx-xx</string>tags to your notes.
NOTE: If you have multiple devices connected, do the same for each one.
- Reboot into Windows.
- Transfer the
LinkKeyto Windows and Linux, or to all operating systems other than macOS:
-
For Windows
- Follow steps 3 through 4 from the previous section.
- Identify your device MAC address and double-click it.
- A new window will open with your device key.
- Select the values separated by spaces one by one and replace them with the values you copied from macOS. They have the same length, so replace them pair by pair.
-
For Linux
- Follow the same file-editing steps in Linux.
Once the keys are added, the device should connect automatically on all systems.
Additional Notes
- Some Linux distributions may store the keys in slightly different paths. If the steps do not work, check
bluetoothctl info <MAC_ADDRESS>. - If you still have problems, try removing and pairing the device again after transferring the key.
- If you use a USB Bluetooth dongle, the MAC address may change depending on the USB port where you connect it.
With these steps, your Bluetooth devices will be synchronized across all your operating systems.