{"id":14963315,"url":"https://github.com/allape/openkvm","last_synced_at":"2025-10-25T01:30:36.109Z","repository":{"id":239316470,"uuid":"797218058","full_name":"allape/openkvm","owner":"allape","description":"DIY KVM for remote-controlling a computer even in BIOS","archived":false,"fork":false,"pushed_at":"2024-12-19T04:16:17.000Z","size":768,"stargazers_count":13,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-31T04:51:23.713Z","etag":null,"topics":["esp32s3","golang","hdmi-recording","keyboard","kvm","mouse","opencv","remote-control","rfc6143","vnc"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/allape.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-07T12:23:34.000Z","updated_at":"2024-12-21T12:59:55.000Z","dependencies_parsed_at":"2024-05-18T08:22:17.222Z","dependency_job_id":"4cea11f1-662a-4d18-83ac-60e65d80621e","html_url":"https://github.com/allape/openkvm","commit_stats":{"total_commits":35,"total_committers":1,"mean_commits":35.0,"dds":0.0,"last_synced_commit":"1268fbf7ef94d14493858d0e37c39fdc92bc8983"},"previous_names":["allape/openkvm"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allape%2Fopenkvm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allape%2Fopenkvm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allape%2Fopenkvm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allape%2Fopenkvm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/allape","download_url":"https://codeload.github.com/allape/openkvm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238053514,"owners_count":19408699,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["esp32s3","golang","hdmi-recording","keyboard","kvm","mouse","opencv","remote-control","rfc6143","vnc"],"created_at":"2024-09-24T13:31:20.640Z","updated_at":"2025-10-25T01:30:36.104Z","avatar_url":"https://github.com/allape.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenKVM\n\nMake an old laptop or a single board computer into a KVM device to control a computer remotely.\n`KVM` stands for `Keyboard \u0026 Video \u0026 Mouse` instead of `Linux Kernel Virtual Machine`.\n\nUnlike the [IP-KVM](https://github.com/tiny-pilot/tinypilot), this project\nrespects [VNC protocol](https://datatracker.ietf.org/doc/html/rfc6143).\n\nJust like the [MIT license](./LICENSE) says, no warranty or guarantee.\n\nMy dev walkthrough is in [WALKTHROUGH.md](./WALKTHROUGH.md).\n\n**And do _NOT_ use for any illegal purposes.**\n\n### TODO\n\n- [x] Remove OpenCV, see [WALKTHROUGH.md](WALKTHROUGH.md#opencv) for the reason of removal\n- [ ] Installation script\n    - [ ] Register as a system service\n    - [ ] Start on boot\n- [x] VNC authentication\n    - [x] DES encryption in Golang can NOT directly apply to [`VNC Authentication`](https://datatracker.ietf.org/doc/html/rfc6143#section-7.1.2)\n    - [x] Http Basic Auth in web page and API\n- [ ] More effective to calculate the difference between frames\n    - Balance between the power of SBC and the network efficiency\n    - Or achieve more support for noVNC, beyond [rfc6143](https://datatracker.ietf.org/doc/html/rfc6143)\n- [ ] OTG as keyboard and mouse, see\n  Linux [USB Gadget API](https://www.kernel.org/doc/html/v4.16/driver-api/usb/gadget.html)\n- [x] Using a single command to get the frame for `Video`, like\n  ```shell\n  v4l2-ctl --device=/dev/video0 --stream-mmap --stream-count=1 --stream-to=- --set-fmt-video=\"width=640,height=480,pixelformat=MJPG\"\n  ```\n\n## Dev Environment\n\n### Hardware\n\n**_NONE_ of them is sponsored, use them at your own risk!**\n\nEssential hardware are:\n\n- A device that can run [Golang](https://go.dev/)\n    - A personal computer or a laptop\n    - SBC\n        - [RaspberryPi](https://www.raspberrypi.com/)\n        - [OrangePi](https://www.orangepi.org/)\n        - [BTT-Pi](https://bigtree-tech.com/blogs/news/new-release-bigtreetech-btt-pi)\n        - etc...\n- `HDMI Recorder`, see [WALKTHROUGH.md](WALKTHROUGH.md#problem-with-hdmi-recorder) for more details.\n    - Or a `webcam` pointing to an always-on monitor.\n- Keyboard \u0026 Mouse Emulator\n    - ESP32-S3\n    - Some other device that supports USB HID output.\n        - HID over BLE is not recommended, because it may not work in BIOS.\n- Relay and/or delayed relay\n\n#### My Setup\n\n- `SBC`: [OrangePi 3 LTS](http://www.orangepi.cn/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-3-LTS.html)\n    - `¥241 RMB` ≈ `$34 USD`\n- `HDMI Recorder`: [UGREEN CM716](https://item.m.jd.com/product/100069462730.html)\n    - `¥84 RMB` ≈ `$12 USD`\n- `Keyboard \u0026 Mouse`: [ESP32-S3](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/user-guide-devkitc-1.html)\n    - I bought a third-party one of [WeAct ESP32 S3 (A) DevKitC 1](https://github.com/WeActStudio).\n    - `¥52 RMB` ≈ `$7.5 USD`\n- 5V relay * 2, 5V delayed relay * 1\n    - `¥15 RMB` ≈ `$2 USD`\n\n#### Others\n\n- Test Device:\n    - [RaspberryPi 2B](https://www.raspberrypi.com/products/raspberry-pi-2-model-b/)\n    - A Windows computer\n    - Ubuntu 24.04 x86_64\n- Some SD cards.\n- Some `USB Type-C2C/C2A` cables.\n- A `HDMI` cable.\n- Some power supplies.\n\n_**Price is for reference only, the actual price may vary.**_\n\n### Software\n\n- [GO](https://go.dev/)\n- [Arduino](https://www.arduino.cc/)\n- [noVNC](https://github.com/novnc/noVNC)\n\n## Diagram\n\n[飞书文档, FeiShu Doc](https://qi58or3rjjg.feishu.cn/wiki/KTZewFOx9iRyzQkfdzTcu8linxc?from=from_copylink)\n\n![diagram.png](./docs/diagram.png)\n\n## Installation\n\n### Debian ARM64\n\n1. Install GO dev kit\n   ```shell\n   sudo apt-get update\n   sudo apt-get install -y wget curl ffmpeg v4l-utils\n   GO_ZIP=\"go1.23.3.linux-arm64.tar.gz\"\n   wget \"https://go.dev/dl/$GO_ZIP\"\n   sudo rm -rf /usr/local/go \u0026\u0026 sudo tar -C /usr/local -xzf \"$GO_ZIP\"\n   export PATH=$PATH:/usr/local/go/bin\n   ```\n2. Pull this repo\n   ```shell\n   sudo apt-get update\n   sudo apt-get install -y git\n   git clone --depth 1 https://github.com/allape/openkvm.git\n   ```\n3. Get noNVC\n   ```shell\n   git clone --depth 1 https://github.com/novnc/noVNC.git\n   \n   # [Optional] You can run noVNC separately\n   python3 -m http.server --directory noVNC/ 8081\n   ```\n4. Flash ESP32-S3\n    - [PIO](https://platformio.org/): See [WALKTHROUGH.md](WALKTHROUGH.md#pio-of-esp32) for the reason of removal\n    - [Arduino](https://www.arduino.cc/)\n        - Open `Perferences` -\u003e `Additional Board Manager URLs` -\u003e\n          Add `https://espressif.github.io/arduino-esp32/package_esp32_dev_index.json`\n            - Click [HERE](https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html#installing-using-arduino-ide) for more details\n        - Open [km/esp32s3-arduino/main/main.ino](./km/esp32s3-arduino/main/main.ino)\n          with [Arduino IDE](https://github.com/arduino/arduino-ide)\n        - Select board `ESP32S3 Dev Module` and corresponding port\n        - Click `Upload`\n            - For deployed device, use [Arduino CLI](https://arduino.github.io/arduino-cli/1.1/installation/) to compile and upload firmware\n            - Here is an example on `Debian` with an `ESP32-S3` connected to `/dev/ttyACM0`\n              ```shell\n              cd ~\n              # Command below will install `arduino-cli` at ~/bin\n              curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh\n              echo \"export PATH=\\$PATH:$HOME/bin\" \u003e\u003e ./.bashrc\n              source ./.bashrc\n              arduino-cli config init\n              arduino-cli config add board_manager.additional_urls https://espressif.github.io/arduino-esp32/package_esp32_dev_index.json\n              arduino-cli config set network.proxy \"http://localhost:1080\" # Optional, because arduino-cli may NOT respect http_proxy or https_proxy environment variables\n              arduino-cli core update-index\n              arduino-cli core install esp32:esp32 # This will takes a while...\n              cd openkvm # Change to the directory where the project located\n              cd ./km/esp32s3-arduino/main/\n              arduino-cli compile -b esp32:esp32:esp32s3 .\n              # sudo chmod 777 /dev/ttyACM0\n              arduino-cli upload . --fqbn esp32:esp32:esp32s3 -p /dev/ttyACM0\n              # screen /dev/ttyACM0 921600 # ctrl + a + k to exit\n              ``` \n5. Run or build repo\n   ```shell\n   export PATH=$PATH:/usr/local/go/bin\n   \n   cd openkvm\n   \n   go mod download\n   \n   cp kvm.new.toml kvm.toml\n   \n   # Find out serial port\n   dmesg | grep tty\n   \n   # Edit this file to apply your settings\n   vim kvm.toml # kvm.onragepi.ugreen_25854.toml for example\n   \n   # Should run with super user privilege\n   sudo /usr/local/go/bin/go run .\n   \n   #/usr/local/go/bin/go build -o openkvm .\n   #sudo ./openkvm\n   ```\n6. Open browser and go to http://ip:8080/vnc.html, then click `Connect`\n    - Hostname and port may vary depending on your settings\n    - Clipboard Usage\n      - For now, only host to client is supported\n      - Example on Debian\n         - USB CDC / USB Serial with device `/dev/ttyACM0`\n           ```shell\n           sudo screen /dev/ttyACM0\n           # Or\n           sudo cat /dev/ttyACM0 # FIXME: In some cases, this command only works after you run `screen`\n           ```\n         - USB MSC / USB Pen with device `/dev/sda`, use `lsblk` to find out\n           ```shell\n           mkdir openkvm\n           # Commands below need to be run every time you used clipboard\n           sudo umount /dev/sda\n           sudo mount /dev/sda ./openkvm\n           cat ./openkvm/data.txt\n           ```\n7. Open http://ip:8080/ui/button.html to control the relay\n\n# Credits\n\n- [Listed in go.mod](./go.mod)\n- [Roboto Font](https://fonts.google.com/specimen/Roboto/about)\n- [noVNC](https://github.com/novnc/noVNC)\n- [ESP-IDF](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/get-started/index.html)\n- [ESP32-Arduino](https://docs.espressif.com/projects/arduino-esp32/en/latest/getting_started.html)\n- [Raspberry Pi Imager](https://www.raspberrypi.com/software/)\n- [KeyMap](https://github.com/qemu/keycodemapdb)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallape%2Fopenkvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fallape%2Fopenkvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallape%2Fopenkvm/lists"}