Control & limits

Run-length limits

Tell a VM how long and how much CPU it may use; it stops itself when it reaches either.

What it is

Tell a VM how long and how much CPU it may use.

Set a wall-clock budget with --max-wall-s and a CPU-time budget with --max-cpu-s when the FlashVM is created. When it reaches either, it stops itself. Limits can be lowered while it runs, never raised.

Why it matters

A runaway job should never need someone to notice it. FlashVMM ends it on schedule.

  • Self-stopping. The VM ends itself at its limit, with nobody watching.
  • Two budgets. Wall-clock time and CPU time.
  • Tamper-proof. Nothing inside the VM can extend its own budget.

Runs on

  • Linux x86_64
  • Linux arm64
  • macOS
  • Windows x64
  • Windows arm64

How it works

Set the budgets at creation; tighten them live.

CLI

flash run --bundle /opt/flashvm/bundles/current --id vm1 --vcpus 1 --mem-mib 256 --max-wall-s 300 --max-cpu-s 120 --entry 'sleep 3600' --detach
flash inspect vm1
flash set vm1 --max-wall-s 60

MCP

flash_inspect(vm_id: "vm1")

API

GET /v1/flashvm/limits
PATCH /v1/flashvm/limits {"max_wall_s": 60}

The result

The VM stops itself at its limit, and a request to raise it is refused.

Every sandbox has a hard end, set by whoever started it.

How it works

Related

See it live: flash demo run 8