Sharing Bluetooth Devices Across Operating Systems
My environment:
Ubuntu : Ubuntu 24.04 Desktop
Windows : Windows 11
The key point is to obtain the MAC address, LTK, and IRK of a Bluetooth device paired on one system, and then write this information into the registry of the other system.
First, pair the Bluetooth device on Ubuntu, then pair it on Windows, so that both systems store the device’s information (we only need to modify the Address, LTK, and IRK later), and ensure Windows can use the device.
Windows Configuration
Download https://learn.microsoft.com/en-us/sysinternals/downloads/psexec?ref=xavier.wang
After downloading, open PowerShell as administrator, and in the program’s directory, open the registry with this command:
.\\PsExec.exe -s -i regeditNavigate to the registry key:
HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\services\\BTHPORT\\Parameters\\Keys\\<Computer's MAC address>/<Bluetooth device's MAC address>Note down the LTK, IRK, and Bluetooth device address.
Ubuntu Configuration
On Ubuntu:
Note that the Bluetooth address is similar to the one found on Windows (because the device address changes after each reset, usually incremented by one):
cd /var/lib/bluetooth/<Host MAC address>/<Bluetooth device address>View the info file:
[General]Name=ERGO M575Appearance=0x03c2AddressType=staticSupportedTechnologies=LE;Trusted=trueBlocked=falseServices=00001800-0000-1000-8000-00805f9b34fb;00001801-0000-1000-8000-00805f9b34fb;0000180a-0000-1000-8000-00805f9b34fb;0000180f-0000-1000-8000-00805f9b34fb;00001812-0000-1000-8000-00805f9b34fb;00010000-0000-1000-8000-011f2000046d;
[IdentityResolvingKey]Key=8FC6396AB31C0E6AB68E37ED5BB7CC72
[SlaveLongTermKey]Key=313498DE3D05749C6B20D393BEF36FB1Authenticated=2EncSize=16EDiv=0Rand=0
[ConnectionParameters]MinInterval=6MaxInterval=9Latency=44Timeout=216
[DeviceID]Source=2Vendor=1133Product=45095Version=9
[ServiceChanged]CCC_LE=2Be sure to modify the IdentityResolvingKey (IRK) and SlaveLongTermKey (STK).
After modification, rename <Bluetooth device address> to <Windows Bluetooth device address> and then restart the system.
References:
https://www.insanelymac.com/forum/topic/268837-dual-boot-bluetooth-pairing-solved/page/2/
https://www.insanelymac.com/forum/topic/318483-keep-bluetooth-devices-paired-once-between-macwindows/page/2/
https://bbs.pcbeta.com/viewthread-1034129-1-1.html
https://github.com/digitalbirdo/BT-LinkkeySync/tree/master
https://ubuntuforums.org/showthread.php?t=1479056