多系统共用蓝牙设备

多系统共用蓝牙设备

Neurocoda

我的环境:

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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
[General]
Name=ERGO M575
Appearance=0x03c2
AddressType=static
SupportedTechnologies=LE;
Trusted=true
Blocked=false
Services=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=313498DE3D05749C6B20D393BEF36FB1
Authenticated=2
EncSize=16
EDiv=0
Rand=0

[ConnectionParameters]
MinInterval=6
MaxInterval=9
Latency=44
Timeout=216

[DeviceID]
Source=2
Vendor=1133
Product=45095
Version=9

[ServiceChanged]
CCC_LE=2

注意修改其中的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.
Comments
On this page
多系统共用蓝牙设备