Share your keyboard, mouse, and clipboard seamlessly between Linux and Windows.
Features • Installation • Quick Start • How It Works • Configuration • Contributing
MWB Linux is a native Linux client that connects to Microsoft PowerToys Mouse Without Borders on Windows. Move your mouse to the edge of the screen, and it seamlessly jumps to the other machine — along with your keyboard and clipboard.
flowchart LR
A["🐧 <b>Linux PC</b><br/>Mouse · Keyboard"] <-->|" 🖱️ Mouse · ⌨️ Keyboard · 📋 Clipboard "| B["🪟 <b>Windows PC</b><br/>Mouse · Keyboard"]
Move your mouse to the screen edge — the cursor seamlessly jumps to the other machine.
No extra software needed on Windows beyond PowerToys, which bundles Mouse Without Borders.
- Bidirectional mouse sharing — Control both machines from either keyboard/mouse
- Seamless edge switching — Move cursor to screen edge, it appears on the other machine
- Clipboard sync — Copy text or images on one machine, paste on the other
- Keyboard forwarding — Type on your Linux keyboard, text appears on Windows
- Full mouse support — Scroll wheel, horizontal scroll, and side buttons (back/forward)
- Encrypted — AES-256-CBC encryption with PBKDF2 key derivation
- Device isolation — When controlling Windows, your Linux cursor doesn't move
- Dual-mode connection — Acts as both server and client for fast reconnection
- Zero config on Windows — Works with existing PowerToys MWB setup
- Lightweight — Single binary, ~5MB, no GUI dependencies
| Direction | What happens |
|---|---|
| Mouse hits left edge on Linux | Cursor appears on Windows, Linux input disabled |
| Mouse hits right edge on Windows | Cursor returns to Linux, input restored |
| Ctrl+C on Windows | Text/image available on Linux clipboard |
| Ctrl+C on Linux | Text/image available on Windows clipboard |
| Type on Linux keyboard | Text appears in focused Windows app |
curl -fsSL https://raw.githubusercontent.com/lucky-verma/mwb-linux/main/scripts/install.sh | sudo bashDownload the versioned .deb for your architecture from
Releases, then install it:
sudo dpkg -i mwb-linux_*_amd64.deb
# Add yourself to the input group
sudo usermod -aG input $USER# Download binary
wget https://github.com/lucky-verma/mwb-linux/releases/latest/download/mwb-linux-amd64
chmod +x mwb-linux-amd64
sudo mv mwb-linux-amd64 /usr/local/bin/mwb
# Install dependencies
sudo apt install xdotool xinput xclip
# Setup permissions
sudo bash -c 'modprobe uinput && echo uinput > /etc/modules-load.d/uinput.conf'
echo 'KERNEL=="uinput", GROUP="input", MODE="0660"' | sudo tee /etc/udev/rules.d/99-mwb-uinput.rules
sudo udevadm control --reload-rules
sudo usermod -aG input $USERgit clone https://github.com/lucky-verma/mwb-linux.git
cd mwb-linux
make build
make install # no sudo — installs a per-user service
systemctl --user enable --now mwbmake install is a per-user install: the binary goes to ~/go/bin/mwb and the
service to ~/.config/systemd/user/. Do not run it with sudo — that
installs under root and the --user service then can't find the binary.
The installed service runs receive-only mode (mwb) so it will not
unexpectedly send the Linux mouse to Windows. Use mwb -bidi -edge left
manually when you explicitly want Linux → Windows control.
It does not set up system dependencies. If this is a fresh machine, run the
dependency and permission steps from From Binary first
(xdotool/xinput/xclip, the uinput module, the udev rule, and the
input group).
Note: Log out and back in after installation for group changes to take effect.
One installer at a time. The one-line/
.deb/binary methods install a system service that runs/usr/local/bin/mwb.make installinstalls a per-user service that runs~/go/bin/mwb. If you switch methods, stop and disable the old service first so you aren't running a stale binary.
Open PowerToys → Mouse Without Borders → copy the Security Key.
mkdir -p ~/.config/mwb
cat > ~/.config/mwb/config.toml << EOF
host = "192.168.1.100" # Your Windows machine's IP
key = "YourSecurityKey" # From PowerToys MWB
name = "linux" # This machine's name (max 15 chars)
keyboard_layout = "auto" # Inbound keyboard layout profile
EOF# Receive only (Windows controls Linux)
mwb
# Bidirectional (Linux also controls Windows)
mwb -bidi -edge leftIn PowerToys MWB, enter the security key and device name to connect.
MWB Linux implements the full Mouse Without Borders protocol:
- Dual-mode connection — Listens on port 15101 AND connects outbound (first one wins)
- Handshake — AES-256-CBC encrypted challenge-response with PBKDF2-SHA512 key derivation
- Heartbeats — Proactive keepalive every 5s prevents Windows from dropping the connection
- Edge detection — 10ms cursor polling detects screen edges, instant switching with bounce prevention
- Input forwarding — Mouse (absolute coords) and keyboard (VK codes) sent as MWB packets
- Device isolation —
xinput disable/enableprevents dual cursor movement during remote control - Clipboard — Bidirectional text/image sync via compressed clipboard packets
For detailed protocol documentation, see docs/ARCHITECTURE.md.
| Field | Default | Description |
|---|---|---|
host |
(required) | Windows machine IP address |
key |
(required) | MWB security key (from PowerToys) |
name |
hostname | This machine's display name |
port |
15100 | Base port (message port = 15101) |
remote_width |
1920 | Remote screen width in pixels |
remote_height |
1080 | Remote screen height in pixels |
edge |
left | Screen edge for switching: left or right |
clipboard |
true | Clipboard sync: set false to disable text/image sharing |
accel_multiplier |
2.0 | Cursor speed when controlling Windows. Lower it (e.g. 1.0, 0.5) if the Windows cursor feels too fast |
inbound_multiplier |
1.0 | Cursor speed when Windows controls Linux. 1.0 mirrors Windows exactly; raise it for faster inbound movement |
keyboard_layout |
auto | Inbound Windows-to-Linux keyboard mapping. auto detects the local Linux layout when possible; supported profiles include us, de, fr, be, es, it, gb, pt, no/dk/se/fi, ch, and nl |
| Flag | Default | Description |
|---|---|---|
-bidi |
false | Enable bidirectional input (Linux → Windows) |
-edge |
(from config) | Override edge from config: left or right |
-no-clipboard |
false | Disable clipboard sharing (overrides config) |
-debug |
false | Enable debug logging |
-config |
~/.config/mwb/config.toml | Config file path |
- PowerToys installed with Mouse Without Borders enabled
- "Move mouse relatively" set to OFF (required for bidirectional mode)
- "Share clipboard" set to ON (for clipboard sync)
- "Block screen saver on other machines" set to ON (recommended, keeps connection alive)
- Security key shared with Linux client
- Windows Firewall must allow ports 15100-15101 (TCP inbound/outbound)
Run the setup permissions commands above, then log out and back in.
Ensure xclip is installed: sudo apt install xclip
Set clipboard = false in config.toml, or run with -no-clipboard. The Linux
client then never reads or writes the local clipboard, so it won't override what
you copied on Windows.
Make sure you are running bidirectional mode with mwb -bidi -edge left after
the udev/input-group setup and a fresh login. Avoid sudo mwb for normal use:
it reads root's config and can miss the user's display/session.
If an older root service is still running, stop it before starting the user service:
sudo systemctl disable --now mwb-linux.service
systemctl --user restart mwb- Check Windows firewall allows port 15100-15101
- Verify the IP address in config.toml
- Ensure PowerToys MWB is enabled on Windows
Set "Move mouse relatively" to OFF in PowerToys MWB settings.
Upgrade to a build with directional MachineSwitched/NextMachine filtering.
The Linux client should only accept return requests from the edge configured by
-edge; touching the other laptop's far edge should stop there, not bring
control back to Ubuntu.
cmd/mwb/ CLI entry point
internal/
capture/ Edge detection, evdev capture, xinput device isolation
clipboard/ Bidirectional clipboard sync (text + images)
config/ TOML configuration
input/ Virtual mouse/keyboard via uinput
network/ TCP connection, encryption, packet send/receive
protocol/ MWB packet types, serialization, AES-256-CBC
docs/
ARCHITECTURE.md Detailed protocol and architecture documentation
scripts/
install.sh Installation helper script
- Keyboard on Windows lock screen — Keyboard input may not work on the Windows lock screen (Winlogon desktop security restriction)
- Middle mouse button auto-scroll — Middle-click auto-scroll (scroll lock mode) does not work in browsers; normal middle-click works
- First connection — Initial handshake takes ~3-16s depending on Windows MWB state; subsequent reconnects are instant
- Bidirectional mode requires X11 — Edge detection and device isolation use
xdotool/xinput. Receive-only mode works on Wayland (XWayland session). Native Wayland bidirectional support requires compositor extensions and is not yet implemented. - Keyboard layout metadata — PowerToys MWB keyboard packets carry Windows virtual-key codes and flags, but not hardware scan codes or Unicode text. MWB Linux uses
keyboard_layoutprofiles for common layouts; unsupported profiles fall back to the original US-compatible mapping. Fully zero-config global layout support requires sender-side scan code or Unicode metadata. - Brief screen stall on return with many input devices — Device isolation re-enables every matched device via
xinputwhen control returns to Linux. On setups with many input devices (e.g. several gaming peripherals exposing 15+xinputsub-devices) the compositor can stall for ~1-2s on return (the cursor keeps moving, the screen briefly freezes). An EVIOCGRAB-based isolation was tried to avoid this but introduced a worse cursor regression and was reverted; a proper fix (EVIOCGRAB done right, or libei) is tracked for a future release. - Cursor speed / drift — Remote cursor movement scales raw evdev deltas by
accel_multiplier(default 2×); lower it if the Windows cursor feels too fast (the Windows side adds no acceleration of its own). Tracking is open-loop, so the virtual cursor may still drift from the actual position over long sessions.
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
make build # Build binary
make test # Run tests
make lint # Run linter
make check # All of the above- Microsoft PowerToys — Mouse Without Borders is part of PowerToys (MIT License). This project implements the MWB network protocol for Linux.
- bketelsen/mwb — Initial Go implementation of the MWB receive-only client that this project builds upon.
- The MWB protocol specification was derived from the open-source PowerToys codebase.
MIT License — see LICENSE for details.
