Fast Linux software KVM with clipboard sharing.

How it works

Nikau accesses devices through Linux uinput APIs. Events are sent over UDP using the low-latency QUIC protocol. Any Linux machine should work, including Wayland, X11, and even Linux consoles. Keyboards, mice, and touchpads are all tested and supported, other device types should work as-is. OSX and Windows are not currently supported.

Nikau is packaged as a single standalone executable containing server and client modes. The server is where the input devices are plugged in. Clients running on other machines then connect to the server and wait to receive input events.

Diagram of two Nikau clients with Virtual Outputs connecting to a Nikau Server with Input Devices

The Nikau server has configurable keyboard shortcuts for switching among connected clients. The defaults are LeftAlt+N to go to the next machine and LeftAlt+P to go to the previous machine. Another option is to send SIGUSR1 and SIGUSR2 unix signals to the Nikau server process.

When a client has been selected to receive input, the Nikau server collects input device events from the host and sends them over the network to the selected client. That client then emits the received input events to the host.

Diagram of an input event being grabbed by the Server and sent to the Active Client to be written to the Virtual Outputs

When Nikau is started from within a WM, clipboard contents can be automatically transferred between machines over the network. This transfer happens automatically in the background when the user creates a clipboard entry on one machine, switches to another machine, and then pastes to that machine. Server-to-client, client-to-server, and client-to-client transfers are all supported. Any content is supported, up to a configurable 5MB size limit.

Diagram of clipboard data being transferred from a copy on a previously active machine to the clipboard on the currently active machine

Getting started

  1. Decide which machine will run the server. The server will have attached input devices to be shared with the client(s). The server will listen for incoming client connections at UDP port 1213 by default.
  2. Install Nikau to each machine:
  3. Run the nikau binary on each machine:

New connections need to be approved on both the server and the client. On each side of the connection, check that the displayed fingerprint matches what's printed on the other side. This manual approval is only required the first time a new connection is being made. Approved peer certificates are written to ~/.config/nikau/known_certs/<fingerprint>.pem and can be revoked by deleting them.

Once the connection has been made, the client is added to the server's rotation. Keyboard shortcuts and signals are used to switch among the server and one or more clients.

Keyboard shortcuts are configurable via commandline arguments on the Nikau server. For a full list of supported key names, see the list of KEY_* entries here. For example leftshift,rightctrl,x would be mapped to the KEY_LEFTSHIFT, KEY_RIGHTCTRL, and KEY_X keys on that list.

Status

I'm regularly using Nikau across a variety of machines and devices, making fixes and improvements as needed. As such it should "just work". Feel free to email me if you encounter problems.

Keyboards, mice, and touchpads should all be supported and are used regularly. Other input devices like joysticks, gamepads, tablets, etc should also work, but I haven't tried them yet. To maximize device compatibility, Nikau passes device events largely as-is, so most devices should Just Work.

The client/server protocol may change between releases. The server should automatically detect and refuse clients with incompatible versions. If you see version errors upon connection, check that the versions line up using nikau --version. Compare this to the latest stable release. Upgrade by running cargo install nikau again.

Known shortcomings:

Security

This software has NOT undergone any security review or audit. Use is at your own risk. See also terms and conditions of the licence.

Nikau's purpose is to collect keystrokes and clipboards and send them over the network between machines. This can include passwords and other sensitive information. You must decide whether this is an acceptable risk for you.

Assuming no flagrant bugs in Nikau or its dependencies, all communication is TLS-encrypted, with certificate-based authentication following a "prompt-once" model similar to OpenSSH. New connections must be approved bidirectionally, on both the client and the server, before the connection can proceed. However, even with encrypted channels, timing information could still be inferred from the event stream.

In order to allow direct access to uinput devices, the client and server must both be run as root (e.g. via sudo).

Other options

There are a few other packages for this sort of thing. Here's how Nikau compares, in my highly biased opinion:

License

This project is licensed under the AGPLv3 (or later versions) and is copyright Nicholas Parker.