-
Pair and connect on Linux
-
Pair and connect on Windows
-
Shut down Bluetooth device
-
Boot to Linux
-
Mount Windows partition
-
Go to
<windows-mount>/Windows/System32/config
-
Run command
chntpw -e SYSTEM
- Install chntpw if it is not available
-
Go to the keys
ControlSet001\Services\BTHPORT\Parameters1\Keys\<computer-bluetooth-mac>\<device-bluetooth-mac>
- Rename the device's bluetooth mac in Linux
/var/lib/bluetooth
directory to the one found in the Windows registry. (Usually just one byte changes in the Mac when pairing is done)
- Rename the device's bluetooth mac in Linux
-
Replace values in Linux device's directory info file:
IRK
intoKey
inIdentityResolvingKey
CSRK
intoKey
inLocalSignatureKey
LTK
intoKey
inLongTermKey
ERand
intoRand
: Take the hex value ab cd ef, byte reverse it (ef cd ab) and convert it into decimal (e.g. using the Programming mode of the calculator application)EDIV
intoEDiv
: Just take the hex value and convert it normally or use the decimal value directly if it is displayed (chntpw displays it)
-
Restart bluetooth service
systemctl restart bluetooth
-
Power on bluetooth device
Connection should work now seamlessly in Linux and Windows
Thank tVienonen for this tutorial.
For BLE Logitech M240 mice, I just changed two things in Linux BT info file :
[IdentityResolvingKey]
Key=IRK Key
[PeripheralLongTermKey]
Key=LTK Key
Then power on the mice and restart bluetooth.
Notes : Keys are without spaces, CSRK was missing in register.
Regards.
(Windows 10 / Kubuntu 22.04 LTS)