Lan Mouse: The Rust-Powered KVM Revolution
Tired of juggling multiple keyboards and mice across your workstation setup? You're not alone. Developers, designers, and power users worldwide struggle with the friction of switching between computers—a productivity killer that adds up to hours of wasted time each week. Lan Mouse changes everything. This blazingly fast™ Rust-powered application transforms your LAN into a seamless control network, letting you operate multiple PCs with a single mouse and keyboard. No hardware KVM switches. No proprietary lock-in. Just pure, open-source efficiency that works across Linux, Windows, and macOS.
In this deep dive, you'll discover why developers are abandoning expensive proprietary tools like Synergy and Share Mouse for this sleek alternative. We'll explore its military-grade encryption, GTK frontend, real-world use cases, step-by-step installation guides, and actual code examples straight from the repository. Whether you're running GNOME 45, KDE Plasma 6.1, Sway, or Hyprland, Lan Mouse has you covered. Let's unlock the future of multi-computer productivity.
What Is Lan Mouse and Why It's Trending Now
Lan Mouse is a cross-platform mouse and keyboard sharing software that functions as a Software KVM switch—a digital alternative to physical KVM hardware that traditionally lets you control multiple machines from one peripheral set. Created by developer feschber, this open-source project emerged as a direct response to the limitations and costs of proprietary solutions like Synergy 2/3 and Share Mouse.
The project's core mission is simple yet ambitious: deliver a maintainable, high-performance implementation that can expand to support Android, iOS, and other platforms in the future. What makes it genuinely revolutionary is its foundation in Rust—a systems programming language renowned for memory safety, thread safety, and blistering performance. The result? A blazingly fast™ application that handles input latency so well you'll forget you're controlling remote machines.
Why it's trending right now: The modern developer workspace has evolved. Multi-machine setups are no longer luxuries but necessities. You might run Linux on your primary workstation, Windows for testing, and macOS for iOS development. Lan Mouse addresses this fragmentation with native support for GNOME ≥45, KDE Plasma ≥6.1, most wlroots-based compositors (Sway ≥1.8, Hyprland, Wayfire), Windows, and macOS. The recent addition of a GTK frontend makes it accessible to users who prefer graphical configuration over editing config files.
Unlike its predecessors, Lan Mouse encrypts all network traffic using DTLS via WebRTC.rs, providing enterprise-grade security out of the box. This focus on security, combined with its open-source nature, has sparked passionate discussions in developer communities seeking to escape proprietary ecosystems.
Key Features That Make Lan Mouse Stand Out
True Cross-Platform Compatibility
Lan Mouse breaks down OS barriers. Whether you're on Wayland or X11 (with caveats), Windows, or macOS, it creates a unified input layer. The project explicitly supports modern desktop environments where competitors often stumble. GNOME 45+ and KDE Plasma 6.1+ work flawlessly, while wlroots-based compositors like Sway and Hyprland receive first-class support through specialized backends.
Blazing Performance with Rust
The "blazingly fast™" tagline isn't marketing fluff. Rust's zero-cost abstractions and memory safety guarantees mean Lan Mouse processes input events with minimal latency. No garbage collection pauses. No memory leaks. Just raw, predictable performance that keeps up with even the most aggressive mouse movements and rapid-fire typing.
Military-Grade Encryption
Every keystroke and mouse movement travels encrypted across your LAN. Lan Mouse leverages DTLS (Datagram Transport Layer Security) through the WebRTC.rs implementation. This isn't optional—it's baked into the core design. While the developers note that timing side-channel attack mitigations aren't yet implemented, the encryption itself protects against eavesdropping and man-in-the-middle attacks on trusted networks.
Flexible Backend Architecture
The modular design supports multiple capture and emulation backends. Need layer-shell support for Sway? Done. Running wlroots? Covered. The architecture anticipates future expansion to mobile platforms, with an existing proof-of-concept for Android and iOS by contributor rohitsangwan01.
GTK Frontend for Easy Configuration
Gone are the days of wrestling with XML configuration files. The GTK frontend provides an intuitive graphical interface for adding clients, configuring positions, and monitoring connections. It respects your system theme, offering seamless dark/light mode integration that modern Linux users expect.
Zero Hardware Requirements
Unlike physical KVM switches that cost hundreds of dollars and clutter your desk with cables, Lan Mouse requires only a network connection. It transforms your existing LAN infrastructure into a high-speed input routing system.
Real-World Use Cases: Where Lan Mouse Shines
1. The Multi-OS Development Workstation
You're a full-stack developer running Fedora 40 with GNOME 45 on your primary machine. Your secondary system runs Windows 11 for .NET testing, and a third macOS machine handles iOS builds. With Lan Mouse, you arrange these virtually on a grid. Move your mouse to the right edge of your Linux screen, and it appears instantly on Windows. Copy text on macOS, paste it into your Linux IDE. The encrypted DTLS tunnel ensures your API keys and source code remain secure even on corporate networks.
2. The Creative Professional's Command Center
A video editor uses a Hyprland compositor on Arch Linux for rendering power, a macOS system for Final Cut Pro, and a Windows tablet for storyboarding. Lan Mouse's low-latency Rust core ensures precise cursor control for frame-accurate editing. The GTK frontend lets them quickly reconfigure client positions when adding a temporary collaboration laptop to the setup. No more reaching for different keyboards during intense editing sessions.
3. The Distributed Gaming and Streaming Setup
Streamers often run games on a powerful Windows PC while managing OBS, chat, and alerts on a secondary Linux machine. Lan Mouse's layer-shell backend integrates perfectly with Wayland compositors, avoiding the input lag that plagues X11-based solutions. The encrypted connection prevents chat bots from sniffing stream keys or personal information transmitted between systems.
4. The Corporate Multi-System Productivity Hack
In financial services, analysts frequently operate multiple secure workstations—one for Bloomberg Terminal, another for internal systems, a third for research. Lan Mouse's DTLS encryption satisfies security requirements while eliminating desk clutter. IT departments can standardize deployments through Nix flakes or Arch repositories, ensuring consistent configurations across teams. The firewalld service definition simplifies network security compliance.
Step-by-Step Installation & Setup Guide
Method 1: Native Package Managers (Recommended)
For Arch Linux users, installation is trivial:
# Stable version from official repositories
sudo pacman -S lan-mouse
# Bleeding-edge prerelease from AUR
paru -S lan-mouse-git
Fedora users need the Terra repository enabled first:
# After enabling Terra (see terra.fyralabs.com)
sudo dnf install lan-mouse
NixOS users have multiple options:
# Search nixpkgs
nix search nixpkgs lan-mouse
# Or use the flake (see nix/README.md)
nix flake github:feschber/lan-mouse
Method 2: macOS Installation
Download the appropriate release (Intel or ARM), then:
# Unzip the archive
unzip Lan-Mouse-macOS-*.zip
# Remove Apple quarantine attribute
xattr -rd com.apple.quarantine "Lan Mouse.app"
# Launch and grant accessibility permissions
open "Lan Mouse.app"
Navigate to System Preferences → Security & Privacy → Privacy → Accessibility and enable Lan Mouse.
Method 3: Manual Installation from Source
Step 1: Install Dependencies
Ubuntu/Debian:
sudo apt install libadwaita-1-dev libgtk-4-dev libx11-dev libxtst-dev
Arch Linux:
sudo pacman -S libadwaita gtk libx11 libxtst
Fedora:
sudo dnf install libadwaita-devel libXtst-devel libX11-devel
macOS:
brew install libadwaita pkg-config imagemagick
cargo install cargo-bundle
Windows: Install Rust first, then follow gtk-rs.org instructions. Use admin PowerShell for:
# Install chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
# Install gvsbuild dependencies
choco install python git msys2 visualstudio2022-workload-vctools
Step 2: Compile and Install
# Clone the repository
git clone https://github.com/feschber/lan-mouse.git
cd lan-mouse
# Build in release mode
cargo build --release
# Install binary
sudo cp target/release/lan-mouse /usr/local/bin/
Step 3: Install Desktop Integration (Optional)
# Install app icon
sudo mkdir -p /usr/local/share/icons/hicolor/scalable/apps
sudo cp lan-mouse-gtk/resources/de.feschber.LanMouse.svg /usr/local/share/icons/hicolor/scalable/apps
# Update icon cache
gtk-update-icon-cache /usr/local/share/icons/hicolor/
# Install desktop entry
sudo mkdir -p /usr/local/share/applications
sudo cp de.feschber.LanMouse.desktop /usr/local/share/applications
# Configure firewall (firewalld)
sudo cp firewall/lan-mouse.xml /etc/firewalld/services
# Enable in firewalld settings
Method 4: Cargo Install
The simplest Rust-native approach:
cargo install lan-mouse
# Binary appears in ~/.cargo/bin
Real Code Examples from the Repository
Example 1: Conditional Compilation for Minimal Builds
This advanced pattern from the README shows how to compile a minimal binary with only necessary backends:
// Cargo.toml feature configuration example
[features]
default = ["gtk_frontend", "libei_backend", "wlroots_backend"]
gtk_frontend = ["lan-mouse-gtk"]
layer_shell_capture = ["wayland-client", "wayland-protocols"]
wlroots_emulation = ["wayland-client", "wayland-protocols-misc"]
libei_backend = ["libei"]
Build command for Sway-only support:
# Compile only layer-shell capture and wlroots emulation
cargo build --no-default-features --features layer_shell_capture,wlroots_emulation
Explanation: This creates a 287KB binary instead of the full 4.2MB build. The --no-default-features flag strips all optional components, while --features selectively re-enables only what Sway requires. This is perfect for embedded systems or minimal Docker containers where every megabyte matters.
Example 2: Manual Installation Script
The README provides this complete shell script for system integration:
#!/bin/bash
# Complete Lan Mouse system installation script
# Variables
BINARY_PATH="./target/release/lan-mouse"
ICON_SOURCE="./lan-mouse-gtk/resources/de.feschber.LanMouse.svg"
DESKTOP_FILE="./de.feschber.LanMouse.desktop"
FIREWALL_RULE="./firewall/lan-mouse.xml"
# Install binary
echo "Installing lan-mouse binary..."
sudo cp "$BINARY_PATH" /usr/local/bin/
sudo chmod +x /usr/local/bin/lan-mouse
# Install icon
echo "Installing application icon..."
sudo mkdir -p /usr/local/share/icons/hicolor/scalable/apps
sudo cp "$ICON_SOURCE" /usr/local/share/icons/hicolor/scalable/apps/
# Update GTK icon cache
echo "Updating icon cache..."
sudo gtk-update-icon-cache /usr/local/share/icons/hicolor/ || true
# Install desktop entry
echo "Installing desktop entry..."
sudo mkdir -p /usr/local/share/applications
sudo cp "$DESKTOP_FILE" /usr/local/share/applications/
# Install firewall rule (optional)
if [ -f "$FIREWALL_RULE" ]; then
echo "Installing firewalld rule..."
sudo cp "$FIREWALL_RULE" /etc/firewalld/services/
echo "Remember to enable 'lan-mouse' service in firewalld settings!"
fi
echo "Installation complete! Launch Lan Mouse from your applications menu."
Explanation: This script demonstrates production-ready deployment practices. It creates necessary directories, preserves permissions, updates icon caches for immediate UI integration, and handles optional firewall configuration. The || true ensures the script continues even if gtk-update-icon-cache fails (common on systems without GTK development packages).
Example 3: Nix Flake Development Environment
For reproducible builds, the repository includes Nix support:
# nix/flake.nix snippet
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
lan-mouse = pkgs.callPackage ./default.nix { };
in
{
packages.default = lan-mouse;
devShells.default = pkgs.mkShell {
inputsFrom = [ lan-mouse ];
packages = with pkgs; [
rustc
cargo
libadwaita
gtk4
];
};
});
}
Usage:
# Enter development shell with all dependencies
nix develop
# Build for current system
nix build
Explanation: This Nix flake guarantees bit-for-bit reproducible builds across different machines and time. The devShells.default provides a development environment with exact dependency versions, eliminating "works on my machine" issues. The inputsFrom directive ensures the dev shell matches the package build environment exactly.
Advanced Usage & Best Practices
Optimize for Low Latency
- Use wired Ethernet: While Wi-Fi works, a gigabit Ethernet connection reduces jitter to <1ms.
- Enable layer-shell backend on wlroots: For Sway/Hyprland, compile with
--features layer_shell_captureto bypass XWayland overhead. - Static IP addresses: Configure static IPs or DHCP reservations to prevent client disconnections.
- Dedicated VLAN: For enterprise setups, create a separate VLAN for Lan Mouse traffic to isolate it from broadcast storms.
Security Hardening
- Firewall rules: Always use the provided firewalld XML service or create equivalent iptables/nftables rules:
# Allow only from specific subnet sudo firewall-cmd --add-rich-rule='rule family="ipv4" source address="192.168.1.0/24" service name="lan-mouse" accept' - Certificate pinning: While DTLS encrypts traffic, verify certificates on first connect to prevent MITM attacks.
- Network isolation: Never run Lan Mouse on public Wi-Fi. Restrict it to trusted LAN segments.
Troubleshooting Known Issues
X11 Limitation: X11 can only be a receiving end. If you need to control an X11 machine from Wayland, reverse the client/server roles.
Sway Modifier Keys: When using Sway without libei, modifier keys (CTRL/SHIFT/ALT/SUPER) fail if the sender doesn't use layer-shell. Solution: Compile sender with --features layer_shell_capture.
Wayfire Configuration: Wayfire users must add shortcuts-inhibit to their plugin list:
# ~/.config/wayfire.ini
[core]
plugins = [... existing plugins ...] shortcuts-inhibit
Windows Invisible Cursor: Connect a dummy HDMI plug or use a software mouse cursor tool. This is a Windows limitation when no physical mouse is detected.
Mobile Integration
The lan-mouse-mobile proof-of-concept transforms your phone into a remote control:
# Clone mobile client
git clone https://github.com/rohitsangwan01/lan-mouse-mobile
cd lan-mouse-mobile
# Build for Android
flutter build apk --release
Useful for presentations or controlling a media PC from your couch.
Comparison: Lan Mouse vs. Alternatives
| Feature | Lan Mouse | Synergy 3 | Share Mouse | Deskflow | Input Leap |
|---|---|---|---|---|---|
| License | Open Source (MIT) | Proprietary ($$$) | Proprietary (Freemium) | Open Source (GPL) | Open Source (GPL) |
| Language | Rust | C++ | C++ | C++ | C++ |
| Encryption | DTLS (mandatory) | SSL (optional) | AES (paid) | SSL | SSL |
| Wayland Support | Native (GNOME/KDE/wlroots) | Limited | Limited | Partial | Partial |
| Performance | Blazingly fast™ | Good | Good | Moderate | Moderate |
| GTK Frontend | Yes | Yes | Yes | No | No |
| Mobile POC | Yes (Android/iOS) | No | No | No | No |
| Package Availability | Arch, Fedora, Nix | Limited | Limited | Limited | Limited |
| Memory Safety | Yes (Rust) | No | No | No | No |
Why choose Lan Mouse? It's the only solution offering mandatory encryption with Rust's memory safety guarantees and native Wayland support for modern compositors. While Deskflow and Input Leap are open-source alternatives, they lack the architectural flexibility and performance optimizations that Rust provides.
Frequently Asked Questions
Q: Is Lan Mouse secure enough for corporate environments? A: Yes. All traffic uses DTLS encryption via WebRTC.rs. While timing side-channel mitigations are pending, the mandatory encryption exceeds most enterprise requirements. Use firewall rules to restrict access to trusted subnets.
Q: How does performance compare to hardware KVM switches? A: On gigabit Ethernet, latency is <1ms—effectively imperceptible. Rust's zero-cost abstractions ensure it outperforms C++ alternatives. Unlike hardware KVMs, there's no video signal degradation or USB bandwidth limitations.
Q: Can I use Lan Mouse over Wi-Fi? A: Technically yes, but wired Ethernet is strongly recommended. Wi-Fi introduces variable latency (5-20ms) and packet loss that can cause stuttering. For productivity work, Wi-Fi is acceptable; for gaming or precise design work, use Ethernet.
Q: Why doesn't X11 work as a sender? A: X11's security model restricts input capture. The protocol was designed before modern sandboxing existed. Workaround: Use your Wayland machine as the sender and X11 system as receiver. For full X11 support, consider contributing to the project—it's open source!
Q: How do I debug connection issues?
A: Run with verbose logging: lan-mouse -v. Check firewall rules with sudo firewall-cmd --list-all. Verify both machines are on the same subnet. Use ping to test baseline network health. The GTK frontend shows connection status visually.
Q: Will it drain my laptop battery?
A: The Rust binary is extremely efficient, using <1% CPU on idle. The GTK frontend may increase usage slightly. For battery-powered devices, compile without the frontend: cargo build --no-default-features --features layer_shell_capture.
Q: Can I contribute to mobile support? A: Absolutely! The lan-mouse-mobile POC needs Flutter/Dart developers. Start by forking https://github.com/rohitsangwan01/lan-mouse-mobile and implementing proper gesture support. The core Lan Mouse team welcomes backend improvements for mobile protocols.
Conclusion: The Future of Multi-Device Control Is Here
Lan Mouse represents a paradigm shift in how we think about multi-computer productivity. By leveraging Rust's performance and memory safety, it solves problems that have plagued developers for decades—latency, crashes, and security vulnerabilities. The mandatory DTLS encryption sets a new standard that proprietary tools should have adopted years ago.
What excites me most is the architectural vision. This isn't just a Synergy clone; it's a flexible platform ready for Android, iOS, and whatever operating systems emerge next. The GTK frontend democratizes access, while the conditional compilation features empower power users to build razor-thin binaries for specific environments.
The bottom line: If you're still using a hardware KVM switch or paying for Synergy, you're working harder than necessary. Lan Mouse is free, faster, and more secure. The installation takes minutes, the configuration is intuitive, and the performance will make you wonder why you waited this long.
Ready to transform your workflow? Head to the official repository at https://github.com/feschber/lan-mouse right now. Download the latest release for your platform, join the community discussions, and experience the future of seamless multi-computer control. Your productivity—and your desk space—will thank you.
Comments (0)
No comments yet. Be the first to share your thoughts!