# NetDesk — your own self-hosted remote desktop
**Website & live demo:** [netdesk.space](https://netdesk.space) · **Download:** [Windows agent](https://netdesk.space/download) · **Pricing:** [free to self-host](https://netdesk.space/pricing) A TeamViewer/RustDesk-style remote desktop system you fully own: a signaling/relay server for your VPS, a **Windows service** on your powerful PC (reachable at boot, at the logon screen, and across UAC prompts), and a **zero-install web viewer** (Chrome/Edge) you can use from any laptop or phone while traveling. ``` ┌──────────────────────────┐ WSS outbound only ┌──────────┐ WSS ┌──────────────┐ │ HOME PC (Windows service)│ ──────────────────► │ VPS │ ◄────── │ TRAVEL laptop│ │ broker (SYSTEM, boot) │ │ netdesk │ │ any browser │ │ └─ desktop agent │ ◄──── relayed ────► │ server │ │ (phone works)│ │ (console session) │ E2E-encrypted └──────────┘ └──────────────┘ └──────────────────────────┘ │ └──── optional direct mode: ws://home-ip:8901 (LAN / port-forward) ────┘ ``` ## Features **Access & unattended operation** - Boot-time Windows service (SYSTEM): no auto-logon needed, survives reboots - Reachable at the **Windows logon screen** — view and type credentials to log in - Input works across desktop switches (user desktop, logon screen, UAC prompts) via desktop-following injection - Auto-reconnect to server forever (works behind any NAT, no port forwarding) - Wake displays automatically when a viewer connects **Video / audio** - H.264 (x264 ultrafast/zerolatency), up to 1080p60 @ 20 Mbps, idle screens send nothing - Hardware decode in the browser (WebCodecs) + HTML5 canvas - Adaptive **Auto quality** mode (RTT/decoder-queue based preset stepping) - System audio (WASAPI loopback → Opus) — bundled in the packaged exe; `pip install PyAudioWPatch` for source runs **Full control** - Mouse (all buttons, wheel), keyboard via SendInput scancodes, keyboard-lock for Alt+Tab/Win/Ctrl+W in fullscreen - **Privacy mode** — turn the physical monitor off while you keep working - **Lock PC on disconnect** (per-viewer checkbox) - Process manager — list & kill remote processes - Remote power — lock, sign out, reboot, shut down, run command - Clipboard sync (two-way), chat **Files** - Browse/download/upload/rename/delete/mkdir, **folder upload** with drag & drop - Atomic uploads (.part → final), folder creation on demand - **Remote printing** — 🖨 any host PDF, image, or text/code file to your own local printer from the file manager (driver-free, browser-native print dialog) **Security** - **End-to-end encryption** (default): ephemeral ECDH P-256 → AES-256-GCM per frame — the VPS cannot see your screen - Password never leaves the host un-hashed (PBKDF2 200k challenge/response, 0.4 s throttle per bad attempt) - Optional **TOTP 2FA** (`--set-totp auto` → authenticator code required at connect) - Optional server registration key so only your hosts can register; `/status` API behind a token - The service broker relays opaque bytes only — agents hold all keys **Accounts (RustDesk-style)** - Sign up / sign in **in the desktop app and on the website** — no email verification wall (the account works immediately; the email only confirms it) - **My computers**: every PC where you sign in with your account is listed on the website for one-click connect (online/offline/in-session status shown) - Server address is **pre-filled** (netdesk.space) and no registration key is needed by default; point the app at your own server anytime - Pre-configured builds: name the exe `NetDeskHost-host=your.server,key=SECRET.exe` and it auto-configures — hand it out with zero setup **Viewer niceties** - Address book (saved connections), remember-password, view-only mode - **Session recording** to .webm (one click) - **TCP tunneling** — reach any TCP service on the host (SSH, RDP, web UIs) through the server; portal-gated, with a panel in the viewer - **Installable app (PWA)** — install the viewer like a native app from Chrome/Edge/Safari on laptop or phone - **Host-side remote printing** — send a file to the host's printer from the file manager - Multi-monitor switching, quality presets, live stats (fps/RTT/bitrate/E2E badge) ## Quick start (try on one PC) ```bat cd path\to\netdesk scripts\run_local_demo.bat ``` First run prints and saves a 9-digit ID and a random password (`%APPDATA%\NetDesk\config.json`). Automated end-to-end test: `.venv\Scripts\python tools\smoke_test.py` (23 checks: auth, 2FA, E2E video, clipboard, processes, privacy, files, input, broker path…). ## Portable exe — a regular desktop app, no Python needed `portable\` (and `..\NetDesk-portable-win64.zip`) ships standalone Windows x64 binaries built with PyInstaller, **tested end-to-end** (full 20-check suite passes against the packaged exes): | File | Purpose | |---|---| | `NetDeskHost.exe` (54 MB, windowed) | the agent **desktop app** — double-click it: a control panel opens with live status, your ID, server settings, password/2FA management, start/stop, and one-click service install | | `NetDeskServer.exe` (14 MB, console) | server for a Windows VPS; serves the viewer **and the portal** | Double-clicking `NetDeskHost.exe` opens the control panel (config + logs are created next to the exe — the folder is fully portable). Advanced users can still drive everything from a terminal (`--server …`, `--install`, `--set-password`, `--set-totp auto`, `--uninstall`); the app itself is windowless, so CLI output goes to `host.log` next to the exe. `--install` sets up the same boot-time SYSTEM service with full logon-screen/UAC access. ## macOS (MacBook M4 / Apple Silicon and Intel) Mac binaries cannot be cross-compiled from Windows, so the repo builds them ON the Mac — native, one command: ```bash git scp the netdesk folder to the Mac, then: bash scripts/build_mac.sh # -> dist/NetDeskHost + dist/NetDeskServer (arm64) ``` - `NetDeskHost` on the Mac = control the Mac remotely (capture via mss, input via CoreGraphics CGEvent, clipboard via pbpaste/pbcopy, process manager, power via osascript). First run: grant **Screen Recording** and **Accessibility** permissions (System Settings → Privacy & Security); if Gatekeeper complains: `xattr -cr NetDeskHost`. - Autostart on login: `scripts/deploy/com.netdesk.host.plist` → copy to `~/Library/LaunchAgents/` (edit the path/server inside first), then `launchctl load ~/Library/LaunchAgents/com.netdesk.host.plist`. - `NetDeskServer` also builds on the Mac if you want a Mac VPS. - macOS audio capture needs a loopback device (e.g. BlackHole) — off by default. - Connecting TO a Mac or PC from the MacBook: just the browser — open the server URL in Chrome/Edge/Safari; nothing to install. ## Web management portal Start the server with `--portal-password "YourPortalPassword"` and open `https://your-server:8443/portal` — a TeamViewer-console-style dashboard: - **Computers list** — every host that ever registered, online/offline status, version, last-seen, and a **Connect** button that deep-links into the viewer (`/?id=