r/linux4noobs • • 22d ago

Dual boot: tired of re-pairing Bluetooth devices every time you switch between Ubuntu and Windows? I made a GUI tool for it (beta)

Each system generates its own pairing key, so a device paired in Windows stops working in Ubuntu and vice versa. The fix is copying the keys from one system to the other, which is fiddly by hand (registry, BlueZ files, LE keys in a different format).

DualPair does it from a normal window: install the .deb, click Scan, tick the devices, click Sync. It reads the Windows disk read-only and backs up every file it changes, with one-click undo. It also fixes the clock being wrong after switching, Windows Fast Startup, and the boot order, and there's an optional Windows app for syncing the other way and sharing Wi-Fi networks.

Free and open source (GPL-3.0): https://github.com/Diego230/dualPair

It's a beta tested on my own PC (Ubuntu 24.04 + Windows 11), written with heavy help from an AI coding assistant. Reports from other hardware are very welcome, whether it works or not.

7 Upvotes

7 comments sorted by

1

u/chuggerguy Linux Mint 22.3 Zena | MATÉ 22d ago

I no longer have Windows so can't test but a GUI tool might be helpful for new dual-booters with bluetooth devices.

I used to grab the key from the Windows registry and change the Linux key to match. That way I didn't have to re-pair every time I booted the other.

It worked but I admit, a tool like this might have been easier.

Have fun.

3

u/shrekisgreatt 21d ago

Thanks, that's exactly the manual fix DualPair automates. For classic devices like that mouse it's one key, as you did. The fiddly ones are Bluetooth LE devices (many newer mice, keyboards, earbuds): there are four values (LTK, EDIV, Rand, IRK), stored in different formats and byte orders in the registry and in BlueZ. That's where I kept making mistakes by hand, and the main reason I wrote it.

The other case is the reverse one: if you re-pair on Linux, the Windows key has to change instead. Linux never writes to the Windows disk in DualPair, so the optional Windows app imports it at the next boot after you confirm.

Thanks for your feedback tho, appreciate it. :)

1

u/Elegant-Falcon-1171 16d ago

Por qué asumes Ubuntu, hay muchas distros además de Ubuntu

1

u/shrekisgreatt 16d ago

Yeah that's true! Only the .deb package is Ubuntu/Debian-specific; the app itself just needs BlueZ, NetworkManager, GTK 4 and libadwaita, so it runs from source on other distros too (Fedora, Arch, openSUSE…). I said Ubuntu because it's what I use and test on. If there's interest I'll add packages for other distros (Flatpak won't work here because it needs root access to the Bluetooth files).

2

u/BeNiceToBirds 20d ago

This is a great idea. I don’t use Bluetooth, but I’d check it out if I did

1

u/[deleted] 20d ago

[removed] — view removed comment

1

u/shrekisgreatt 19d ago

Small correction first: the IRK itself doesn't rotate. The device's address does (resolvable private addresses), and the IRK is what lets the computer recognise those addresses. It's exchanged once at pairing, so copying it once is enough, as long as it's copied right.

And that's the weak spot, honestly. DualPair copies the IRK as Windows stores it, which works for most devices, but the Arch Wiki lists some (ThinkPad TrackPoint Keyboard II, Pebble M350, G604) that need the bytes reversed. I've only tested devices with static addresses so far, so for RPA devices this is untested and might pick the wrong order. Devices that get a new identity address on every pairing also show up as a new device rather than an update.

I'm looking at fixing the byte order properly: an advertising address can be checked against the IRK, so the tool can test both orders and keep the one that matches instead of guessing. If you have one of those devices and are willing to try, a report would help a lot.