Bluetooth pairing on dual boot Windows & Linux

March 3rd, 2024

I run both Windows and Linux on my desktop and sharing Bluetooth devices between them is really annoying. Every time I switch operating system I have to re-pair devices I want to use.

Why does this happen? When pairing a Bluetooth device, a unique set of pairing keys are generated and exchanged between the device and computer. Since dual-boot setups use the same hardware, each operating system generates unique keys for the same MAC address and thus overwrites the previously stored key on the Bluetooth device.

This guide documents how to copy the pairing keys from Windows and use them in Linux. For me that’s Pop!_OS , but this should work on any Debian-based OS.

Pairing Devices

First, pair your devices with Linux. This will generate the necessary records of the devices which we will update with the Windows keys.

Then switch to Windows and re-pair your devices. Now you’re ready to copy the pairing keys from Windows to Linux.

Extracing the keys from Windows

  1. Download and extract Microsoft’s PsTools
  2. Open a Command Prompt as Administrator
  3. Launch the Registry Editor with psexec64 -is regedit
  4. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\Keys
  5. Each Bluetooth controller will be listed, containing entries for each pair bluetooth device listed by MAC address, with the pairing key stored as the ‘data’
  6. Export this key or copy down the value - this is the value we need in Linux

Adding the keys to Linux

  1. Start a root shell with sudo -s
  2. Navigate to your Bluetooth controller directory: cd /var/lib/bluetooth/00:00:00:00:00:00/
  3. List devices with ls
  4. Edit the file corresponding to your device, e.g. vim AA:AA:AA:AA:AA:AA/info, and update the pairing key with the value exported from Windows
  5. Restart the Bluetooth service with systemctl restart bluetooth

Now you can seamlessly share Bluetooth devices between Windows and Linux in your dual-boot setup.