REST API reference
Overview
Base URL: /api/v1/
Content-Type: All requests and responses use application/json
Versioning: Via the URL path (v1)
Authentication
The API uses two authentication methods:
1. Session Cookies (API key bootstrap)
The three /api/v1/auth/apikeys endpoints use the same session cookies as the web UI. You can also create API keys from the Profile page.
2. Bearer Token (everything else)
All other endpoints require an API key as a Bearer token:
Authorization: Bearer vmk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Admin-only endpoints additionally require the key to belong to an admin user.
Getting Started
- Go to Profile and create an API key
- Copy the key (it's only shown once)
- Use it in the
Authorizationheader for API calls
Client Examples
Complete working examples in four languages. Replace YOUR_API_KEY and your-server with your actual values.
List VMs
curl -sk https://your-server/api/v1/vms \ -H 'Authorization: Bearer YOUR_API_KEY'
import requests
API = "https://your-server/api/v1"
KEY = "YOUR_API_KEY"
headers = {"Authorization": f"Bearer {KEY}"}
vms = requests.get(f"{API}/vms", headers=headers, verify=False).json()
for vm in vms:
print(f"{vm['name']:20s} {vm['state']:10s} {vm.get('ip', 'N/A')}")
package main
import (
"crypto/tls"
"encoding/json"
"fmt"
"net/http"
)
func main() {
api := "https://your-server/api/v1"
key := "YOUR_API_KEY"
client := &http.Client{
Transport: &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
},
}
req, _ := http.NewRequest("GET", api+"/vms", nil)
req.Header.Set("Authorization", "Bearer "+key)
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
var vms []map[string]any
json.NewDecoder(resp.Body).Decode(&vms)
for _, vm := range vms {
fmt.Printf("%-20s %-10s %s\n", vm["name"], vm["state"], vm["ip"])
}
}
# Skip TLS verification for self-signed certs
$SkipCert = [System.Net.ServicePointManager]::ServerCertificateValidationCallback = { $true }
$Api = "https://your-server/api/v1"
$Headers = @{ "Authorization" = "Bearer YOUR_API_KEY" }
$Vms = Invoke-RestMethod -Uri "$Api/vms" -Headers $Headers -SkipCertificateCheck
$Vms | Format-Table name, state, ip -AutoSize
Launch a VM
curl -sk https://your-server/api/v1/vms \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "dev-box",
"size": "medium",
"os": "ubuntu-24.04",
"disk_gb": 40
}'
resp = requests.post(f"{API}/vms", headers=headers, verify=False, json={
"name": "dev-box",
"size": "medium",
"os": "ubuntu-24.04",
"disk_gb": 40,
})
result = resp.json()
print(f"VM {result['name']} is {result['status']}")
print(f"Password: {result['password']}")
body := strings.NewReader(`{
"name": "dev-box",
"size": "medium",
"os": "ubuntu-24.04",
"disk_gb": 40
}`)
req, _ := http.NewRequest("POST", api+"/vms", body)
req.Header.Set("Authorization", "Bearer "+key)
req.Header.Set("Content-Type", "application/json")
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
var result map[string]any
json.NewDecoder(resp.Body).Decode(&result)
fmt.Printf("VM %s is %s (password: %s)\n",
result["name"], result["status"], result["password"])
$Body = @{
name = "dev-box"
size = "medium"
os = "ubuntu-24.04"
disk_gb = 40
} | ConvertTo-Json
$Result = Invoke-RestMethod -Uri "$Api/vms" -Method Post `
-Headers $Headers -Body $Body -ContentType "application/json" `
-SkipCertificateCheck
Write-Host "VM $($Result.name) is $($Result.status)"
Write-Host "Password: $($Result.password)"
Launch with User Script (cloud-init)
Pass a user_script field to run a script on first boot via cloud-init. The script runs as root after the VM is provisioned.
How the script runs: on on-prem VMs virtuOSo adds it to cloud-init as one runcmd script that cloud-init runs with /bin/sh. A #!/bin/bash first line has no effect there, and bash-only syntax can abort the script, so call bash explicitly when you need it. AWS instances receive it in a bash user-data file that stops at the first failing command. If Tailscale is configured, virtuOSo appends its own install and join commands after your script, so your script runs before the VM is on the tailnet. To run commands that need the tailnet, use post_tailscale_script (see the Tailscale guide).
curl -sk https://your-server/api/v1/vms \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "docker-host",
"size": "medium",
"os": "ubuntu-24.04",
"disk_gb": 40,
"user_script": "#!/bin/bash\napt-get update\napt-get install -y docker.io\nsystemctl enable --now docker"
}'
script = """#!/bin/bash
apt-get update
apt-get install -y docker.io
systemctl enable --now docker
"""
resp = requests.post(f"{API}/vms", headers=headers, verify=False, json={
"name": "docker-host",
"size": "medium",
"os": "ubuntu-24.04",
"disk_gb": 40,
"user_script": script,
})
print(resp.json())
body := strings.NewReader(`{
"name": "docker-host",
"size": "medium",
"os": "ubuntu-24.04",
"disk_gb": 40,
"user_script": "#!/bin/bash\napt-get update\napt-get install -y docker.io\nsystemctl enable --now docker"
}`)
req, _ := http.NewRequest("POST", api+"/vms", body)
req.Header.Set("Authorization", "Bearer "+key)
req.Header.Set("Content-Type", "application/json")
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
var result map[string]any
json.NewDecoder(resp.Body).Decode(&result)
fmt.Printf("VM %s is %s\n", result["name"], result["status"])
$Script = @"
#!/bin/bash
apt-get update
apt-get install -y docker.io
systemctl enable --now docker
"@
$Body = @{
name = "docker-host"
size = "medium"
os = "ubuntu-24.04"
disk_gb = 40
user_script = $Script
} | ConvertTo-Json
$Result = Invoke-RestMethod -Uri "$Api/vms" -Method Post `
-Headers $Headers -Body $Body -ContentType "application/json" `
-SkipCertificateCheck
Write-Host "VM $($Result.name) is $($Result.status)"
Launch from ISO
Boot a VM from a custom ISO file. Upload ISOs via the Settings page (Storage tab), then reference the full path. VNC is automatically enabled for ISO boots.
curl -sk https://your-server/api/v1/vms \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "custom-os",
"size": "medium",
"iso": "/var/lib/vm-lab/vms/isos/ubuntu-server.iso"
}'
resp = requests.post(f"{API}/vms", headers=headers, verify=False, json={
"name": "custom-os",
"size": "medium",
"iso": "/var/lib/vm-lab/vms/isos/ubuntu-server.iso",
})
print(resp.json())
Launch with Bridged Networking
Use bridged: true to place the VM on the LAN with a real IP from your router's DHCP, instead of the default NAT network. Requires a host bridge (br0) to be configured on the server.
curl -sk https://your-server/api/v1/vms \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "lan-server",
"size": "medium",
"os": "ubuntu-24.04",
"bridged": true
}'
resp = requests.post(f"{API}/vms", headers=headers, verify=False, json={
"name": "lan-server",
"size": "medium",
"os": "ubuntu-24.04",
"bridged": True,
})
print(resp.json())
VM Lifecycle (start, stop, restart, kill, delete)
# Start curl -sk -X POST https://your-server/api/v1/vms/dev-box/start \ -H 'Authorization: Bearer YOUR_API_KEY' # Stop (graceful shutdown) curl -sk -X POST https://your-server/api/v1/vms/dev-box/stop \ -H 'Authorization: Bearer YOUR_API_KEY' # Restart curl -sk -X POST https://your-server/api/v1/vms/dev-box/restart \ -H 'Authorization: Bearer YOUR_API_KEY' # Kill (force stop) curl -sk -X POST https://your-server/api/v1/vms/dev-box/kill \ -H 'Authorization: Bearer YOUR_API_KEY' # Delete curl -sk -X DELETE https://your-server/api/v1/vms/dev-box \ -H 'Authorization: Bearer YOUR_API_KEY'
# Start
requests.post(f"{API}/vms/dev-box/start", headers=headers, verify=False)
# Stop (graceful shutdown)
requests.post(f"{API}/vms/dev-box/stop", headers=headers, verify=False)
# Restart
requests.post(f"{API}/vms/dev-box/restart", headers=headers, verify=False)
# Kill (force stop)
requests.post(f"{API}/vms/dev-box/kill", headers=headers, verify=False)
# Delete
requests.delete(f"{API}/vms/dev-box", headers=headers, verify=False)
// Helper function for simple actions
func vmAction(client *http.Client, api, key, vm, action, method string) error {
url := fmt.Sprintf("%s/vms/%s", api, vm)
if action != "" {
url += "/" + action
}
req, _ := http.NewRequest(method, url, nil)
req.Header.Set("Authorization", "Bearer "+key)
resp, err := client.Do(req)
if err != nil {
return err
}
resp.Body.Close()
return nil
}
vmAction(client, api, key, "dev-box", "start", "POST") // Start
vmAction(client, api, key, "dev-box", "stop", "POST") // Stop
vmAction(client, api, key, "dev-box", "restart", "POST") // Restart
vmAction(client, api, key, "dev-box", "kill", "POST") // Kill
vmAction(client, api, key, "dev-box", "", "DELETE") // Delete
# Start
Invoke-RestMethod -Uri "$Api/vms/dev-box/start" -Method Post `
-Headers $Headers -SkipCertificateCheck
# Stop (graceful shutdown)
Invoke-RestMethod -Uri "$Api/vms/dev-box/stop" -Method Post `
-Headers $Headers -SkipCertificateCheck
# Restart
Invoke-RestMethod -Uri "$Api/vms/dev-box/restart" -Method Post `
-Headers $Headers -SkipCertificateCheck
# Kill (force stop)
Invoke-RestMethod -Uri "$Api/vms/dev-box/kill" -Method Post `
-Headers $Headers -SkipCertificateCheck
# Delete
Invoke-RestMethod -Uri "$Api/vms/dev-box" -Method Delete `
-Headers $Headers -SkipCertificateCheck
Full Python Script Example
#!/usr/bin/env python3
"""virtuOSo API client example. Launch a VM, wait for it, then SSH in."""
import requests, time
API = "https://your-server/api/v1"
KEY = "YOUR_API_KEY"
s = requests.Session()
s.headers["Authorization"] = f"Bearer {KEY}"
s.verify = False
# Launch a VM
resp = s.post(f"{API}/vms", json={
"name": "test-vm",
"size": "small",
"os": "ubuntu-24.04",
})
print(f"Launched: {resp.json()}")
# Poll until it's running and has an IP
for _ in range(60):
vm = s.get(f"{API}/vms/test-vm").json()
if vm.get("ip") and vm["state"] == "running" and vm.get("cloud_init") == "done":
print(f"Ready! IP: {vm['ip']}, password: {vm.get('password', 'N/A')}")
break
time.sleep(5)
else:
print("Timed out waiting for VM")
# Clean up
# s.delete(f"{API}/vms/test-vm")
Error Format
All errors return JSON with error and status fields:
{"error": "VM not found", "status": 404}
| Status | Meaning |
|---|---|
| 400 | Bad request (invalid input) |
| 401 | Unauthorized (missing or invalid auth) |
| 403 | Forbidden (admin access required) |
| 404 | Not found |
| 409 | Conflict (duplicate name) |
| 500 | Internal server error |
Quick Reference
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| POST | /api/v1/auth/apikeys | Session | Create API key |
| GET | /api/v1/auth/apikeys | Session | List API keys |
| DELETE | /api/v1/auth/apikeys/{id} | Session | Delete API key |
| GET | /api/v1/me | API Key | Current user info |
| GET | /api/v1/vms | API Key | List VMs |
| POST | /api/v1/vms | API Key | Launch VM |
| GET | /api/v1/vms/{name} | API Key | Get VM details |
| DELETE | /api/v1/vms/{name} | API Key | Delete VM |
| POST | /api/v1/vms/{name}/start | API Key | Start VM |
| POST | /api/v1/vms/{name}/stop | API Key | Graceful shutdown |
| POST | /api/v1/vms/{name}/kill | API Key | Force stop |
| POST | /api/v1/vms/{name}/restart | API Key | Reboot VM |
| POST | /api/v1/vms/{name}/resize | API Key | Resize disk |
| PUT | /api/v1/vms/{name}/autostart | API Key | Set autostart |
| PUT | /api/v1/vms/{name}/network | API Key | Change network mode |
| PUT | /api/v1/vms/{name}/protected | API Key | Set delete protection |
| GET | /api/v1/vms/{name}/notes | API Key | Get a VM's notes |
| PUT | /api/v1/vms/{name}/notes | API Key | Replace a VM's notes |
| GET | /api/v1/users | Admin | List users |
| POST | /api/v1/users | Admin | Create user |
| GET | /api/v1/users/{id} | Admin | Get user |
| DELETE | /api/v1/users/{id} | Admin | Delete user |
| PUT | /api/v1/users/{id}/password | Admin | Reset password |
| GET | /api/v1/vms/{name}/access | Admin | List VM access |
| POST | /api/v1/vms/{name}/access | Admin | Grant access |
| DELETE | /api/v1/vms/{name}/access/{user_id} | Admin | Revoke access |
| GET | /api/v1/sshkeys | API Key | List SSH keys |
| POST | /api/v1/sshkeys | API Key | Add SSH key |
| DELETE | /api/v1/sshkeys/{id} | API Key | Delete SSH key |
| GET | /api/v1/stacks | API Key | List stacks |
| POST | /api/v1/stacks | API Key | Create a stack |
| GET | /api/v1/stacks/{name} | API Key | Get stack |
| PUT | /api/v1/stacks/{name} | API Key | Update stack template |
| DELETE | /api/v1/stacks/{name} | API Key | Delete stack |
| POST | /api/v1/stacks/{name}/deploy | API Key | Deploy stack VMs |
| POST | /api/v1/stacks/{name}/destroy | API Key | Tear down stack VMs |
| GET | /api/v1/secrets | API Key | List global secrets (metadata only) |
| POST | /api/v1/secrets | API Key | Create a global secret |
| GET | /api/v1/secrets/{id}/value | API Key | Reveal a global secret |
| PUT | /api/v1/secrets/{id} | API Key | Update a global secret |
| DELETE | /api/v1/secrets/{id} | API Key | Delete a global secret |
| GET | /api/v1/stacks/{name}/secrets | API Key | List per-stack secrets |
| POST | /api/v1/stacks/{name}/secrets | API Key | Create a per-stack secret |
| GET | /api/v1/stacks/{name}/secrets/{id}/value | API Key | Reveal a per-stack secret |
| PUT | /api/v1/stacks/{name}/secrets/{id} | API Key | Update a per-stack secret |
| DELETE | /api/v1/stacks/{name}/secrets/{id} | API Key | Delete a per-stack secret |
| GET | /api/v1/stack-templates | API Key | List saved templates |
| POST | /api/v1/stack-templates | API Key | Save a template |
| DELETE | /api/v1/stack-templates/{id} | API Key | Delete a saved template |
| GET | /api/v1/apps/k8s/clusters | Admin | List Kubernetes clusters |
| POST | /api/v1/apps/k8s/clusters | Admin | Create a cluster |
| GET | /api/v1/apps/k8s/clusters/{name} | Admin | Get a cluster and its workers |
| DELETE | /api/v1/apps/k8s/clusters/{name} | Admin | Delete a cluster |
| POST | /api/v1/apps/k8s/clusters/{name}/scale | Admin | Set the worker count |
| POST | /api/v1/apps/k8s/clusters/{name}/addons | Admin | Install ArgoCD, Headlamp or k9s |
| GET | /api/v1/apps/k8s/clusters/{name}/credentials | Admin | ArgoCD password and Headlamp token |
| GET | /api/v1/apps/k8s/clusters/{name}/kubeconfig | Admin | Download the kubeconfig |
| GET | /api/v1/apps/docker/instances | Admin | List Docker instances |
| POST | /api/v1/apps/docker/instances | Admin | Create a Docker instance |
| GET | /api/v1/apps/docker/instances/{name} | Admin | Get a Docker instance |
| DELETE | /api/v1/apps/docker/instances/{name} | Admin | Delete a Docker instance |
| GET | /api/v1/host | Admin | Host CPU, memory and VM storage, plus resources allocated to VMs |
| GET | /api/v1/fleet/nodes | Admin | List the other servers in the fleet with status, resources and VM counts |
| POST | /api/v1/fleet/nodes | Admin | Add a server to the fleet (returns 201) |
| DELETE | /api/v1/fleet/nodes/{id} | Admin | Remove a server from the fleet (its VMs are not touched) |
| POST | /api/v1/fleet/nodes/{id}/trust-certificate | Admin | Trust the certificate a server presents now |
| POST | /api/v1/fleet/refresh | Admin | Check every server now |
| GET | /api/v1/fleet/vms | Admin | List VMs across all servers, filter with node and provider |
| POST | /api/v1/fleet/aws/instances | Admin | Launch an EC2 instance (costs money, returns 202) |
| DELETE | /api/v1/fleet/aws/instances/{id} | Admin | Terminate an instance launched from Fleet and remove its security groups |
| POST | /api/v1/fleet/aws/instances/{id}/keep | Admin | Cancel an instance's automatic termination |
| POST | /api/v1/fleet/aws/instances/{id}/extend | Admin | Add hours or days to an instance's automatic termination |
| GET | /api/v1/fleet/aws | Admin | EC2 instances virtuOSo launched in this server's AWS account, with an estimated cost |
| GET | /api/v1/fleet/placement | Admin | Rank this server and every node by room for a new VM |
| POST | /api/v1/fleet/vms | Admin | Launch a cloud image VM on the best fit or a chosen server |
| GET | /api/v1/fleet/move/check | Admin | Say whether a VM can move to another server, and for how long it would be stopped |
| POST | /api/v1/fleet/move | Admin | Move a VM to another server (returns a move to follow, 202) |
| GET | /api/v1/fleet/moves | Admin | Recent moves, newest first |
| GET | /api/v1/fleet/moves/{id} | Admin | One move: its state, step, new address, or why it failed |
| POST | /api/v1/fleet/moves/{id}/cancel | Admin | Cancel a move that is running; it puts everything back |
| DELETE | /api/v1/fleet/vms/{node}/{name} | Admin | Delete a stopped VM on a fleet server, with its disk and snapshots (send confirm=true) |
| GET | /api/v1/fleet/held | Admin | The originals of moved VMs being kept, across every server, with the space they use |
| POST | /api/v1/fleet/held/{node}/{id}/restore | Admin | Bring a held original back, stopped and with its schedule off |
| DELETE | /api/v1/fleet/held/{node}/{id} | Admin | Delete a held original for good, to free its space |
| PUT | /api/v1/fleet/manager | Admin | Tell this server which server manages it, used by Fleet |
| DELETE | /api/v1/fleet/manager | Admin | Let this server go from its manager, used by Fleet |
| POST | /api/v1/sso/tickets | Admin | One time sign in ticket for the key's owner, used by Fleet |
| GET | /api/v1/vms/{name}/schedule | API Key | Get a VM's start and stop schedule |
| PUT | /api/v1/vms/{name}/schedule | API Key | Create or replace the schedule |
| DELETE | /api/v1/vms/{name}/schedule | API Key | Remove the schedule |
| GET | /api/v1/schedules | Admin | List all schedules |
| GET | /api/v1/vms/{name}/snapshots | API Key | List a VM's snapshots |
| POST | /api/v1/vms/{name}/snapshots | API Key | Take a snapshot (returns 202) |
| DELETE | /api/v1/vms/{name}/snapshots/{id} | API Key | Delete a snapshot |
| POST | /api/v1/vms/{name}/snapshots/{id}/restore | API Key | Restore a VM to a snapshot (returns 202) |
| GET | /api/v1/snapshots | Admin | List all snapshots |
| GET | /api/v1/vms/{name}/restore-policy | API Key | Get a VM's restore point policy |
| PUT | /api/v1/vms/{name}/restore-policy | API Key | Create or replace the policy |
| DELETE | /api/v1/vms/{name}/restore-policy | API Key | Remove the policy |
| GET | /api/v1/restore-policies | Admin | List all policies |
API Keys
API key management uses session cookie auth (not Bearer tokens). Create keys from the Profile page or via these endpoints.
Create API Key
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Display name (unique per user) |
Response 201 Created:
{"id": 1, "name": "my-key", "prefix": "vmk_a1b2c3d4", "key": "vmk_a1b2c3d4e5f6...", "created_at": "..."}
key value is only returned at creation time. Store it securely.List API Keys
Response 200 OK:
[{"id": 1, "name": "my-key", "prefix": "vmk_a1b2c3d4", "created_at": "...", "last_used": "..."}]
Delete API Key
Response 200 OK: {"ok": true}
Current User
Get Current User
Response 200 OK:
{"id": 1, "username": "admin", "role": "admin", "created_at": "..."}
VMs
Admins see all VMs. Regular users only see VMs they've been granted access to.
List VMs
Response 200 OK:
[{
"name": "web-server", "state": "running", "ip": "192.0.2.45",
"vcpus": 1, "memory_mb": 2048, "autostart": false, "has_vnc": false,
"disk_cap_gb": 50.0, "disk_used_gb": 4.2, "cloud_init": "done",
"network": "default", "protected": false
}]
network field is "default" for NAT or "bridge:br0" for bridged networking. The protected field indicates delete protection. Protected VMs cannot be deleted until protection is disabled.Launch VM
Launches asynchronously. Returns immediately with status "creating".
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | Yes | None | VM name (alphanumeric + hyphens) |
size | string | No | small | micro, small, medium, large, xlarge, 2xlarge, 3xlarge, 4xlarge |
os | string | No* | None | ubuntu-26.04, ubuntu-24.04, ubuntu-22.04, fedora-43, amazon-2023 (append +desktop for GUI). Required unless iso is set |
iso | string | No | None | Absolute path to an ISO file on the server. When set, the VM boots from the ISO instead of a cloud image (os is ignored, VNC is auto-enabled). ISOs uploaded via Settings are stored in /var/lib/vm-lab/vms/isos/ |
ssh_key | string | No | None | SSH public key to inject |
disk_gb | int | No | size default | Disk size in GB. When left out, the disk is the size's default: 50 GB for micro, small and medium, 100 GB for large and xlarge, 200 GB for 2xlarge and 3xlarge, 500 GB for 4xlarge |
password | string | No | auto | VM user password |
vnc | bool | No | false | Enable VNC graphics |
desktop | bool | No | false | Desktop environment (implies VNC) |
user_script | string | No | None | Cloud-init script for first boot |
post_tailscale_script | string | No | None | Bash script that runs once after Tailscale connects, via a systemd one-shot unit that survives reboots. Sees TS_IP and TS_DNSNAME. Retried at the next boot if it fails, so make it safe to run twice. |
bridged | bool | No | false | Use bridged networking instead of NAT (on-prem only) |
provider | string | No | libvirt | Infrastructure provider: libvirt (on-prem) or aws |
region | string | No | default | AWS region (e.g. us-east-1). VPC and subnet are auto-provisioned. Only used when provider is aws |
Response 202 Accepted:
{"name": "dev-box", "password": "auto-generated-or-provided", "status": "creating", "provider": "libvirt"}
Launch VM on AWS
curl -X POST https://YOUR_HOST/api/v1/vms \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "web-server", "os": "ubuntu-24.04", "size": "medium", "provider": "aws", "region": "us-east-1"}'
When provider is aws, virtuOSo automatically creates a VPC with public subnets if one doesn't exist in the region. See AWS Provider docs for IAM setup.
Get VM Details
Response 200 OK:
{
"name": "web-server", "state": "running", "ip": "192.0.2.45",
"vcpus": 1, "memory_mb": 2048, "autostart": false, "has_vnc": false,
"disk_cap_gb": 50.0, "disk_used_gb": 4.2, "cloud_init": "done",
"network": "default", "protected": false,
"password": "the-vm-password", "os_id": "ubuntu-24.04",
"notes": "Owner: ops team"
}
notes (empty string if none). The list response does not, because notes can be large.Delete VM
Stops and permanently deletes the VM and its disk.
Response 200 OK: {"ok": true}
Start VM
Response 200 OK: {"ok": true}
Stop VM
Graceful shutdown (ACPI power button).
Response 200 OK: {"ok": true}
Kill VM
Force-stops immediately.
Response 200 OK: {"ok": true}
Restart VM
This endpoint asks the guest to reboot gracefully. The MCP restart_vm tool is different: it force-stops the VM and then starts it.
Response 200 OK: {"ok": true}
Resize VM Disk
VM must be shut off. Disk can only be grown, not shrunk.
| Field | Type | Required | Description |
|---|---|---|---|
size_gb | int | Yes | New total disk size in GB |
Response 200 OK: {"ok": true}
Set Autostart
| Field | Type | Required | Description |
|---|---|---|---|
enabled | bool | Yes | true to enable, false to disable |
Response 200 OK: {"ok": true}
Change Network Mode
VM must be shut off. Switches between NAT and bridged networking.
| Field | Type | Required | Description |
|---|---|---|---|
network | string | Yes | "default" for NAT, or "bridge:br0" for bridged |
Response 200 OK: {"ok": true}
Set Delete Protection
Enables or disables delete protection. Protected VMs cannot be deleted until protection is removed.
| Field | Type | Required | Description |
|---|---|---|---|
protected | bool | Yes | true to enable, false to disable |
Response 200 OK: {"ok": true}
Get VM Notes
Returns the free text (Markdown) notes shown on the VM detail page. Response 200 OK: {"vm": "web-server", "notes": "Owner: ops team"}. Returns 404 if the VM does not exist or you do not have access to it.
Set VM Notes
Replaces the VM's notes. The text is stored exactly as sent. Notes are never cut short: text over 64 KB is refused with 413, and text that is not valid UTF-8 is refused with 400.
| Field | Type | Required | Description |
|---|---|---|---|
notes | string | Yes | The full notes text. An empty string clears the notes. A request without this field is refused, so a mistake cannot wipe them |
Response 200 OK: {"vm": "web-server", "notes": "..."}
Users (Admin Only)
These endpoints require an API key belonging to an admin user.
List Users
Response 200 OK:
[{"id": 1, "username": "admin", "role": "admin", "created_at": "...", "updated_at": "..."}]
Create User
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
username | string | Yes | None | Username (unique) |
password | string | Yes | None | Password (min 6 chars) |
role | string | No | user | admin or user |
Response 201 Created:
{"id": 3, "username": "newuser", "role": "user"}
Get User
Response 200 OK:
{"id": 2, "username": "dev", "role": "user", "created_at": "...", "updated_at": "..."}
Delete User
Cannot delete yourself.
Response 200 OK: {"ok": true}
Reset User Password
| Field | Type | Required | Description |
|---|---|---|---|
password | string | Yes | New password (min 6 chars) |
Response 200 OK: {"ok": true}
VM Access (Admin Only)
Control which non-admin users can access which VMs. Admins can access all VMs regardless.
List VM Access
Response 200 OK:
[{"id": 2, "username": "dev", "role": "user"}]
Grant VM Access
| Field | Type | Required | Description |
|---|---|---|---|
user_id | int | Yes | User ID to grant access to |
Response 200 OK: {"ok": true}
Revoke VM Access
Response 200 OK: {"ok": true}
SSH Keys
Manage SSH public keys for your account. Keys can be injected into VMs at launch.
List SSH Keys
Response 200 OK:
[{"id": 1, "name": "work-laptop", "public_key": "ssh-ed25519 AAAA...", "created_at": "..."}]
Add SSH Key
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Display name (unique per user) |
public_key | string | Yes | SSH public key (OpenSSH format) |
Response 201 Created:
{"id": 1, "name": "work-laptop", "public_key": "ssh-ed25519 AAAA...", "created_at": "..."}
Delete SSH Key
Response 200 OK: {"ok": true}
Stacks, Secrets and Templates
Stacks, secrets and saved templates use the same API key authentication as the VM endpoints. Request and response details, template syntax and the ${secret.NAME} and ${vm.NAME.ip} variables are in the Stacks guide.
Apps (Admin Only)
Apps use an admin API key, the same access the web UI requires. Kubernetes clusters and Docker instances are available through the API. Creating one returns 202 Accepted and provisions in the background. Poll the GET endpoint until status is running. Common errors: 400 invalid input, 403 not an admin key, 404 not found, 409 name exists or add-on already installed.
Create Kubernetes Cluster
A cluster is a k3s server VM plus optional workers.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | Yes | None | Cluster name. The VM is named k8s-<name> |
size | string | No | medium | Instance size, or an AWS instance type |
disk_gb | int | No | size default | Disk size in GB |
bridged | bool | No | false | Bridged networking instead of NAT (on-prem only) |
argocd, headlamp, k9s | bool | No | false | Install the add-on |
worker_count | int | No | 0 | Worker nodes, 0 to 10 |
provider | string | No | libvirt | libvirt or aws |
region, vpc_id, subnet_id | string | No | None | AWS placement |
port_rules | array | No | None | AWS only: [{"port": 443, "source": "0.0.0.0/0"}] |
Response 202 Accepted:
{"name": "prod", "vm_name": "k8s-prod", "status": "provisioning", "ip": "", "tailscale_ip": "",
"size": "medium", "disk_gb": 0, "provider": "libvirt", "region": "",
"argocd": true, "headlamp": false, "k9s": false, "workers": [], "created_at": "2026-10-22 10:00"}
Manage Kubernetes Clusters
| Endpoint | Description |
|---|---|
GET /api/v1/apps/k8s/clusters | List clusters |
GET /api/v1/apps/k8s/clusters/{name} | One cluster. workers is a list of {name, ip, tailscale_ip, status}; worker status is provisioning until the worker VM is up with an IP, then ready. The worker joins the cluster about a minute later, so check kubectl get nodes before scheduling work on it |
DELETE /api/v1/apps/k8s/clusters/{name} | Delete the cluster, its workers and stored credentials |
POST .../{name}/scale | Body {"worker_count": 3}. Scale down drains and removes the newest workers first. Returns 202 |
POST .../{name}/addons | Body {"addon": "argocd"} (or headlamp, k9s). Returns 202, or 409 if already installed |
GET .../{name}/credentials | {"argocd_password": "...", "headlamp_token": "..."}, empty until the add-on has finished installing |
GET .../{name}/kubeconfig | The kubeconfig as YAML. The server address is the cluster IP, or its Tailscale IP when the Kubernetes Tailscale setting is on |
curl -sk -X POST https://your-server/api/v1/apps/k8s/clusters \
-H 'Authorization: Bearer vmk_your_admin_key' -H 'Content-Type: application/json' \
-d '{"name": "prod", "size": "large", "argocd": true, "worker_count": 2}'
Docker Instances
A VM with Docker and Compose installed. The VM's login details are on GET /api/v1/vms/{vm_name}.
| Endpoint | Description |
|---|---|
POST /api/v1/apps/docker/instances | Create. Fields: name (required; the VM is docker-<name>), size (default medium), disk_gb, bridged, provider, region, vpc_id, subnet_id, port_rules. Returns 202 |
GET /api/v1/apps/docker/instances | List instances |
GET /api/v1/apps/docker/instances/{name} | One instance: name, vm_name, status, ip, tailscale_ip, size, disk_gb, os, provider, region, created_at |
DELETE /api/v1/apps/docker/instances/{name} | Delete the instance and its VM |
Host Capacity (Admin Only)
Reports the host's CPU load, memory and VM storage, and what the VMs on it have been allocated. Use it to check that another VM will fit.
{
"host": {
"arch": "amd64", "cpu_cores": 8, "load_1": 0.4, "load_5": 0.3, "load_15": 0.2, "load_percent": 5,
"mem_total_bytes": 33500000000, "mem_used_bytes": 9000000000, "mem_available_bytes": 24500000000, "mem_percent": 27,
"disk_total_bytes": 1000000000000, "disk_used_bytes": 180000000000, "disk_free_bytes": 820000000000, "disk_percent": 18
},
"vms": {"total": 3, "running": 2, "vcpus_allocated": 6, "memory_mb_allocated": 12288}
}
Fleet
Fleet lets one virtuOSo server watch others. The Fleet server is part of its own fleet: its own load, memory, storage and VMs are listed beside its nodes, marked "local": true, read live, and counted in the totals. It cannot be removed, needs no sign in step, and is left out if its own numbers cannot be read. Every Fleet endpoint needs an admin API key. Each server in the fleet is stored with an admin API key from that server. The key is encrypted and is never returned by any call. Servers are checked every 30 seconds, and POST /api/v1/fleet/refresh checks them straight away.
Add a node
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | 1 to 40 letters, numbers, dots, hyphens or underscores |
address | string | Yes | Host name or IP address with an optional port, for example lab-02 or 192.0.2.10:443. Plain http is accepted only for the local machine |
api_key | string | Yes | An admin API key created on that server |
fingerprint | string | No | Expected SHA-256 certificate fingerprint, 64 hex characters. If empty, the first certificate the server presents is saved |
Response 201 with the node. The server is checked right away and is kept even if it cannot be reached yet, so you can add one that is not up. status and last_error say what is wrong. 400 for invalid input, 409 if the name is taken.
{"id": 1, "name": "lab-02", "address": "https://192.0.2.10", "status": "online", "version": "v0.7.1",
"last_seen": "2026-11-04T20:00:10Z", "last_checked": "2026-11-04T20:00:10Z", "last_error": "",
"certificate_fingerprint": "3f9a...", "stale": false,
"host": {"cpu_cores": 8, "load_percent": 12.5, "mem_percent": 25, "disk_percent": 20},
"vms": {"total": 4, "running": 3, "vcpus_allocated": 8, "memory_mb_allocated": 8192}}
status is online, offline, unauthorized (the key was refused), cert_changed (the server presents a different certificate than the one saved, so nothing is sent to it) or unknown (not checked yet). An offline server keeps its last known numbers and stale is true.
Other Fleet endpoints
- Both list endpoints take
sortanddir(ascordesc). Nodes sort byname(default),status(nodes that need attention first),cpu,memory,storage,vms,vcpus,ramorseen. VMs sort bynode(default),name,state,ip(by all four numbers, each counted as a number),vcpus,ram,diskorprovider. With nodir, numbers andseengo biggest or newest first and the rest ascending. Rows with no value, such as a node that has not reported, are always last. An unknownsortordirreturns400with the choices. GET /api/v1/fleet/nodesreturns (the resource totals count only nodes that are online and have reported, andload_percentis averaged over their cores){"nodes": [...], "totals": {"nodes", "online", "vms", "running", "vcpus_allocated", "memory_mb_allocated", "reporting", "cores", "load_percent", "mem_total_bytes", "mem_used_bytes", "mem_percent", "disk_total_bytes", "disk_used_bytes", "disk_percent"}}.DELETE /api/v1/fleet/nodes/{id}removes a node.{id}is the node name or its numeric id. Returns{"ok": true, "removed": "lab-02"}, or404. Only the entry and its saved key are deleted.POST /api/v1/fleet/nodes/{id}/trust-certificateforgets the saved certificate and saves the one the server presents now. Use it only after a certificate was changed on purpose. Returns the node.POST /api/v1/fleet/refreshchecks every node now and returns the same list asGET /api/v1/fleet/nodes. It can take a few seconds.GET /api/v1/fleet/vmsreturns{"vms": [...], "count": N}. Each entry hasnode,node_id,staleand the VM'sname,state,ip,vcpus,memory_mb,disk_cap_gb,providerandnetwork. Add?node=lab-02and?provider=AWSto filter. Names match without regard to case. If AWS is set up, the EC2 instances virtuOSo launched are listed too, as rows withnodeAWS,providerAWS,is_cloudtrue, theirregionandinstance_id, and nodisk_cap_gb. They come from what the service last read from AWS (see below), so listing never waits for AWS, and an instance that is already a row, because it was launched from a server's own Compute app or VM page, is not listed twice.AWSis not a server: it is never a place to move a VM to or to delete one from. Manage the instances in the AWS section of the overview.
Where a new VM fits
Ranks this server and every node by how much memory and storage each would have left after the VM, best first. size is one of micro, small (default), medium, large, xlarge, 2xlarge, 3xlarge, 4xlarge; disk_gb defaults to the size's disk. It is advice: nothing is reserved.
{"request": {"size": "large", "vcpus": 2, "ram_mb": 8192, "disk_gb": 120},
"recommended": "lab-02",
"candidates": [
{"node": "lab-02", "local": false, "status": "online", "verdict": "best fit", "fits": true, "recommended": true,
"free_ram_gb": 52.1, "free_disk_gb": 1800, "load_percent": 8, "score": 0.77},
{"node": "this server", "local": true, "status": "online", "verdict": "will not fit", "fits": false, "recommended": false,
"reason": "needs 8.0 GB of memory plus 1.6 GB kept for the host, 6.2 GB is free", "free_ram_gb": 6.2, "free_disk_gb": 90, "load_percent": 31, "score": 0}]}
When AWS is set up it is also listed, last, with "cloud": true, verdict cloud and its estimated_hourly_usd for that size. It is never recommended.
verdict is best fit, good fit, tight (fits, but under 15% of memory or storage would be left), will not fit, offline or no numbers yet. A server that is not online is never recommended. The host keeps 10% of its memory, at least 1 GB, for itself.
Launch a VM on the fleet
Launches a cloud image VM on the best fit, or on the server you name.
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | VM name |
node | string | No | A node name, this server, or auto (default) for the best fit |
size | string | No | Same sizes as above, default small |
os | string | No | Cloud image id, default ubuntu-24.04. ISO and qcow2 are refused, because those files live on one server |
disk_gb | int | No | Defaults to the size's disk |
ssh_key, user_script, password, bridged, vnc, desktop | No | Passed to the server that runs the VM, as for POST /api/v1/vms |
node can also be aws, which launches an EC2 instance in this server's AWS account through the same launch as POST /api/v1/fleet/aws/instances, with every guard it has. That costs money, so confirm_cost must be true, and auto never chooses AWS. size picks the instance type (micro is t3.micro, small t3.small, medium t3.medium, large t3.large, xlarge t3.xlarge, 2xlarge t3.2xlarge, 3xlarge m5.2xlarge, 4xlarge m5.4xlarge), and the size's disk becomes the instance's root disk, exactly as it is the VM's disk on a server (disk_gb sets another size, 8 to 2000 GB, billed while the instance exists at about $0.08 per GB a month). region, ttl_hours and ports apply only to AWS. bridged, vnc, desktop and password are refused for AWS, not ignored. The Deploy page has the same choice in its Server picker, under Cloud.
Response: the server's own status code (normally 202) with {"node", "local", "status", "warning", "result", "candidates"}, where result is that server's answer. The VM takes a minute or two to be ready, so poll GET /api/v1/fleet/vms. Naming a server that may lack room still launches, with a warning. 409 if no server has room, or the named server is not online. 404 for an unknown server. 502 if the node cannot be reached, refuses the saved key, or presents a different certificate, in which case nothing is sent. Other refusals from the node, such as a name already in use, come back with the node's status and reason.
Deleting a VM from Fleet
DELETE /api/v1/fleet/vms/{node}/{name}?confirm=true deletes a stopped VM on a fleet server, with its disk and snapshots, for good. confirm=true (in the address or as {"confirm": true} in the body) is required, so a script cannot do it by accident. It returns {"ok": true, "node", "vm"}. It is refused with 409 if the VM is running, protected, part way through a move, or a cloud VM (those are ended where they were launched), if the server is not reachable, or if the server is on an older version that cannot check that the VM has not been started since Fleet last looked. 404 if the server or VM is not in the fleet. The server makes the last check itself (DELETE /api/v1/vms/{name}?require_stopped=true), so a Fleet list that is a few seconds old can never cause a running VM to be forced off. Its records go with it, so it does not linger in the VM list. This is not DELETE /api/v1/fleet/nodes/{id}, which takes a server out of the fleet and touches none of its VMs. The Fleet VM list has a Delete button on every stopped VM.
Moving a VM to another server
A VM can move from one fleet server to another, offline. It is stopped, its disk is copied straight from the server that has it to the new one (it does not pass through the Fleet server), and it is started there. It keeps its password, notes, schedule and restore point settings. The new copy gets a new IP address, because each server hands out its own. When the new copy is running, the original is put away on the server it came from: out of the VM list, with its disk, first boot CD, UEFI settings, snapshots and records kept in a held folder, and deleted after 7 days. Until then it can be restored or deleted. Holding it is a rename on the same disk, so it takes no extra space and no time.
GET /api/v1/fleet/move/check?vm=web1&from=lab-01&to=lab-02 says whether it can move, from what the Fleet server already knows, and changes nothing: {"vm", "from", "to", "can_move", "problems", "will_stop", "disk_gb", "downtime_minutes"}. problems lists every reason it cannot, such as a different CPU type, not enough room on the new server, a name already used there, or a node that is offline. downtime_minutes is an upper bound on how long the VM is stopped. Either server can be this server.
POST /api/v1/fleet/move with {"vm": "web1", "from": "lab-01", "to": "lab-02", "stop": true} starts it and returns 202 at once with the move: {"id", "vm", "from", "to", "state", "step", "error", "warning", "ip", "will_stop", "downtime_minutes", "started", "finished"}. stop must be true to move a VM that is running, because the VM is stopped for the whole copy; without it a running VM is refused with 409 and the number of minutes. A move that cannot happen returns 409 with problems. Follow it with GET /api/v1/fleet/moves/{id}: state is running, done or failed, step says what it is doing, ip is the new address when it is done, and error says what went wrong if it failed. GET /api/v1/fleet/moves lists the recent ones ({"moves": [...], "count": N}). POST /api/v1/fleet/moves/{id}/cancel stops a running move and puts everything back.
Held copies. GET /api/v1/fleet/held lists them across the fleet: {"nodes": [{"node", "held": [{"id", "vm", "moved_to", "held_at", "expires_at", "size_bytes"}], "count", "bytes", "error"}], "count", "bytes"}. A server that cannot be asked is listed with its error. POST /api/v1/fleet/held/{node}/{id}/restore brings one back on {node}: the VM returns stopped, with its schedule and restore points switched off and a note, because the copy that moved is running elsewhere, and its snapshots and records return with it. It is refused if the server already has a VM of that name. DELETE /api/v1/fleet/held/{node}/{id} deletes one for good, with its snapshots, and cannot be undone. Each server also deletes its own expired ones when it starts and every hour. The Fleet overview shows the space they use as a card, and warns when a server is short of storage (85% or more used) while holding some, so you know which to delete. If the original cannot be put away (for example, its files are on another disk), the move still finishes and the original is left stopped with its schedule off, and the move says why in warning.
Telling the copies apart. A copy that was brought back from a held copy, or left in the VM list because it could not be put away, remembers where the live one went: GET /api/v1/vms gives it "moved_to": "lab-02", and its own page and VM list say so. The Fleet VM list shows a small moved to lab-02 badge on that row, in amber if the copy there is running, but only while lab-02 really has a VM of that name, so a note about a move that was undone, or whose other copy was deleted, never lingers. The Delete confirmation on such a row mentions the other copy.
If something goes wrong, the move undoes itself. The original is started again if it was running, and nothing is left on the new server. If the connection to the new server is lost while it is receiving, the Fleet server asks it to undo anything unfinished, and asks whether the VM got there. If it did, the move is done. If it cannot find out, the original is left stopped, so two copies cannot run, and the move says so.
What can move. A VM you launched on its own, with one disk, on the default network, that is not protected and does not belong to an app, a Kubernetes cluster or a stack, between two servers with the same CPU type. VMs with a bridged or custom network, passed through devices, more than one disk, or a CD other than the first boot one are refused with the reason. Snapshots and restore points stay with the original, and who may open the VM is set again on the new server. A VM with an emulated TPM (virt-install gives one to every UEFI VM) moves, but the keys stored in a TPM do not, so it starts with an empty one, and the finished move says so in warning; that only matters if something inside the VM sealed a secret to its TPM. A VM that uses the server's own TPM is refused. Both servers must be on a version with moves, and should run the same operating system version, so the new server knows the VM's machine type.
Between the servers. These are used by the Fleet server and need an admin API key, except the file download, which needs the transfer token. They are listed so a move can be understood, not to be called by hand. POST /api/v1/vms/{name}/move/prepare (on the server that has the VM: stop it if allowed, make the files, return a transfer token), GET /api/v1/move/{name}/files/{role} (the token is the credential, and it opens only that VM's files until the move ends), POST /api/v1/move/receive (on the new server: fetch the files from the other server, check every one against its checksum, define and start the VM, and answer when it has an address), POST /api/v1/vms/{name}/move/release (finish or undo on the source), POST /api/v1/move/abort and GET /api/v1/move/{name}/status (to settle a move after a lost connection). A VM that is part way through a move cannot be started, snapshotted or restored.
AWS in Fleet
Lists the EC2 instances virtuOSo launched (tagged ManagedBy=virtuoso) in this server's own AWS account, in every region the account can read, and estimates what the running ones cost. It only reads, using ec2:DescribeInstances and ec2:DescribeRegions, which the documented policy already allows. A region the policy does not allow answers "unauthorized" every time, so it is asked about once and then left alone for a day, which keeps unauthorized events from piling up in the account's audit log. Those regions are listed as skipped_regions, not as errors, and a real failure goes in unreadable_regions. read_regions lists the regions that were read. The answer is kept for a minute; add ?refresh=1 to read AWS now. If AWS is not set up the answer is {"configured": false}.
{"configured": true, "loaded": true, "error": "", "refreshed": "just now",
"totals": {"instances": 3, "running": 2, "stopped": 1, "regions": ["us-east-1", "us-west-2"], "vcpus_running": 4,
"estimated_hourly_usd": 0.0624, "estimated_monthly_usd": 45.55, "running_without_price": 0},
"instances": [{"id": "i-0abc", "name": "web", "region": "us-east-1", "type": "t3.small", "state": "running", "vcpus": 2,
"memory_gib": 2, "public_ip": "203.0.113.5", "private_ip": "192.0.2.5", "launched_at": "2026-11-04T10:00:00Z",
"estimated_hourly_usd": 0.0208}],
"read_regions": ["us-east-1", "us-west-2"], "skipped_regions": ["eu-west-1"], "unreadable_regions": [],
"estimate_note": "On demand Linux prices for us-east-1. Other regions differ, and storage and data transfer are extra."}
The cost is an estimate: on demand Linux prices for us-east-1, for the instance types virtuOSo launches. A stopped instance has an estimate of 0 (only its storage is billed), and a running instance of a type with no price has null and is counted in running_without_price.
Launching on AWS
Launches an EC2 instance in this server's AWS account. It costs money while it runs, so it is refused unless confirm_cost is true; the refusal states the estimated hourly cost and what to set. The same launch is behind the Launch on AWS form on the Launch VM and Fleet Deploy pages, vm fleet aws-launch and the MCP tool launch_aws_instance. It is for admins only, and the AWS form only appears if AWS is set up.
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Instance name, not already in use |
confirm_cost | bool | Yes | Must be true |
instance_type | string | No | t3.micro (default), t3.small, t3.medium, t3.large, t3.xlarge, t3.2xlarge, m5.2xlarge or m5.4xlarge |
region | string | No | A region the account can read (GET /api/v1/fleet/aws lists them in read_regions). Defaults to the default region in Settings |
os | string | No | ubuntu-24.04 (default), ubuntu-26.04, ubuntu-22.04 or amazon-2023 |
disk_gb | int | No | Root disk size in GB, 8 to 2000. Left out, the image's own size (8 GB) is used. The disk is billed while the instance exists, about $0.08 per GB a month, and is deleted with it |
ttl_hours | int | No | Terminate automatically after this many hours: 1, 2, 4, 8, 24, 72 or 168. 0 (default) never terminates it |
ports | array | No | Extra ports to open as {"port": 443, "source": "203.0.113.7/32"}; source defaults to 0.0.0.0/0. SSH is always open. At most 10 |
ssh_key, user_script | string | No | An SSH public key to install, and a shell script to run on first boot |
Response: 202 with {"name", "password", "status": "creating", "region", "instance_type", "estimated_hourly_usd", "disk_gb", "estimated_storage_monthly_usd", "ttl_hours", "expires_at", "estimated_max_cost_usd"} (the two disk fields only when a disk was set). The instance takes a minute or two to be ready; watch GET /api/v1/fleet/aws. 400 for anything invalid or an unconfirmed cost, 403 for a non admin key, 409 if the name is in use. The estimate uses on demand us-east-1 prices; storage and data transfer are extra.
Terminating. DELETE /api/v1/fleet/aws/instances/{id} terminates an instance that was launched from Fleet and removes the security groups made for it, and returns {"ok": true, "terminated", "name", "region"}. It cannot be undone and the instance's disk is lost. It refuses (404) an instance that was not launched from Fleet, such as one from the Compute app, which must be deleted where it was launched. The AWS table has a Terminate button for the same thing, and the Terraform resource virtuoso_aws_instance uses it on destroy.
Automatic termination. With ttl_hours set, the instance is tagged ExpiresAt, and the running service terminates it when the time passes, checking about once a minute. It acts only on instances it was told about at launch, and only if AWS still shows them as virtuOSo's, and if AWS cannot be read it terminates nothing and tries again. The security groups it made are removed with it. POST /api/v1/fleet/aws/instances/{id}/keep cancels the termination ({"ok": true, "kept": true}; kept is false if there was none). The AWS section of Fleet shows when each instance ends, with Keep, Extend and Terminate buttons. POST /api/v1/fleet/aws/instances/{id}/extend with {"hours": 6, "days": 2, "confirm_cost": true} adds that much time (hours and days are added together, up to 90 days in one call) to the current end, and returns instance_id, name, expires_at, added_hours, hourly_usd and max_added_cost_usd. It keeps the instance running and billed for the added time, so confirm_cost must be true. An instance can be extended as often as you like, and Keep or Terminate still work at any time, including during an extension. An instance that is not set to terminate (it was kept) returns 409, because there is nothing to extend. The service must be running for this to happen.
Fleet on every node
When you add a node to a Fleet server (the hub), the hub tells the node who manages it, and on that node the Fleet button leads to the hub's Fleet page. You see the same view wherever you land. The node learns only the hub's name and address. It never receives any key, so one node being compromised does not give access to the others.
PUT /api/v1/fleet/manager (admin key) takes {"name": "hub-1", "url": "hub.example.test"}. The address follows the same rules as a node address. DELETE /api/v1/fleet/manager clears it; with {"url": "..."} it clears only if that is the current manager, so one hub cannot release a node that another hub manages. GET /api/v1/host reports fleet_manager: {"name", "url"}, with empty values when the server is not managed. A node with no fleet of its own sends its Fleet button to the manager; with its own nodes it shows its own page, and /fleet?local=1 always shows the local page.
The hub needs to know its own address. It saves the address you used to reach it the first time you add a node, and you can change it in Settings > General > Fleet Address. Until it is set, nothing is sent. Every check re-registers a node that points somewhere else, and removing a node from the fleet releases it. A node can detach itself in Settings. Older nodes that do not report a manager are left alone.
Signing in to a node from Fleet
When you click Open, Shell, Console or VNC on a node in Fleet, you arrive already signed in, so you only sign in to the Fleet server. This server asks the node for a ticket with the node's saved admin key, and your browser hands the ticket to the node. Ordinary sign in is unchanged: a person who did not come through Fleet signs in as always. An older node that has no tickets gets a plain link to its own sign in page.
POST /api/v1/sso/tickets (admin key) takes an optional {"next": "/vms/web1/shell"}, which must be a path on the node, and returns 201 with {"ticket", "sso_path": "/sso", "next", "expires_in": 60}. POST /sso with the form field ticket redeems it: it sets a session cookie for the owner of the key and moves on to next. A ticket works once and only within 60 seconds, only an admin can be signed in, and GET /sso is refused so a ticket never sits in an address bar or a log. Only a hash of the ticket is stored. The ticket gives nothing the key does not already allow.
VM Schedules, Snapshots and Restore Points
These endpoints work for on-prem VMs and for AWS instances that virtuOSo launched. A user needs access to the VM, and an admin can manage any VM. A VM the caller cannot access returns 404, the same as one that does not exist. None of these features is on until it is created. The Schedules, Snapshots and Restore Points page explains how each one behaves.
Schedule
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
days | string | No | everyday | everyday, weekdays, weekends, or a list such as mon,wed,fri |
start_at | string | One of the two | none | Start time, HH:MM, 24 hour clock |
stop_at | string | One of the two | none | Stop time, HH:MM, 24 hour clock |
tz | string | No | server zone | IANA time zone, for example America/New_York |
enabled | bool | No | true | false keeps the times but turns the schedule off |
Set at least one of start_at and stop_at; they cannot be equal. A start or stop that was missed while virtuOSo was down is skipped. Response 200 with the saved schedule, plus the last run when there is one:
{"vm": "dev-box", "days": "weekdays", "start_at": "08:00", "stop_at": "19:00", "tz": "UTC", "enabled": true,
"last_action": "start", "last_at": "2026-03-02T08:00:03Z"}
GET returns the same object, or 404 if the VM has no schedule. DELETE removes it and returns {"ok": true}. GET /api/v1/schedules (admin) returns {"schedules": [...], "server_timezone": "..."}. Invalid input returns 400 with the reason.
Snapshots
A snapshot is a full copy of a VM's disk. A snapshot of a running VM is crash consistent; of a stopped VM it is clean.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | No | none | A label, up to 80 characters. snapshot_name is accepted too, for clients that already use name for the VM |
retention_days | int | No | 0 | Days until it is deleted: 1, 3, 5, 7, 14 or 28. 0 keeps it until you delete it |
Response 202 Accepted with the snapshot in the creating state. Poll GET /api/v1/vms/{name}/snapshots until its status is ready (or failed, with error).
{"id": "snap-20260301-020000-ab12cd", "vm": "dev-box", "name": "before upgrade", "kind": "full", "source": "manual",
"status": "ready", "created_at": "2026-03-01T02:00:00Z", "expires_at": "2026-03-08T02:00:00Z", "retention_days": 7,
"size_bytes": 820576256, "consistency": "crash-consistent"}
source is manual, scheduled (a restore point) or before-restore (the safety copy taken before a restore). The list returns {"snapshots": [...], "estimate": {"needed_bytes": N, "free_bytes": N}}, plus "operation" while one is running. For AWS VMs estimate is replaced by estimate_note, because AWS snapshots use no local space.
| Endpoint | Description |
|---|---|
DELETE /api/v1/vms/{name}/snapshots/{id} | Delete a snapshot and its data. {"ok": true} |
POST /api/v1/vms/{name}/snapshots/{id}/restore | Restore the VM to the snapshot. Returns 202. The VM is stopped, a safety copy of its current state is saved and kept for 7 days, the disk is replaced, and the VM is started again if it was running. Restore the safety copy to undo |
GET /api/v1/snapshots | Admin. Every snapshot |
Errors: 400 invalid retention or name, 404 unknown VM or snapshot, 409 another operation is running on the VM, 422 the VM cannot be snapshotted (for example more than one disk), 507 not enough free disk space (the message says how much is needed). The newest snapshot of a VM is never deleted automatically.
Restore Points
A restore point policy takes a snapshot automatically and deletes each after retention_days.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
at | string | Yes | none | Time of day, HH:MM, 24 hour clock |
retention_days | int | Yes | none | 1, 3, 5, 7, 14 or 28. A restore point always expires |
days | string | No | everyday | Same values as a schedule |
tz | string | No | server zone | IANA time zone |
enabled | bool | No | true | false keeps the policy but stops taking snapshots |
Response 200 with the policy and an estimate of the space it uses once a full retention period has passed:
{"policy": {"vm": "dev-box", "days": "everyday", "at": "02:00", "tz": "UTC", "retention_days": 7, "enabled": true,
"last_at": "2026-03-02T02:00:03Z", "last_result": "started"},
"estimate": {"copies": 7, "bytes_per_copy": 820000000, "bytes_total": 5740000000, "free_bytes": 820000000000}}
last_result is started or skipped; a skipped run (short on disk space, or the VM was busy) puts the reason in last_error. GET returns the same, or 404 if there is no policy. DELETE removes it; existing snapshots stay until they expire. GET /api/v1/restore-policies (admin) lists all policies.