多系统共用蓝牙设备

我的环境:
Ubuntu : Ubuntu 24.04 Desktop
Windows : Windows 11
要点是获取一个系统配对好的蓝牙设备的 MAC地址、LTK、IRK,再将这些信息写入其他系统的注册表。
首先在 Ubuntu 上配对蓝牙设备,再在 windows 上配对,使得两系统存储该蓝牙设备的信息(我们之后就只需要修改 Address,LTK,IRK),并且当前 Windows 可以使用该蓝牙设备。
Windows 配置
下载 https://learn.microsoft.com/zh-cn/sysinternals/downloads/psexec?ref=xavier.wang
下载好后,管理员权限打开 powershell,在该程序的目录通过此命令打开注册表
1 | .\\PsExec.exe -s -i regedit |
进入注册表
1 | HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\services\\BTHPORT\\Parameters\\Keys\\<电脑的MAC地址>/<蓝牙设备的MAC地址> |
记下其中的 LTK,IRK,蓝牙设备地址
Ubuntu 配置
在Ubuntu上:
其中蓝牙地址是与 Windows 上查到的蓝牙设备地址相近的地址(因为蓝牙设备每次重置后蓝牙设备地址都会变,一般是加一)
1 | cd /var/lib/bluetooth/<主机MAC地址>/<蓝牙设备地址> |
查看 inf 文件
1 | [General] |
注意修改其中的IdentityResolvingKey(IRK)、SlaveLongTermKey(STK)。
修改完成后将 <蓝牙设备地址>
重命名为 <windows 上的蓝牙设备地址>
后重启系统即可。
参考:
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
- Title: 多系统共用蓝牙设备
- Author: Neurocoda
- Created at : 2024-02-13 13:50:16
- Updated at : 2024-02-13 13:50:16
- Link: https://neurocoda.com/p/e68777e7.html
- License: This work is licensed under CC BY-ND 4.0.