I’ve recently started to use Apple Wireless (bluetooth) keyboard and it is really a very great keyboard (more info here). I felt like I can type faster and more accurate using this keyboard. The only downside of this keyboard is the lack of dedicated Delete key. To execute a Delete, I will need to press fn + delete key.
Other than that, the main problem of using Bluetooth keyboard and having dual boot Windows 7 and Ubuntu 14.04 is that I will need to re-pair the bluetooth keyboard everytime I switch from one OS to another. The reason behind this is that the device actually create a unique key (store in both the OS and the Keyboard) every time it pair with an OS, but when the OS is being switch to another one, the unique key doesn’t match because the stored unique key on the keyboard is meant for the previous OS.
To counter this issue, I found several useful article that describe the way around it, and I would like to summarize the step by step here:
- Boot to Ubuntu, delete all previously paired keyboard, and pair the keyboard with Ubuntu. Make sure that the keyboard successfully paired and usable.
- Reboot to Windows 7, delete all previously keyboard, and re-pair the keyboard with Windows. Also make sure that the keyboard is successfully paired.
- Download PsExec from here or you can get it from the link at the bottom of this article. Extract the PSTools to your Desktop.
- Open Command Prompt and run it as Administrator.
- Navigate to the PSTools that is extracted to the desktop previously. Use command cd C:\Users\xxxx\Desktop to navigate to the desktop (replace xxxx with your computer username). Use command cd PSTools to navigate to PSTools folder.
- Execute command psexec -s -i regedit and it should launch a Registry Editor. Take note that this Registry Editor launched using this method has different access level compare to Registry Editor launched from Start Menu.
- Under Registry Editor Browse to: Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\BTHPORT\Parameters\ . and copy the key shown under Value data field, in my case the key is: 73A4B449A2DE545C4861C6BD7FD1DE7A. Keep this key in a text file somewhere in your PC that is accessible by the Ubuntu later.
- Now reboot your PC and switch it to Ubuntu. You will notice that the bluetooth keyboard is not usable here due to the unmatched unique key.
- Open Terminal in Ubuntu, insert the command:
sudo nano /var/lib/bluetooth/xxxxxxxxx/linkkeys
to edit the unique key. Do take note that the xxxxxxxxx are suppose to be the bluetooth module address for your PC/laptop. Don’t worry if you don’t have this key, you can simply press tab after inserting the command …bluetooth/, and it should automatically complete it for you. Insert your password when it is asking and press Enter. (Take note that you must use sudo to edit the file. Without sudo, you won’t be able to access that file, and it will end up showing empty text file)
- It should show a line of text that is actually the keyboard device address and its unique paired key. If you compare it with with the key you get from your Windows, the keyboard device key should be identical. However the Unique key should be different because it is randomly generated on each pairing.
- Now you will need to copy the key saved from your Windows and paste it to this Ubuntu’s linkkeys file. Take note that you should not change the front portion, and the rear portion of the line.
- After editing, press Ctrl+X to exit and when it ask to Save modified buffer, insert Y and press Enter.
- Now you can reboot the Ubuntu, and after the reboot, the Keyboard should function automatically without the need of re-pairing. It should also work flawlessly under Windows.
- So, for any new pairing of the keyboard, you will need to repeat the listed steps again.
I hope the steps are clear enough for the readers to follow, and do leave comment if there is anything unclear about the topic.
Download PsExec v2.11: