Skip to content
revlatPublic

About

A small, self-contained IP-KVM: screen, keyboard and mouse of another computer in your browser – down to the BIOS – with an HDMI capture card and a CH9329. H.264, TOTP, OCR, optional power relay.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

slimkvm

A small, self-contained IP-KVM: the screen, keyboard and mouse of another computer in your browser – down to the BIOS – with a USB HDMI capture card and a CH9329 keyboard emulator on a small Linux box.

slimkvm in the browser: the console of the target, status and tools in the header

  • Small: Python standard library and Debian packages only, about 2700 lines of Python, one page.
  • No cloud, no telemetry: it talks to nobody; systemd keeps it off the internet.
  • H.264 video encoded on the host's GPU, decoded by the browser: 1080p at ~3 Mbit/s, fine over a VPN.

Features

  • Keyboard by physical key (the target's own layout applies), absolute mouse, wheel, three buttons
  • Type text into the target (German or US layout), key combinations the browser would catch (Ctrl+Alt+Del, Ctrl+Alt+F1–F7, …), fullscreen with keyboard lock
  • Pause + OCR: freeze the picture and copy its text – the recognition runs in your browser, with a model trained for console, BIOS and GRUB fonts (console-ocr)
  • Power button (optional USB relay): press, hold (hard off) or power cycle, each after a confirmation
  • Picture quality to choose (High, Medium, Low), screenshot as PNG
  • Login with password and two-factor code (TOTP), set up in the browser; lockout after wrong attempts; watching keeps you logged in, input locks after 30 minutes idle
  • Notifications of logins, power actions and broken parts to any command (Gotify, ntfy, mail, …); /healthz for monitoring
  • Optional: single sign-on through a reverse proxy, client certificates (mTLS), Let's Encrypt
  • Install with a script or as a Debian package

Not included on purpose: virtual drives (the CH9329 cannot do them), users and roles, audio. For OS installs, keep a Ventoy stick in the target.

Recognise and copy text Power actions ask first
OCR: the paused picture with selected text Power cycle dialog with code field

Hardware

Setup: HDMI from the target to the capture card, the CH9329 module on the target's USB wired to a USB serial adapter on the KVM host, an optional relay on the power button, the browser over HTTPS

Part What to get Tested
KVM host Debian 13, an Intel or AMD GPU with H.264 encoding (VA-API), 2 GB RAM AZW Z83-V mini PC, Intel Atom x5-Z8350 (HD 400, driver i965): 1080p at 25 fps
Capture card a USB HDMI card that Linux sees as a camera (UVC); USB 3 cards with raw YUYV are best MacroSilicon MS2130 (USB ID 345f:2130): 1080p YUYV
Keyboard/mouse a ready-made "CH340 + CH9329" USB cable, or a CH9329 module on the target's USB wired (TX, RX, GND) to a USB serial adapter on the host – an isolated adapter avoids ground loops "CH340 + CH9329" cable (1a86:7523 on the host, 1a86:e129 on the target): works (one sample was defective, see below)
Power (optional) a USB relay: HID "USBRelay", LCUS or Modbus RTU, contacts parallel to the power button USB HID relay "USBRelay" (16c0:05df): works
  • The CH9329 has to be powered by the target's USB port. Powered only through the serial line it restarts with every command and never answers. A defective "CH340 + CH9329" cable did exactly that (its LED only lit with the host side plugged in); an identical cable works on the same ports.
  • Cheap USB 2 capture cards (MS2109 and clones) deliver only MJPEG: set input_format = mjpeg; it works, but the CPU decodes the JPEGs. Measurements: dev/H264.md.
  • No usable GPU: encoder = libx264 (needs a much faster CPU).
  • Power draw of the tested set (AZW Z83-V with the MS2130 and the CH9329 cable, measured at the wall with a plug-in meter): 2.8 W idle, 5.5 W with the stream open (1080p, 25 fps). ffmpeg only runs while someone watches.

Browsers: anything with WebCodecs over HTTPS – Chrome/Edge 94+, Firefox 130+, Safari 16.4+.

Installation

1. GPU driver – check it before anything else:

sudo apt install vainfo intel-media-va-driver    # Intel from Broadwell (2014) on
sudo apt install vainfo mesa-va-drivers          # AMD
vainfo                                           # must list VAProfileH264…: VAEntrypointEncSlice

Older Intel (Atom/Celeron up to Cherry Trail, Core up to Haswell) needs i965-va-driver-shaders from Debian's non-free section: add non-free to Components: in /etc/apt/sources.list.d/debian.sources, sudo apt update, sudo apt install vainfo i965-va-driver-shaders.

2. slimkvm – with the script:

sudo apt install git
git clone https://github.com/revlat/slimkvm.git && cd slimkvm
sudo ./install.sh

It installs the packages, sets the host up (user, config, a self-signed certificate, systemd service), checks that slimkvm answers and prints the addresses to open and a one-time setup code.

Or as a Debian package, built from the checkout (no downloads yet):

packaging/build-deb.sh                               # dist/slimkvm_<version>_all.deb, needs only dpkg and git
sudo apt install ./dist/slimkvm_<version>_all.deb    # apt, not dpkg -i: it installs the dependencies
sudo cat /var/lib/slimkvm/setup-code                 # the package does not print it (dpkg's output is logged)

3. Devices – put the two names into the config:

ls /dev/v4l/by-id/       # capture card: the one ending in -video-index0  → [video] device
ls /dev/serial/by-id/    # serial adapter of the CH9329                   → [hid] device
sudo nano /etc/slimkvm/slimkvm.conf
sudo systemctl restart slimkvm
sudo python3 /opt/slimkvm/slimkvm.py check --devices    # video, keyboard, a test picture

4. First login – open https://<host or IP>/, accept the self-signed certificate once (or use a trusted one, see ADVANCED.md), enter the setup code and choose a password.

5. Two-factor login – Account → Two-factor login → Set up…, scan the QR code with an authenticator app. Do it: without it a stolen session could also use the power button without asking.

Using it

  • Click into the picture to control the target: a blue frame means keys and mouse go there. Click outside the picture to get them back.
  • Keys, Type text, OCR, Screenshot, Fullscreen in the header; Power on the right (with a relay).
  • After 30 minutes without input the keyboard locks – the picture keeps running – and a bar under the picture asks for the password again. The session ends after 8 hours.
  • Who may connect: by default the private networks; a VPN outside them (e.g. Tailscale) goes into [server] allow in the config.

Update

  • Script: git pull && sudo ./install.sh – config, certificate and login data are kept.
  • Package: build the new one and sudo apt install ./dist/slimkvm_<new>_all.deb. A running service is restarted, a stopped or disabled one stays so. An older .deb installed the same way goes back.

Documentation

  • ADVANCED.md – configuration, power relay, notifications, monitoring, Let's Encrypt, single sign-on, client certificates, the Debian package, automated installs, how it works
  • TROUBLESHOOTING.md – symptoms and fixes, forgotten password
  • SECURITY.md – reporting a vulnerability, how slimkvm protects itself
  • CONTRIBUTING.md – tests (no hardware needed), style, CI
  • IDEAS.md – what might come next

License

MIT, see LICENSE. The bundled OCR library (tesseract.js) and OCR model (console-ocr) are Apache-2.0, see THIRD-PARTY-NOTICES.md.

slimkvm can switch a computer off hard and type on it like a person at its keyboard. It comes without any warranty; you use it at your own risk (see the license).

About

A small, self-contained IP-KVM: screen, keyboard and mouse of another computer in your browser – down to the BIOS – with an HDMI capture card and a CH9329. H.264, TOTP, OCR, optional power relay.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages