Sharing Bluetooth Devices Across Operating Systems
私の環境:
Ubuntu : Ubuntu 24.04 Desktop
Windows : Windows 11
要点は、あるシステムでペアリングしたBluetoothデバイスのMACアドレス、LTK、IRKを取得し、その情報を他のシステムのレジストリに書き込むことです。
まずUbuntuでBluetoothデバイスをペアリングし、次にWindowsでペアリングすることで、両方のシステムにそのBluetoothデバイスの情報を保存します(その後はAddress、LTK、IRKのみを変更する必要があります)。そして、現在のWindowsでそのBluetoothデバイスを使用できるようにします。
Windowsの設定
以下をダウンロード:https://learn.microsoft.com/zh-cn/sysinternals/downloads/psexec?ref=xavier.wang
ダウンロード後、管理者権限でPowerShellを開き、そのプログラムのディレクトリで以下のコマンドを実行してレジストリを開きます。
.\PsExec.exe -s -i regeditレジストリエディタで以下のパスに移動します。
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\BTHPORT\Parameters\Keys\<PCのMACアドレス>\<BluetoothデバイスのMACアドレス>その中のLTK、IRK、Bluetoothデバイスのアドレスをメモします。
Ubuntuの設定
Ubuntu上で:
Bluetoothデバイスのアドレスは、Windowsで確認したものに近いアドレスです(デバイスをリセットするたびにアドレスが変わり、通常は+1されます)。
cd /var/lib/bluetooth/<ホストMACアドレス>/<Bluetoothデバイスのアドレス>infoファイルを確認します。
[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=2IdentityResolvingKey(IRK)とSlaveLongTermKey(STK)を変更します。
変更後、<Bluetoothデバイスのアドレス> を <Windows上のBluetoothデバイスのアドレス> にリネームし、システムを再起動します。
参考:
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