Microsoft Modern Keyboard with Ubuntu

The new Microsoft Modern Keyboard is visually the same as the Surface Keyboard, including the bluetooth 4.0/4.1 connectivity, but it has a different pairing procedure, and lacks a pairing button. I was wondering if anyone has tried to get it working on Ubuntu?

Here is the high-level setup instructions from MSFT:

  • plug in USB to computer
  • turn on keyboard
  • click pop-up dialog installing needed windows drivers
  • paring should now be complete

Obviously, that 3rd step is a problem on a non-windows OS. I'm wondering if there is something I can do on ubuntu to initiate the pairing attempt.

I have tried this, and ubuntu doesn't seem to see a bluetooth device available when it's plugged in, or when it's charged and unplugged. When plugged in, it functions fine as a normal HID-compliant USB Keyboard, fwiw.


If you don't mind installing Windows on your computer there is a way of doing this.

As you said, the pairing happens over USB and it's only possible on Windows. What you can do is to pair the keyboard on Windows and transfer the pairing information to Linux. There's plenty of information out there on how to "dual-pair" or how to make Bluetooth devices work in "dual-boot" environments.

This worked for me: http://console.systems/2014/09/how-to-pair-low-energy-le-bluetooth.html on Ubuntu 18.04, the only different thing I had to do is to add an additional key not mentioned in that guide (but mentioned in the comments): IRK and set the enclave size to 16.

Here's how my info file looks like, for reference:

[General]
Name=BTLE Keyboard Fingerprint ID
Appearance=0x03c1
AddressType=static
SupportedTechnologies=LE;
Trusted=true
Blocked=false
Services=00001800-0000-1000-8000-00805f9b34fb;00001801-0000-1000-8000-00805f9b34fb;0000180a-0000-1000-8000-00805f9b34fb;0000180f-0000-1000-8000-00805f9b34fb;00001812-0000-1000-8000-00805f9b34fb;d4e3e3eb-a4ae-4193-bbf8-c769980abfe0;

[DeviceID]
Source=2
Vendor=1118
Product=2067
Version=274

[IdentityResolvingKey]
Key=40DA574571378A18D19EECB0B6814F2D

[LocalSignatureKey]
Key=9514799E99500FAACE427153D3345C63
Counter=0
Authenticated=false

[LongTermKey]
Key=467D87EB169591378DB06F3E14C43FFD
Authenticated=0
EncSize=16
EDiv=41809
Rand=8310545922518117455

[ConnectionParameters]
MinInterval=6
MaxInterval=6
Latency=60
Timeout=200

EDIT - Problem Solving: In case you don't have a CSRK key from the Registry Export, leaving it out works just fine. If you still have connection problems, run psexec -s -i regedit.exe, navigate to HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\BTHPORT\Parameters\Keys and take the decimal value displayed in regedit.exe.