Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSBian

A Debian Trixie 13 simulator, JSBian, made in JavaScript — a persistent, Debian-compatible environment that runs entirely in Node.js. No VM, no kernel, no CPU emulation: the shell, filesystem, package manager, init system, and users are all implemented directly in JS, with real apt metadata behind them where it matters.

Purpose

Mostly a PoC. Most "Linux in JS" projects (JSLinux and friends) either emulate real hardware to boot an actual Linux kernel as a VM, or don't really emulate anything at all. JSBian tries a third path: be honestly a simulation — a real, persistent filesystem and package database, real Debian package metadata, but no pretense of running native machine code. Where that limit actually matters (you want something to run, not just be listed by apt), packages can be real, sandboxed JavaScript instead of unexecutable ELF binaries.

Quick start

node jsbian-installer.js   # first-run setup (idempotent)
node bin/jsbian.js         # boot into the shell

Persistent state lives in .jsbian_data/ next to the project. Delete it (or run erase-to-first-state --yes from inside the shell) to start over.

Features

  • Persistent overlay filesystem — a read-only factory image plus a writable layer that survives restarts, backed by disk.
  • A real shell — coreutils-style builtins, $? / && / || / ;, >/>> redirection, users, groups, permissions, su.
  • apt, for real — fetches actual Debian mirror Packages indices and downloads/verifies/unpacks genuine .debs (inspectable, but not executable — there's no kernel here). Alongside that, a JSBian-native package repo of plain .js packages that do run, in a locked-down sandbox, discovered live with no build step.
  • A simulated PID 1 — services, systemctl, ps, real init-style boot logging.
  • A Debian Live–style boot sequence — interactive GRUB menu, kernel/systemd boot log, login prompt, first-boot install wizard.
  • erase-to-first-state — a real factory reset back to a clean install.
  • Real host data in /proccpuinfo and meminfo reflect the actual machine JSBian is running on.

Package repo

JSBian's default apt source is JSBian-apt-repo — real, runnable .js packages, discovered live (no build step, no manual index to maintain). See its CONTRACT.md for the package format, the sandbox a package runs in, and how to stand up your own repo with the same structure.

Requirements

Node.js 18+. Newer Node (22.15+/23.8+) is recommended — real .deb extraction uses zlib's built-in zstd support, which only exists on newer Node, and xz-compressed packages need a system xz binary on PATH (falls back to a simulated install otherwise).

License

MIT.

About

A Debian Trixie 13 simulator, JSBian, made in JavaScript. See APT repo at Comma-off/JSBian-apt-repo.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages