Skip to content

sermuns/dualboot-bt-link-keys

Repository files navigation

dualboot-bt-link-keys

demo

Self-contained tool to copy Bluetooth link keys from Windows partitions into your Linux environment.

This problem is explained in https://wiki.archlinux.org/title/Bluetooth#Dual_boot_pairing.

Why use this over X

The advantage of this tool over others is twofold:

  • it doesn't rely on chntpw1
  • it only needs a read-only mount of the Windows partition (which chntpw itself and projects using it listed below, need!)

Similar projects:

Installation

From source via

cargo install dualboot-bt-link-keys

or prebuilt binaries from

  1. GitHub releases

  2. cargo binstall dualboot-bt-link-keys

Usage

Important

We are going to copy the link keys from Windows to Linux!

First boot into Windows and pair the device(s) you want, then boot to Linux and follow the instructions below.

  1. Find the name of your Windows partition.

    For example:

    lsblk --list --output NAME,FSTYPE,SIZE | grep ntfs

    (If there are many NTFS partitions, maybe you want the one with the biggest size?)

  2. Mount the Windows partition in read-only mode:

    mount --mkdir -o ro /dev/<PARTITION NAME> <MOUNTPOINT>
  3. Run the program with superuser privileges:

    dualboot-bt-link-keys <MOUNTPOINT> --write --restart-bluetooth

Note

You can also omit the flags --write and --restart-bluetooth and run as normal user.

Just manually create/edit the file(s) at /var/lib/bluetooth/<ADAPTER ADDRESS>/<DEVICE ADDRESS>/info and add/edit the lines

[LinkKey]
Key=<LINK KEY>

Then restart bluetooth with

systemctl restart bluetooth
  1. Unmount the Windows partition:

    umount <MOUNTPOINT>
  2. You are done!

Disclaimer

This code is 100% certified human-slop. No artificial intelligence was used in the making of this.

brainmade


Footnotes

  1. https://pogostick.net/~pnh/ntpasswd/

About

Copy Bluetooth link keys from Windows to Linux

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors