Keep Bluetooth devices paired on macOS and Windows - profzei/Matebook-X-Pro-2018 GitHub Wiki
Real dual-booters (i.e. not using BootCamp) know that dual-pairing between macOS and Windows is a bit annoying, as pairing with two OSes will generate two different link keys. Things seems to be different for Big Sur and Monterey.
Real mac owners do not have to follow these methods, as BootCamp can synchronize Bluetooth link keys between macOS and Windows.
I copied here the two methods for personal backup.
- In Windows, pair your Bluetooth devices.
- Now reboot into macOS and pair your devices again there.
- Still in macOS, open hackintool, navigate to its
Utilitiestab, and click the Bluetooth icon for generating a Windows Bluetooth registry file: it'll make a file calledBluetooth.regon yourDesktop. Finally transfer the file to your Windows partition (for example using a USB drive...). - Boot back into Windows and turn off Bluetooth, get your
Bluetooth.regfile, install PSTools - Windows Sysinternals inWindows\system32folder (i.e. on Windows, install by dragging everything inside thePSTools.zipintoWindows\system32), and then openCMDprompt as admin. Now type in:
psexec -s -i regedit
and hit enter.
Note: We use PSTools and manually edit the registry because Windows won't let us edit these keys as just an admin, PSTools lets us edit as System!
- When
regeditopens, navigate to:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\Keys. - Now right click on
Bluetooth.regand click edit:Notepadwill open up. - In
Bluetooth.regfile look for the key addresses that match the ones inregeditunderKeys. Click on the matching key address and inside, look for matching names between theBluetooth.regand inregedittoo.
- For each matching name, right click on the name and modify in binary, delete everything, and type in the hex values from
Bluetooth.regin. (Some guides say to reverse the order of hex but hackintool has done that already, so enter it in as is). Press OK and do this for all matching names. - That's it! Turn your Bluetooth back on and your already paired devices should start working right away in both Windows and macOS!
If you have issues with BT4LE devices (due to how BT4LE devices are encrypted compared to BT classic devices, you will need other methods to manually transplant the keys for BT4LE devices), please, refer to https://github.com/digitalbirdo/BT-LinkkeySync/issues/12 (credit to u/Cubelia for pointing it out)
Note: For genuine Apple Magic Keyboard and Mouse there shouldn't be problems when extracting the keys.
- Pair the device with Windows.
- Reboot and pair the device with macOS.
- Open the
Keychain Accessapplication. - Type
bluetoothin the search field, then double-click on the latestMobileBluetoothentry. - At the bottom of the new window, tick
Show passwordand enter your credentials (twice). - The now revealed password is in fact a full
XMLfile. Click on the field, pressOption + Athen copy-paste it to a text editor. - Below
<key>LinkKey</key>, copy the value between the<string>xx-xx-xx-xx</string>tags to something outside macOS (for example using a USB drive...).
Note: No need to reverse the key anymore: if you get 98-54-2f-... in macOS, you write 98 54 2f ... in the Windows registry.
- Reboot to Windows.
- Run
regeditwith admin rights i.e. use PSTools - Windows Sysinternals and refer to step #4 in previous Big Sur guide. - Navigate to
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\Keys\BD_ADDR - Edit the key and replace the value with the one you got (as is).
- Enjoy!