Getting started

Quick start

Clone the repository, build the WebAssembly module, and run your first RISC-V command in under a minute.

Build the module

The default build is slim — a bare ~2.3 MB WebAssembly RISC-V VM with no bundled binaries; guest programs install on demand from the app catalog. You will need a recent Rust toolchain with the WASM target installed.

bash
git clone https://github.com/userland-run/nano
cd nano

# build the slim WASM module (~2.3MB, no bundled binaries)
make build

Run the tests

The suite covers the in-memory filesystem, ELF execution, BusyBox smoke tests and the devenv tools.

bash
make test

Run a command

The test runner loads a RISC-V image and executes a single command inside the VM.

bash
# a BusyBox command
node test/run.mjs runners/riscv/images/busybox --cmd echo "Hello from RISC-V"

# a Node.js script
node test/run.mjs runners/riscv/images/node --cmd node -e "console.log(process.arch)"
# riscv64

Try it in the browser

The browser experience — a live terminal, editor and preview — is the <nano-terminal> web component and the demos at userland.run, driven through the SDK. To serve a build locally, make serve hosts the wasm/ directory.

bash
make serve   # build + serve wasm/ on http://localhost:8080
Embedding NanoVM in your own app? Use the SDK (@userland-run/nano-sdk) rather than the raw module — see the SDK overview.