Package: bt-dualboot
Sync Bluetooth for dualboot Linux and WindowsUser-friendly tool making your bluetooth devices working both in Windows and Linux without re-pairing chore.more about dualboot Bluetooth issuebt-dualbootdoesn't require to reboot 3 timesask you as much fewer details as possible...see all advantages and alternativesHow to installFor developers: checkout theDeveloper insightsfor useful development and testings tips.Usage: shortest wayAssuming you have paired devices in Windows already, boot to Linux and paired them too.
Syncing would be simple as following 2 steps:1. Mount Windows partitionApplication will probe and use mounted Windows partition automatically. Otherwise use--win /mnt/win/path/.
Partition should be mounted withwrite access.2. Sync all devices available for sync$sudobt-dualboot--sync-allSyncing...==========[C2:9E:1D:E2:3D:A5] Keyboard K380...doneNOTES:
(i)sudotip: this tool needs read-only access to bluetooth devices configuration files which is inaccessible for regular user.
(ii)--backup vs --no-backup: you will be asked about your Windows Registry backup strategy
(iii) use--dry-runto preview any command effectsUsage: choose device manuallyList devices info$sudobt-dualboot-lWorks both in Linux and Windows===============================[A4:BF:C6:D0:E5:FF] WH-1000XM4Needs sync==========Following devices available for sync with `--sync-all` or `--sync MAC` options.[C2:9E:1D:E2:3D:A5] Keyboard K380Have to be paired in Windows============================Following devices unavailable for sync unless you boot Windows and pair them[E9:1D:FE:2A:C3:C8] JBL GOSync devices using MAC$sudobt-dualboot--syncC2:9E:1D:E2:3D:A5Syncing...==========[C2:9E:1D:E2:3D:A5] Keyboard K380...doneSeebt-dualboot -hand chapters below for details.PrerequisitesPython 3.6+ installed.chntpwpackage installed:Ubuntu $ sudo apt install chntpw...seehttps://pogostick.net/~pnh/ntpasswd/Install$sudopipinstallbt-dualbootNOTES:sudo- application requires read-only access to bluetooth devices configuration files which is inaccessible for regular user. Native OS packages will be added in next releases.Supported OSTested with Linux Mint 19.3, 20.3 (Ubutntu 18.04 bionic, 20.04 focal), Windows 10Supported:Potentially any Linux-based systems keeping bluetooth configuration in similar format as UbuntuWindows 10+With next releases more OSes will be tested, Mac OS support will be added. If you get success or fail results for any OS not listed as supported, please share your experience athttps://github.com/x2es/bt-dualboot/issues/1.Advanced usage--backup vs --no-backupWindows Registry update performed in the safe way usingchntpw/regedwithout changing Hive-file's size (reged -N -E). Neverthelesschntpwis non-official tool hence backup is not bad idea. Application would perform it as you prefer.You have to choose your backup strategy explicitly.$sudobt-dualboot--sync-allusage: ....bt-dualboot: error: Neither backup option given!Windows Registry Hive file will be updated!chntpw/reged tool is non-official and hackish Hive file editing tool.It is recommended to do backup prior writing into Hive file.Use:-b [path], --backup [path]    [default: /var/backup/bt-dualboot]-n, --no-backup               process without backupWARNING:Windows Registry Hive file may contain sensitive data. You shouldn't keep this fileon a storage which may be accessed by others. Consider to remove backup files as soonas possible after ensure Windows boots and works correctly.--win /mnt/win/path/By default application will recognize and use mounted Windows partition. In case when it didn't found or more than single Windows partition exist you have to provide mount point with--winparamter.Use--list-win-mountsto list recognized Windows partitions.$bt-dualboot--lsit-win-mountsWindows locations:==================/media/user/win_foo/media/user/win_bar$sudobt-dualboot--win/media/user/win_foo-lTroubleshooting: Windows partition write accessIn case when Windows partition mounted in read-only mode, you have to remount it for read-write:$sudomount-oremount,rw/mnt/win/pathMachine processing--botflag enables better parsable output for usage in scripts.Dualboot Bluetooth issueEvery time when a Bluetooth device paired in one dualboot OS it stop working in another one. It happens because both OS uses the same Bluetooth adapter with the same MAC. Each pairing process generates new pairing keys for adapter's MAC. This way previous pairing key which saved in another OS becomes obsolete.The solution is to sync saved pairing keys for both OS. This answer describes ways to handle this manually:https://unix.stackexchange.com/a/255510/411221This application implements the way suggested by thecommentwhich copies pairng keys directly from Linux to Windows avoiding multiple reboots.Advantages and alternativesbt-dualboot:doesn't require to reboot multiple timessimple installprovides singlesimple cli, doesn't require invoke additional scriptsdiscower mounted Windows partition automaticallysafe update of Windows Registry without changing file size (rewrite only)backup Windows Registryprior updatedoesn't require import/export files, handle encoding issuesallows--dry-runprior actual changesalternativescheckout"bluetooth dualboot" on githubsolved by invoke single tool under Linux: sync keys from Linux into Windows registry:(similar approach to bt-dualboot)(anounced)https://github.com/nbrideau/bluetooth-key-syncsolved by invoke multiple tools under Windows and Linux: sync keys from Windows registry into Linux configs:(requires more steps and reboots, involves using windows tools, manage import/export files)Most soulutions is kind of import tool of Windows*.regfile into Linux bluetooth configuration.[UI]https://github.com/nagi1999a/BluetoothDualBootHelper[simple cli]https://github.com/ademlabs/synckeyshttps://github.com/Krakenus/bluetooth-dualboot-fixerhttps://github.com/LondonAppDev/dual-boot-bluetooth-pairhttps://github.com/heyzec/dual-boot-mousehttps://github.com/arunpandian7/DuoPair-Bluetoothhttps://github.com/luismaf/bluetooth-dual-boot[repeative arguments]https://github.com/aryklein/dualBootMouseMac OS:https://github.com/HenrySeed/macosDualBootingBluetoothKeyshttps://github.com/sarneeh/mac-win-dualboot-btCli reference$bt-dualboot-husage: bt-dualboot [-h] [-l] [--list-win-mounts] [--bot] [--dry-run] [--win MOUNT] [--sync MAC [MAC ...]] [--sync-all] [-n] [-b [path]]Sync bluetooth keys from Linux to Windows.optional arguments:-h, --help            show this help message and exitList resources:-l, --list            [root required] list bluetooth devices--list-win-mounts     list mounted Windows locations--bot                 parsable output for robots (supported: -l)Sync keys:--dry-run             print actions to do without invocation--win MOUNT           Windows mount point (advanced usage)--sync MAC [MAC ...]  [root required] sync specified device--sync-all            [root required] sync all paired devicesBackup Windows Registry:-n, --no-backup       process without backup-b [path], --backup [path]path to backup directory, default: /var/backup/bt-dualbootNext releasesFirst priority is to extend list of tested and supported OS.General roadmap assumes creating GUI and background service versions, adding sync Linux to Linux ability. It will be implemented on demand - give a voice athttps://github.com/x2es/bt-dualboot/issues/2