This is a guide written on how to share the same Bluetooth device(s) across Windows and Linux without having to uniquely pair each.
Method 1: Extract Keys from Linux (Recommended)
This method uses hivexsh to read the Windows registry directly from Linux without needing to boot into Windows.
Prerequisites
Install hivex:
# Arch Linux
sudo pacman -S hivex
# Debian/Ubuntu
sudo apt install libhivex-bin
# Fedora
sudo dnf install hivex
Steps
-
Pair your Bluetooth device(s) with Linux first
-
Reboot into Windows, then re-pair the devices with Windows
-
Reboot back to Linux
-
Mount your Windows partition (if not already mounted):
sudo mount /dev/sdXN /mnt/windows -
Find your Bluetooth adapter MAC address and paired devices:
ls /var/lib/bluetooth/ # Example output: 24:EB:16:23:5B:94 ls /var/lib/bluetooth/24:EB:16:23:5B:94/ # Example output: EC:66:D1:B1:9A:33 (your device) -
Use
hivexshto extract the pairing key from the Windows registry:hivexsh /mnt/windows/Windows/System32/config/SYSTEM -
Navigate to the Bluetooth keys (MAC addresses are lowercase, no colons):
cd ControlSet001\Services\BTHPORT\Parameters\Keys ls cd 24eb16235b94 lsvalExample output:
"ec66d1b19a33"=hex(3):1d,68,ef,88,a8,fa,60,2e,a3,1c,69,2e,61,a4,36,4f -
Convert the key to Linux format (remove commas, uppercase):
1d,68,ef,88,a8,fa,60,2e,a3,1c,69,2e,61,a4,36,4f → 1D68EF88A8FA602EA31C692E61A4364F -
Update the Linux Bluetooth info file:
sudo nano /var/lib/bluetooth/24:EB:16:23:5B:94/EC:66:D1:B1:9A:33/infoReplace the
Key=value under[LinkKey]with the converted key. -
Restart the Bluetooth service:
sudo systemctl restart bluetooth
Method 2: Export Keys from Windows
This method requires exporting the registry keys while booted into Windows.
Steps
-
Pair your Bluetooth device(s) with Linux first
-
Reboot into Windows, then re-pair the devices with Windows
-
Run
regeditas Administrator -
Navigate to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\KeysIf you do not see any Keys under the tree then you need to open
regeditas a system-account user. One way to do this is using the PsExec by downloading it from Microsoft Sysinternals. Once it is downloaded, you will need to run a command-prompt as Administrator and navigate to the locationPsExecis unzipped and runPsExec.exe -s -i regedit. The Bluetooth keys should now be visible. -
Right-click on
Keysin the left-hand pane and selectExport. During the dialog changeSave as typetoText filesand that theExport rangeis set toSelected branch. Store this somewhere accessible by both Windows and Linux – if a shared drive is unavailable, use a USB drive or cloud-storage. -
Reboot to Linux
-
In a root (e.g.
sudo su) terminal navigate to/var/lib/bluetooththen to the MAC address of your host-system (there should only be a single sub-directory under/var/lib/bluetooth) -
Find the relevant Bluetooth device(s) by MAC address to share and enter the equally named MAC address directory of the client device.
-
Open the
infofile, with root privileges, in the text editor of your choice. -
In another tab/window, using either a text viewer or editor, open the previously exported Windows registry text file for the device
-
From the Windows file, copy the Bluetooth Key. Example:
00000000 31 c0 08 fa 4f 7b d2 4c - 6f e1 7d ba 32 29 a9 a7 1À.ïO{ÒLoá}ºQ)©§From the above copy
31 c0 .... a9 a7 -
Paste the key from the previous step into the
Key=portion of the Linux Bluetoothinfofile. Make sure to remove all spaces, hyphens, and change all characters to upper-case (all-caps). -
Save the
infofile with the changes to complete device sharing. Repeat for any other Bluetooth devices to share. -
Restart the Bluetooth service:
sudo systemctl restart bluetooth