How to use Apple bluetooth keyboard with multiple computers via a KVM

Standard

It’s easy to share traditional keyboards between multiple computers using a USB KVM. Obviously, with a bluetooth keyboard, things aren’t so simple.

I wanted to share my Apple bluetooth keyboard between my Mac mini and my desktop computer (running Ubuntu, but this would work with Windows).

First step was to get a USB bluetooth dongle and plug that into the KVM. Any USB dongle should do. When the KVM is switched to the Mac, the bluetooth dongle takes preference over the built-in Mac bluetooth receiver.

This works to share the keyboard, but the keyboard had to be disconnected and re-paired each time the KVM was switched — this is particularly problematic if you need to repair the keyboard at, for example, the login screen. It also requires you to enter a PIN code each time.

Fortunately this can be easily solved by sharing the generated link key between the two computers:

  1. Pair the keyboard in Ubuntu, then in OSX.
  2. In OSX, look at the bluetooth properties for your keyboard device to get the address.vThen open the terminal and type sudo defaults read /private/var/root/Library/Preferences/blued.plist. You will see something like the following:
    {
        LinkKeys =     {
            "00-aa-bb-cc-dd-ee" =         {
                "00-00-00-aa-aa-aa" = <81a83517 cc3c7afc fb8e99fc 5147fbf4>;
            };
        };
    }
    

    Here, the first code is the address of the bluetooth dongle. The second is the address of the keyboard, and the final, longer code is the link key.

  3. Convert the link key into a format suitable for Linux (or Windows), by reversing the endianness; simply reverse the order of the key, taking each pair of hexadecimal numbers as one value. So, the above key would be f4fb4751 fc998efb fc7a3ccc 1735a881. Easy…
  4. Use this link key in Linux or Windows. On Ubuntu the link key is at /var/lib/bluetooth/00:AA:BB:CC:DD:EE/linkkeys — the code is the address of the bluetooth dongle. Edit that file and replace the link key corresponding to the address of the bluetooth keyboard to the converted key, above.
  5. That’s it — restart Ubuntu, and the keyboard will work seamlessly as it is switched by the KVM.
  6. To change the link key in Windows, you need to edit the registry — I didn’t do this, but a search for “Windows bluetooth link key registry” should give the goods.

    Provided the keyboard doesn’t become unpaired, the setup should last indefinitely.

Ubuntu (Lucid) on Gigabyte x58a-ud3r

Standard

I just upgraded my main desktop PC, running Ubuntu 10.04 (“Lucid Lynx”). After an 8-year hiatus, I’m back on Intel, with a nice new Core i7 930 and a Gigabyte x58a-ud3r.

There’s not a great deal to write about compatibility, as everything “just worked” out of the box.

The upgrade went well — one of the great things about Linux is how well it takes to a complete brain transplant. No HAL trouble or “repair install” nonsense that you get on Windows.

Here are the things I had to do after the upgrade to get a 100% perfect system…

Continue reading

VMWare Player Vs. VirtualBox in Ubuntu: Decided in 1 minute

Standard

I’ve been using VirtualBox for a few years, and I like it. I thought I would try out the latest VMWare Player to compare and see how it has moved on since the last time I used it — from what I’ve heard, the seamless mode in Player is now very good.

However, it all came to naught — VMWare fail. Miserably. Why? Because I can’t download the thing.

VirtualBox provides nice direct download links, and — even better — an Ubuntu repository.

What about WMWare? They provide… this:

VMWare... What the hell?

VMWare... What the hell?

Problem solved — there’s no way I want to hand over this kind of data. Sure, I could just fill in nonsense data (and I started to)… but then what happens when I need an update, or even upgrade to a paid version? VMWare: What the hell are you thinking, asking for all this personal information? The bounce rate for your software must be hideous — what a great way to send people to your competitors.

If you’re here because you’re searching for a “direct link to VMWare Player” in Google: Sorry, try this, much better link, instead.