Find a file
2020-11-10 17:23:09 +01:00
certificate-gen Use optional OPENSSL environmental variable 2020-10-29 17:59:51 +01:00
client Enable input device hotplugging and unplugging 2020-11-08 20:34:45 +01:00
example Add systemd service files 2020-10-31 17:18:12 +01:00
input Use inotify from crates.io 2020-11-10 17:23:09 +01:00
net Implement message timeouts 2020-10-30 18:01:04 +01:00
server Enable input device hotplugging and unplugging 2020-11-08 20:34:45 +01:00
.gitignore Initial commit 2020-09-16 18:04:18 +02:00
Cargo.lock Enable input device hotplugging and unplugging 2020-11-08 20:34:45 +01:00
Cargo.toml Add certificate generation tool, make identity passwords optional 2020-10-29 17:44:08 +01:00
LICENSE Add license 2020-10-29 22:21:09 +01:00
README.md Fix README 2020-11-09 19:26:54 +01:00

rkvm

rkvm is a tool for sharing keyboard and mouse across multiple Linux computers. It is based on a client/server architecture, where server is the machine controlling mouse and keyboard and relays events (mouse move, key presses, ...) to clients.

Switching between different clients is done by a configurable keyboard shortcut.

Features

  • TLS encrypted by default, backed by OpenSSL
  • Display server agnostic
  • Low overhead

Requirements

  • The uinput Linux kernel module, enabled by default in most distros
  • libevdev
  • Rust 1.48 and higher

Building

Run cargo build --release. Note that you need to have libevdev installed on your system, otherwise the build will fail.

Generating certificates

The repo contains a simple Rust program, certificate-gen, to aid certificate generation. Run cargo run certificate-gen -- --help to see and usage.

Setting up

First, build the project and generate certificates. Client accepts certificates both in PEM and DER formats. You either need to run either of the programs as root or make /dev/uinput accessible by the user it runs as.

By default, the programs reads their config files from /etc/rkvm/{server,client}.toml, this can be changed by passing the path as the first command line parameter.

The example directory contains example configurations and systemd service files.

Why rkvm and not Barrier/Synergy?

The author of this program had a lot of problems with said programs, namely his keyboard layout (Czech) not being supported properly, which stems from the fact that the programs send characters which it then attempts to translate back into keycodes. rkvm takes a different approach to solving this problem and doesn't assume anything about your keyboard layout -- it sends raw keycodes only.

Additionally, rkvm doesn't even know or care about X, Wayland or any display server that might be in use, because it uses the uinput API with libevdev to read and generate input events.

Regardless, if you want a working and stable solution for crossplatform keyboard and mouse sharing, you should probably use either of the above mentioned programs for the time being.

Limitations

  • Only keyboard and relative mouse events work (that is, can be forwarded to clients)
  • No Windows or macOS support

Project structure

  • server - server application code
  • client - client application code
  • input - handles reading from and writing to input devices
  • net - network protocol encoding and decoding
  • certificate-gen - certificate generation tool

Bincode is used for encoding of messages on the network and Tokio as an asynchronous runtime.

Contributions

All contributions, that includes both PRs and issues, are very welcome.

License

MIT