Quickstart
Create a starter app
Section titled “Create a starter app”Use Node.js 24 or newer. Choose a new directory for your app:
npx @oxvm/cli@latest init my-app --startbunx --package @oxvm/cli@latest oxvm init my-app --use-bun --startCreates the app, installs dependencies and starts a local server. Open the local URL printed in your terminal.
The starter runs real Linux Python and pandas in your browser. Edit the Python code, upload a CSV and explore the resulting DataFrame. An interactive Linux terminal is included.
The generated app includes the SDK, browser headers and a signed, prebuilt image reference. You do not need to build an image or download the engine locally. The engine and image load in the browser when you run the app.
To start it again later, run npm run dev or bun run dev from my-app. See Starter example for its files and features.
To change the Linux programs, follow Custom images. The generated README links to the exact release recipe and build guide. The recipe directory is not copied into your app.
Build with Codex or Claude
Section titled “Build with Codex or Claude”OxVM project skills are included in every new starter. Open the folder in Codex or Claude Code and start building.
Add a revenue chart from the DataFrame result. Keep Python running in Linux.Already have a project? Install the plugin
codex plugin marketplace add spacia-ai/oxvm-skillscodex plugin add oxvm@oxvmclaude plugin install oxvm --marketplace spacia-ai/oxvm-skillsFor existing projects. The starter needs no extra installation. Use current Codex or Claude Code.
Add the SDK to an existing app
Section titled “Add the SDK to an existing app”If you already have a Vite app, follow the steps below to write a file into a VM’s workspace and read it back with a Linux program.
Local development needs no account or token. Before publishing this app, register a public license and pass its token as runtime.license.
-
Install the SDK.
Terminal window npm install @oxvm/sdkThe package contains no engine or guest image. The hosted runtime downloads the explicitly selected signed image in the browser. Use the
src/image.tsreference from a starter generated with the same SDK release, or copy the trusted reference below to your app’ssrc/image.ts. It includes the manifest hash and independent author key. A custom image build is optional.Image recipe for SDK 0.0.34 · Complete build and deployment guide · Signed starter image reference
-
Serve with the right headers. The engine needs a cross-origin isolated page, so every response needs two headers. In Vite:
vite.config.ts import { defineConfig } from "vite";const headers = {"Cross-Origin-Opener-Policy": "same-origin","Cross-Origin-Embedder-Policy": "require-corp",};export default defineConfig({optimizeDeps: { exclude: ["@oxvm/sdk"] }, // keeps the SDK's worker URLs intactworker: { format: "es" },server: { headers },preview: { headers },});Restart the dev server, open your app and check that
crossOriginIsolatedistruein the browser console. -
Create your first VM. Call
createVMfrom browser code, never during server rendering:src/main.ts import { createVM } from "@oxvm/sdk";import image from "./image.js";const vm = await createVM({ mode: "userspace", runtime: { hosting: "frame" }, image });try {await vm.workspace.writeText("hello.txt", "Hello from Linux\n");const result = await vm.exec({ command: "cat", args: ["hello.txt"] });console.log(new TextDecoder().decode(result.stdout), result.exit);} finally {await vm.dispose();}runtime: { hosting: "frame" }runs the engine in a hidden frame fromhttps://run.oxvm.dev, which also serves the default image.Run the same two steps on this page’s own VM:
Write a file, read it backUserspaceNot started Hello from Linuxexit: {"kind":"exited","code":0}
Downloads Linux into this tab when you click.
What you have now
Section titled “What you have now”vm.workspacereads and writes files under/workspacein the VM. See Workspace files.vm.execruns a short command and returns its output and exit status. See Run commands.result.exitis{ kind: "exited", code }or{ kind: "signaled", signal, signalNumber }. A non-zero exit code is a normal result, not an error.- Your site serves only your app. Deploying covers the headers on your host, a Content Security Policy, and serving the engine yourself.
Next, open an interactive terminal or decide between Userspace and System.