Win10 + Linux dual system share Bluetooth device

I will follow the article win10 + deepin dual system Bluetooth 4.0 mouse sharing tutorialDocument

My system: Windows 10 + Deepin (Linux)

My device: Bluetooth mouse (surface Arc)

I believe that many people will encounter a problem when using the dual system. Every time the system is switched, the connection of the mouse must be rematched, which is very annoying. After looking for a long time of tutorial, I finally solved this problem

  1. First, connect to the mouse or Bluetooth device correctly under Linux
  2. Under the windows system, also connect to the mouse or Bluetooth device
  3. Next, delete all devices in win10 system, leaving only one device to be shared, so that you can find the corresponding device MAC address
  4. Then go to Microsoft to download psexec tool
  5. After decompressing the file, open CMD with administrator’s permission and enter the psexec tool folder

  6. Execute the command psexec.exe -s -i regedit and it will open the registry
  7. Find the following address HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\BTHPORT\Parameters\Keys\ and record the LTK (long term key)
  8. Then, close windows and switch to Linux system
  9. Enter the /var file as an administrator premission
  10. After entering the user password, enter terminal from here, and enter cd lib/bluetooth to enter the Bluetooth device management interface (in essence, it is the path to /ver/lib/bluetooth‘ with the administrator’s permission)
  11. It is to modify the file /var/lib/bluetooth/XX:XX:XX:XX:XX:XX(computer Bluetooth address)/YY:YY:YY:YY:YY:YY(mouse Bluetooth address)/info file.
  12. Modify the value of key=XXXXXX of LongTermKey to the address of the device under win10
  13. After modification, save it. If you do not use VI or VIM to modify the file, you can directly use the text editor to modify it

  14. However, there is a very important problem. Your mouse address in Linux may be different from that in windows
  15. However, the Linux task manager does not support modifying the format of the file name XX:XX:XX:XX:XX, so you need to use the command line to modify the file name
    Use cd .. to go back to the previous level, and then modify the original Bluetooth address mv XX:XX:XX:XX:X1 XX:XX:XX:XX:XX:X2 to replace the name of X1 with X2. The effect is as follows
  16. It’s finished here. Restart the system or type service Bluetooth restart in the terminal, and then reconnect to the mouse under Linux!

Have a good time!