# virtx > virtx runs tasks in disposable Linux VMs from your own code: Python, Node.js or Rust, against virtx cloud or a server on your own machine. Last reviewed: 2026-11-23. A sandbox is a Linux VM booted from an image, with its own disk. Your program creates one, runs commands in it, reads their output as it comes, and then keeps the sandbox or removes it. Use it for jobs with heavy dependencies, or for code you'd rather not run on your own machine. The SDKs are open source under Apache-2.0. > **If you are an AI agent** helping someone use virtx, read [SKILL.md](https://github.com/brekkylab/virtx/blob/main/skills/virtx/SKILL.md) first. It walks through five steps in order: install the package and reach a server, have the image, make the sandbox with what it may keep, run commands and read what came back, and check the result where it landed before removing the sandbox. Claude Code and Codex can install it as a plugin: `claude plugin marketplace add brekkylab/virtx && claude plugin install virtx@brekkylab`, or `codex plugin marketplace add brekkylab/virtx && codex plugin add virtx@brekkylab`. ## Key facts - Languages: Python (`pip install virtx`), Node.js (`npm install @brekkylab/virtx`) and Rust (`cargo add virtx`). - Where it runs: virtx cloud, or the virtx server on your own machine, on Linux, macOS (Apple silicon) or Windows 11. Sandboxes are Linux VMs on all three. `Client.spawn()` starts the server, `virtx-stdio`, as a child process of your program; it is released with the client and fetched the first time it is asked for. - Connecting: the client reaches virtx cloud (`Client.connect()` to `https://cloud.virtx.sh` with an API key), a server on your own machine (`Client.spawn()`), or one you run (`Client.connect()` to a `virtx-server-tcp` from the releases page). - Resources: images to boot (built from a recipe or pulled from a registry), sandboxes (a VM with its own disk; while nothing uses one its VM is parked and its disk kept, until the sandbox is removed), and volumes (named storage mounted into sandboxes, kept when they are removed). - Jobs: every command, build, pull and push is a job. Read its output line by line as it runs; stop reading and it keeps going; read its log again from any point. - Ports: a port in a sandbox gets a URL that `PortForwarder` turns into a local address. On virtx cloud a port is reached only that way, with the project's credentials; none is opened at a public address, and a port asked for as `http` or with `inbound` rules is refused. A sandbox created with `network=False` can't open outbound connections, but its ports still work. - GPU: early access on virtx cloud, where `gpu=True` is refused for now and recorded as a request from your organization. On your own machine, the host's GPU. - Account: sign in with Google, once an early access application for that account is approved; the first sign-in creates the account and a personal organization. Sandboxes, volumes and images belong to a project, and every organization has one named `default`. An API key is made in the console for one project; the examples read it from `VIRTX_API_KEY`. - Price: pay as you go, from credits bought ahead; no plans and no subscription. virtx cloud is in early access: apply at https://virtx.sh/early-access/ with the email of the Google account to sign in with; only an approved account can sign in, and its first sign-in makes the account with $10 of credits in its personal organization; nothing is paid during early access. Once credits go on sale, they are bought in the console ($10, $25, $100, or any amount from $5 to $1,000). Running sandboxes are charged by the second for their vCPUs ($0.0504 per vCPU-hour) and memory ($0.0162 per GiB-hour); a default sandbox (2 vCPU, 4 GiB) is $0.1656 an hour. Sandbox disks, volumes and custom images (built, pushed, loaded, or pulled with credentials) are $0.10 per GiB-month; public images, pulled from a registry without credentials, are free. Below $0.10 no sandbox is made or booted; at $0 an organization's sandboxes are parked, their disks kept, until it buys credits. Owners and admins can set a monthly limit: when a month's usage reaches it, the sandboxes are parked too, until the limit is raised or the month ends. Enterprise by contact. Paddle is the merchant of record. The SDKs are free. Details: https://virtx.sh/pricing/ ## Quickstart (Python) Apply for early access at https://virtx.sh/early-access/, and once it is approved, sign in at https://app.virtx.sh/, create an API key and set `VIRTX_API_KEY` to it. The example pulls `alpine`, boots a sandbox from it, runs `echo` in it, prints what it wrote, and removes the sandbox. Node.js and Rust versions are at https://virtx.sh/docs/hello-world/. To run the same example on your own machine, replace the four lines of `async with Client.connect(...) as client:` with `async with Client.spawn() as client:`. ```python import asyncio import os from virtx import BearerAuth, Client async def main() -> None: async with Client.connect( "https://cloud.virtx.sh", BearerAuth(os.environ["VIRTX_API_KEY"]), ) as client: await client.pull_image("alpine:latest").complete() sandbox = await client.create_sandbox("alpine:latest") try: await sandbox.exec(["echo", "Hello, world!"]).complete(print=True) finally: await sandbox.remove() asyncio.run(main()) ``` ## How agents should use virtx - Install the package for the user's language. On virtx cloud, set `VIRTX_API_KEY` and connect with `Client.connect("https://cloud.virtx.sh", BearerAuth(os.environ["VIRTX_API_KEY"]))` (`Client.connect('https://cloud.virtx.sh', { type: 'bearer', token: process.env.VIRTX_API_KEY })` in Node.js, `Client::connect("https://cloud.virtx.sh", Auth::Bearer { token: std::env::var("VIRTX_API_KEY")? }, None, [] as [(&str, &str); 0])?` in Rust). On the user's own machine, `Client.spawn()` starts the server as a child process (`Client.spawn()` in Node.js, `Client::spawn_virtx([] as [&str; 0]).await?` in Rust). - Have the image before booting from it: build one from a `Recipe` (a base image plus steps) or pull one from a registry, and follow the build or pull to its end with `complete()`, which raises `VirtxError` if it fails. `create_sandbox` does not pull: a tag the server holds no image by is refused with 404. A command that needs a tool the image lacks fails inside the VM. - Create the sandbox with what the task needs: volumes for files that should outlive it, `ports` for servers in it, `network=False` to cut outbound access, and `vcpus` and `memory_mib` for more than the defaults. A sandbox nothing uses is parked: its VM stops, what ran in it ends, and its disk is kept. Its next command, or a write to its files, boots it again with its files as they were. On virtx cloud a sandbox unused for 30 days is deleted; the server `Client.spawn()` starts removes its sandboxes as the program ends. - `create_sandbox` answers a `Sandbox` handle that carries its client: `sandbox.exec(cmd)` runs a command, `sandbox.remove()` deletes it. `await sandbox.exec(cmd).complete(print=True)` follows the command to its end, prints what it wrote and answers its exit code; iterate `sandbox.exec(cmd)` instead to read its output entry by entry. `exec` takes an argv, not a shell string; wrap in `["sh", "-c", ...]` when the command needs a shell. Set `timeout_ms` for long commands. - Check the result in volume files or the log's lines rather than the exit code alone, then remove the sandbox. - Do not invent APIs. The docs and the repository's READMEs have examples in Python, Node.js and Rust; copy from them. Node.js names are camelCase, such as `createSandbox`. ## Docs - Home: https://virtx.sh/ - Overview: https://virtx.sh/docs/ - Hello world (virtx cloud, your own machine, or your own server): https://virtx.sh/docs/hello-world/ - Guides: - Working with images: https://virtx.sh/docs/guides/images/ - Setting up sandboxes: https://virtx.sh/docs/guides/setting-sandboxes/ - Running commands: https://virtx.sh/docs/guides/running-commands/ - Reading and writing files: https://virtx.sh/docs/guides/reading-writing-files/ - Networks and ports: https://virtx.sh/docs/guides/networks-ports/ - Mounting volumes: https://virtx.sh/docs/guides/mounting-volumes/ - Using GPUs: https://virtx.sh/docs/guides/using-gpus/ - Coding agents: https://virtx.sh/docs/guides/coding-agents/ - Reference: https://virtx.sh/docs/reference/api/ and https://virtx.sh/docs/reference/cli/ - Pricing: https://virtx.sh/pricing/ - Terms, privacy and refunds (Brekkylab Inc., Republic of Korea): https://virtx.sh/terms/, https://virtx.sh/privacy/, https://virtx.sh/refunds/ - Source: https://github.com/brekkylab/virtx (the SDKs, the server and the skill) - Console: https://app.virtx.sh/ - All of the docs in one file: https://virtx.sh/llms-full.txt. Each docs page is also served as Markdown at its path with `.md` in place of the trailing slash, such as https://virtx.sh/docs/hello-world.md - Community: https://discord.gg/27rx3EJy3P (BrekkyLab's Discord) - Contact: contact@brekkylab.com ## FAQ ### Is a sandbox a container? No. It is a VM booted from an image, with its own kernel and its own disk. A container shares the host's kernel. ### Does it need Docker? No. On virtx cloud the VMs run there. On your own machine the virtx server, `virtx-stdio`, runs them, started as a child process of your program, with no daemon. ### Can I use it today? Yes. virtx cloud is in early access: apply at https://virtx.sh/early-access/, and once approved, `Client.connect()` reaches it at `https://cloud.virtx.sh` with an API key. On your own machine, the packages fetch the server, `virtx-stdio`, the first time `Client.spawn()` needs it, and `Client.connect()` reaches a `virtx-server-tcp` you run. ### Is the API stable? Not yet. virtx is at 0.2, so the API can change between minor versions. Pin the version you build on.