Friday, February 25, 2011

A neat trick I found on the Ubuntu forums for dealing with dual booting and keeping a bluetooth devices paired

from http://newyork.ubuntuforums.org/showthread.php?t=224673&page=11....


Re: HOWTO: Apple Wireless Keyboard (Bluetooth)
@Webnickko: I solved the problem with dual booting with blue tooth and not having to pair the device every time i switch operating systems.

What you need to do is pair the device in windows and then look at the hex key for the pair in the windows registry and then copy that hex key to your /var/lib/bluetooth/linkkeys

this thread saved me ( http://ubuntuforums.org/showthread.php?t=1479056 ) but i'll walk you through exactly as i did.

First pair the device in Ubuntu and then open the following file:

Quote:
sudo gedit /var/lib/bluetooth/00:00:00:00:00:00/linkkeys
***NOTE*** 00:00:00:00:00:00 is the address of your bluetooth pc/dongle (receiver) not your keyboard. Use your file browser and look into the /var/lib/bluetooth/ directory. There is probably only one folder which is the address of your bluetooth pc/dongle

Notice that within the linkkeys file it shows something like this:

11:11:11:11:11:11 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 6 6

****NOTE**** 11:11:11:11:11:11 is the address of your bluetooth device and xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx is the 16 bit hex key that you are going to get from your windows registry and copy in its place. If you have more than one line in this file then you have more than one bluetooth device with a pairing key. You will have to figure out which is which. Blueman easily tells you which device is which.

Ok i just wanted to familiarize you with what we will be doing in ubuntu and since i'm not sure if that linkkeys file would be created without an initial pairing I had us start there.

Now for the real work!

Boot into windows and Pair the device again and make sure it is working. Now reboot windows **was an important step for me**

NOW WE NEED TO RUN REGEDIT UNDER THE SYSTEM ACCOUNT so nothing is hidden from us

to do this download this tool from here: http://technet.microsoft.com/en-us/s.../bb897553.aspx

unzip that file into a directory of your choice and run cmd.exe and change into the directory

type:

Quote:
psexec -s -i regedit.exe


You will then run regedit as SYSTEM, and be able to find the link key entry from windows.

now go to:
Quote:
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\services\B THPORT\Parameters\Keys\
There will be one more subfolder whose name i think is system specific. In that subfolder will be the hex key for your device. The name of the hex key will be the address of your keyboard ( 11:11:11:11:11:11 ) and the value of the hex key will be 16 pairs of numbers looking like this:
xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx

This is the 16 bit Hex key. It doesn't let you copy and paste from here so export this specific registry file somewhere on your computer and then open up that exported file and copy and paste it into a text file and then remove all the the spaces so that it looks like:

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Now go into ubuntu

Quote:
sudo gedit /var/lib/bluetooth/00:00:00:00:00:00/linkkeys

and replace the old hex key with the one you copied from windows registry into a text file and leave the rest the same. REMEMBER YOU NEED TO HAVE REMOVED THOSE SPACES in the hex key

11:11:11:11:11:11 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 6 6


All i had to do after that was unplug and reinsert by bluetooth dongle

CHEERS!!! and thanks to mbehensky and harbulot for solving this in the original post located here: http://ubuntuforums.org/showthread.php?t=1479056


***on a side note my eject key on the keyboard still doesn't do anything, haven't figured that one out yet***
Last edited by HeinekenPissr; October 7th, 2010 at 07:18 PM.