The Notebook Review forums were hosted by TechTarget, who shut down them down on January 31, 2022. This static read-only archive was pulled by NBR forum users between January 20 and January 31, 2022, in an effort to make sure that the valuable technical information that had been posted on the forums is preserved. For current discussions, many NBR forum users moved over to NotebookTalk.net after the shutdown.
Problems? See this thread at archive.org.

    Dual-Booting and Bluetooth

    Discussion in 'Linux Compatibility and Software' started by hummer010, Dec 2, 2013.

  1. hummer010

    hummer010 Notebook Enthusiast

    Reputations:
    216
    Messages:
    26
    Likes Received:
    11
    Trophy Points:
    6
    If you've ever tried to dual-boot windows and Linux, and use a Bluetooth keyboard or mouse, you may have found yourself having to re-pair the device a lot. And maybe you haven't. If you have had to re-pair a lot, I've found a possible solution.

    Both windows and Linux automatically calculate a 16-byte key when the device is linked. I'm not sure how the key is calculated, but it is usually different between windows and Linux, and this appears to be the root of the problem.

    Luckily, you can force Linux to use the same connection key as windows, and this solves the whole re-pair problem.

    I'm using Windows 8.1 and Arch Linux 64 bit on a Sager NP7330 laptop with an Intel AC7260 wifi/bluetooth card. The exact location of these files and keys may differ a bit in different distro's / windows versions.

    1. Pair the device in windows.
    2. Reboot to Linux, and pair the device.
    3. The windows registry key we are after is protected in windows, so the only way I found to read it was from linux. Using chntpw, you can read the windows registry. I copied the relevant registry to a different file to avoid corrupting the windows registry. The original path is C:\Windows\System32\config\SYSTEM.
      Code:
      chntpw -e SYSTEM
      
      > ls
      > cd ControlSet001\services\BTHPORT\Parameters\Keys
      > ls
      > cd aa1122334455
      > ls
      > hex dd1122334455
      :00000 XX XX XX XX XX XX XX XX .... other stuff
      
      Where aa1122334455 is the MAC address of the bluetooth adapter and dd1122334455 is the MAX address of the device (keyboard or mouse). The output of the hex (the XX XX XX XX XX XX XX XX) command is the 8-Byte connection key we are looking for.
    4. Copy that code into an editor, and remove the spaces
    5. /var/lib/bluetooth is where Linux stores the connection key. This where the distros can be a little different. In Arch, the key is stored in /var/lib/bluetooth/AA:11:22:33:44:55/DD:11:22:33:44:55/info. The info file looks like:
      Code:
      [LinkKey]
      Key=0xXXXXXXXXXXXXXXXX
      ... other stuff
    6. I made a backup of the info file before editing. Delete the Linux connection key, and paste the windows connection key in its place.
    7. Reboot. You may only have to logout, but I rebooted to windows to make sure it was still working in windows, and then back to Linux to check there.

    For me, I use Linux primarily, so my mouse usually worked in Linux. When I booted to windows, I always had to remove the mouse and re-pair it for it to work. After that, rebooting to Linux, the mouse wouldn't work, and I had to remove it and re-pair it. Now it just works in both.
     
  2. Primes

    Primes Notebook Deity

    Reputations:
    919
    Messages:
    1,736
    Likes Received:
    718
    Trophy Points:
    131
    Thanks, can't wait to try this. I use a bluetooth mouse and I'm always having to re-pair.
     
  3. I'm Poor

    I'm Poor Notebook Consultant

    Reputations:
    20
    Messages:
    135
    Likes Received:
    5
    Trophy Points:
    31
    Thanks this worked well. I'm using Windows 7 and Arch 64. I also had to set bluetooth to activate on boot (it's off by default). Instructions are in the Bluetooth arch wiki.
     
  4. Jobine

    Jobine Notebook Prophet

    Reputations:
    934
    Messages:
    6,582
    Likes Received:
    677
    Trophy Points:
    281
    FSM bless you. I can use my Razer Orochi under Linux again.
     
  5. Floww

    Floww Newbie

    Reputations:
    0
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    5
    It's exactly what a friend asks me, thanks for him.
     
  6. hummer010

    hummer010 Notebook Enthusiast

    Reputations:
    216
    Messages:
    26
    Likes Received:
    11
    Trophy Points:
    6
    I just reinstalled windows and Arch, and this worked out for me once again. I love having my mouse just plain work in both windows and Linux.