Web GNU Terminal
A fully client-side, serverless GNU/Linux environment running entirely inside the web browser. Powered by x86 hardware emulation in WebAssembly, it boots a genuine Linux kernel and provides a full POSIX-compliant shell without needing any backend server infrastructure.
Overview
Most in-browser "terminals" are simple JavaScript command interpreters that simulate shell commands using string parsing. This project instead runs an actual virtualized x86 CPU core via WebAssembly (v86) directly inside the browser sandbox. The terminal connects to the virtual machine's UART serial output through Xterm.js, providing an authentic Linux environment with access to GNU coreutils, scripting, and file system operations.
Key features
- Real Linux Kernel: Boots a stripped-down Buildroot/Alpine Linux image natively inside browser memory.
- Serverless & Zero Cost: 100% client-side execution — all compute, memory, and emulation run locally on the client's device.
- Full POSIX Environment: Native execution of standard GNU utilities (
bash,grep,sed,awk, pipes, file redirection, and shell scripting). - Production Terminal Interface: Powered by Xterm.js with support for ANSI color escapes, responsive resizing (FitAddon), and keyboard shortcuts.
- Sandboxed Security: Safe sandboxed environment running inside standard WebAssembly boundaries with zero host machine risk.
Tech stack & Architecture
The solution pairs hardware emulation with a modern frontend interface:
- Virtualization Core:
v86compiled to WebAssembly (WASM) for high-performance JIT-assisted x86 emulation. - Terminal UI:
Xterm.jsfor terminal rendering, event handling, and serial character streaming. - OS / Userland: Minimal Linux kernel with custom initramfs packaging GNU coreutils.
- Frontend Glue: Modern ES6+ JavaScript handling memory allocation, serial port binding, and virtual machine lifecycle.
What I learned
Working on this deepened my understanding of low-level system concepts: the Linux boot sequence, serial communication (UART), virtual memory paging, and hardware interrupts. It also highlighted the power of WebAssembly to run compute-heavy system code directly inside web browsers with near-native performance.