It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
So, I've dual-booted Windows and Linux off and on for years. It's been quite awhile since I last had Windows installed, but I've acquired a new laptop, and I'm not ready to kill the original Windows 10 install quite yet, so I'm back to dual-booting.

For me, and the particular bluetooth mouse I use, I've always had problems with the mouse. I always seemed to have to re-pair the mouse for each OS. Years (2013) ago I had found a solution, and I was sure I had posted it here already, but when I searched, the only thing I found was my over-complicated dual-boot post that in no way reflects my current setup.

Anyways, if you dual-boot, and you have problems with bluetooth devices and having to re-pair them, here's my solution:

Both windows and Linux automatically calculate a 16-byte key when the device is linked. I'm not sure how the key is calculated, but it is usually different between windows and Linux, and this appears to be the root of the problem.

Luckily, you can force Linux to use the same connection key as windows, and this solves the whole re-pair problem.

The exact location of these files and keys may differ a bit in different distro's / windows versions.

Step 1: Pair the device in windows.

Step 2: Reboot to Linux, and pair the device.

Step 3: The windows registry key we are after is protected in windows, so the only way I found to read it was from linux. Using chntpw, you can read the windows registry. I copied the relevant registry to a different file to avoid corrupting the windows registry. The original path is C:\Windows\System32\config\SYSTEM.

#>chntpw -e SYSTEM
> ls
> cd ControlSet001\services\BTHPORT\Parameters\Keys
> ls
> cd aa1122334455
> ls
> hex dd1122334455
:00000 XX XX XX XX XX XX XX XX .... other stuff
Where aa1122334455 is the MAC address of the bluetooth adapter and dd1122334455 is the MAX address of the device (keyboard or mouse). The output of the hex (the XX XX XX XX XX XX XX XX) command is the 8-Byte connection key we are looking for.

Step 4:Copy that code into an editor, and remove the spaces

Step 5:/var/lib/bluetooth is where Linux stores the connection key. This where the distros can be a little different. In Arch, the key is stored in /var/lib/bluetooth/AA:11:22:33:44:55/DD:11:22:33:44:55/info. The info file looks like:
[LinkKey]
Key=0xXXXXXXXXXXXXXXXX
... other stuff

I made a backup of the info file before editing. Delete the Linux connection key, and put the windows connection key in its place.

Step &:Reboot. You may only have to logout, but I rebooted to windows to make sure it was still working in windows, and then back to Linux to check there.

For me, I use Linux primarily, so my mouse usually worked in Linux. When I booted to windows, I always had to remove the mouse and re-pair it for it to work. After that, rebooting to Linux, the mouse wouldn't work, and I had to remove it and re-pair it. Now it just works in both.
Post edited May 24, 2018 by hummer010
Thank you for posting this hummer010!
I'm not using a bluetooth mouse but might be useful for my dualshock 4 controller issues : )
I thought this would be about Linux. I just took my dual-boot off and now exclusively Linux. Latest version of Mint to be exact. I'd love to use my bluetooth headphones but so far trying everything have been unable to do so. So I bought a receiver, thinking it would do the trick and upon reading the instruction manual, learned that I need a transmitter, as bluetooth headphones are receivers and things like phones and computers are transmitters by default. So I learned two new things today.

Thank you for the guide, hummer010.
Post edited May 25, 2018 by vidsgame