{"id":50695596,"url":"https://github.com/sahilshahane/fix-bluetooth-dual-boot","last_synced_at":"2026-06-09T06:06:59.016Z","repository":{"id":350419387,"uuid":"1206745000","full_name":"sahilshahane/fix-bluetooth-dual-boot","owner":"sahilshahane","description":"inspired by https://unix.stackexchange.com/questions/255509/bluetooth-pairing-on-dual-boot-of-windows-linux-mint-ubuntu-stop-having-to-p","archived":false,"fork":false,"pushed_at":"2026-04-10T08:19:17.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-10T10:23:15.886Z","etag":null,"topics":["bluetooth","chntpw","dualboot","fix","issues","pairing"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sahilshahane.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-10T08:03:16.000Z","updated_at":"2026-04-10T09:05:02.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sahilshahane/fix-bluetooth-dual-boot","commit_stats":null,"previous_names":["sahilshahane/fix-bluetooth-dual-boot"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/sahilshahane/fix-bluetooth-dual-boot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sahilshahane%2Ffix-bluetooth-dual-boot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sahilshahane%2Ffix-bluetooth-dual-boot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sahilshahane%2Ffix-bluetooth-dual-boot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sahilshahane%2Ffix-bluetooth-dual-boot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sahilshahane","download_url":"https://codeload.github.com/sahilshahane/fix-bluetooth-dual-boot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sahilshahane%2Ffix-bluetooth-dual-boot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34093815,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bluetooth","chntpw","dualboot","fix","issues","pairing"],"created_at":"2026-06-09T06:06:58.088Z","updated_at":"2026-06-09T06:06:59.008Z","avatar_url":"https://github.com/sahilshahane.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dual-Boot Bluetooth Fix with `chntpw`\n\nThese scripts help fix Bluetooth pairing issues in dual-boot setups by reading pairing keys from Windows and updating Linux BlueZ device info.\n\n## ⚠️ IMPORTANT WARNING (READ FIRST)\n\n\u003e **MAKE SURE THE BLUETOOTH DEVICE HAS BEEN PAIRED AT LEAST ONCE IN BOTH WINDOWS AND LINUX BEFORE RUNNING THESE SCRIPTS.**\n\u003e\n\u003e If the device is not already known on both sides, the required key/device entries may not exist and the fix will fail.\n\n\n## Files\n\n- `fix_bluetooth.sh`: Main script\n- `run_fix_for_paired_devices.sh`: Batch runner for paired/connected/all known devices\n\n## Batch run for multiple devices\n\nRun fix for paired Bluetooth devices (default):\n\n```bash\n./run_fix_for_paired_devices.sh --mount-dir /media/sahil/Acer\n```\n\nUse connected devices only:\n\n```bash\n./run_fix_for_paired_devices.sh --mount-dir /media/sahil/Acer --connected-only\n```\n\nRun fix for all known devices in BlueZ:\n\n```bash\n./run_fix_for_paired_devices.sh --mount-dir /media/sahil/Acer --all-known\n```\n\nPass-through toggles:\n\n```bash\n./run_fix_for_paired_devices.sh --mount-dir /media/sahil/Acer --no-write-bluez-info\n./run_fix_for_paired_devices.sh --mount-dir /media/sahil/Acer --no-restart-bluetooth\n./run_fix_for_paired_devices.sh --mount-dir /media/sahil/Acer --bluez-dir /var/lib/bluetooth\n```\n\n## Quick start\n\n```bash\ncd /home/sahil/Desktop/re-link-bluetooth\nchmod +x ./fix_bluetooth.sh\n./fix_bluetooth.sh --mount-dir /mnt/c\n```\n\nNon-interactive mode (no manual `chntpw` typing):\n\n```bash\n./fix_bluetooth.sh \\\n\t--mount-dir /mnt/c \\\n\t--device-mac 001f20eb4c9a\n```\n\nNon-interactive mode with explicit adapter key:\n\n```bash\n./fix_bluetooth.sh \\\n\t--mount-dir /mnt/c \\\n\t--adapter-mac aa1122334455 \\\n\t--device-mac 001f20eb4c9a\n```\n\nNon-interactive mode (default: extract + write `info` + restart bluetooth):\n\n```bash\n./fix_bluetooth.sh \\\n\t--mount-dir /media/sahil/Acer \\\n\t--device-mac 84:0F:2A:D3:A5:31\n```\n\nInteractive mode (manual `chntpw` shell):\n\n```bash\n./fix_bluetooth.sh --mount-dir /mnt/c --interactive\n```\n\nThe script will:\n\n1. Install `chntpw` (unless `--skip-install` is used)\n2. Use your already-mounted Windows directory\n3. Run `chntpw` commands automatically by default (requires `--device-mac`)\n4. Auto-search all adapter keys when `--adapter-mac` is omitted\n5. Write key into BlueZ `info` by default\n6. Restart Bluetooth service by default\n7. Open interactive mode only when `--interactive` is provided\n\n## Common options\n\n```bash\n./fix_bluetooth.sh --mount-dir /mnt/c --interactive\n./fix_bluetooth.sh --mount-dir /mnt/windows --interactive\n./fix_bluetooth.sh --mount-dir /mnt/c --device-mac 001f20eb4c9a\n./fix_bluetooth.sh --mount-dir /mnt/c --adapter-mac aa1122334455 --device-mac 001f20eb4c9a\n./fix_bluetooth.sh --mount-dir /mnt/c --device-mac 84:0F:2A:D3:A5:31 --no-write-bluez-info\n./fix_bluetooth.sh --mount-dir /mnt/c --device-mac 84:0F:2A:D3:A5:31 --no-restart-bluetooth\n./fix_bluetooth.sh --mount-dir /mnt/c --device-mac 84:0F:2A:D3:A5:31 --bluez-dir /var/lib/bluetooth\n./fix_bluetooth.sh --mount-dir /mnt/c --interactive --skip-install\n```\n\n## Notes\n\n- MAC inputs like `84:0F:2A:D3:A5:31` are accepted; the script strips `:` and lowercases automatically.\n- By default, the script updates `Key=` in `[LinkKey]` inside `/var/lib/bluetooth/\u003cADAPTER\u003e/\u003cDEVICE\u003e/info`.\n- During write, it searches `/var/lib/bluetooth` for `*/\u003cDEVICE\u003e/info` and updates matching file(s), instead of relying only on adapter path.\n- Use `--no-write-bluez-info` to skip file updates.\n- By default, the script restarts the `bluetooth` service after updating the file.\n- Use `--no-restart-bluetooth` to skip service restart.\n- If mounting fails and Windows was hibernated, fully shut down Windows and disable Fast Startup, then try again.\n- If `ControlSet001` is missing in `chntpw`, use `CurrentControlSet`.\n- On some Windows 7 systems, path segment `services` may be lowercase.\n- If `chntpw` is missing, `fix_bluetooth.sh` attempts auto-install using your distro package manager (`apt`, `dnf`, `yum`, `pacman`, `zypper`, `apk`, `xbps`).\n\nTo locate the correct Windows partition and mount it yourself first, you can use:\n\n```bash\nsudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL\nsudo mkdir -p /mnt/c\nsudo mount -o rw /dev/\u003cNAME\u003e /mnt/c\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsahilshahane%2Ffix-bluetooth-dual-boot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsahilshahane%2Ffix-bluetooth-dual-boot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsahilshahane%2Ffix-bluetooth-dual-boot/lists"}