What gets created
Google documents the supported machine families and expected overhead in its
nested virtualization overview.
Do not substitute an E2, AMD, or Arm machine for this guide.
Prerequisites
You need:- A GCP project with billing enabled.
- Permission to enable APIs and create Compute Engine instances and firewall rules.
- The current Google Cloud CLI.
git,curl,jq,ssh,rsync, andopensslon your development machine.- A clone of the OpenComputer repository.
Configure the deployment
Choose a machine and instance name, then generate a development API key:Restrict ingress before creating the VM
The deployment script looks for a firewall rule namedopensandbox-dev-allow. Create that rule first so the development API and SSH
are not exposed to the internet.
Replace the CIDR below with your current public IP:
Create the host
Create the VM, enable nested virtualization, format the Local SSD as reflink-enabled XFS, and install the host dependencies:- Creates an SSH key if the configured key does not exist.
- Creates an Ubuntu N2 instance with nested virtualization enabled.
- Attaches one Local NVMe SSD.
- Mounts the SSD at
/data. - Installs QEMU/KVM, Docker, Go, PostgreSQL, Redis, and the systemd units.
Deploy OpenComputer
Build the server, worker, and in-VM agent; build the rootfs images; install the environment files; start the services; and seed the development API key:default.ext4: the legacy 4 GiB split-disk base.default-merged.ext4: the unified 20 GiB base used by new sandboxes.
/, /home/sandbox, and /workspace on one virtual
disk. The underlying image is sparse, so its logical 20 GiB size does not
consume 20 GiB of Local SSD space immediately.
Wait for worker registration
The HTTP health endpoint can become ready before the worker has created its golden snapshot and registered with the control plane. On a fresh host, allow approximately one minute after deployment. Inspect the server log:503 no workers available, wait for registration
and retry.
Validate the cell
Get the public IP and configure your shell:lsblk should show one approximately 20 GiB
vda, and all three paths should resolve to the same root filesystem.
Use the dashboard during development
The development deployment enables the explicitsingle-tenant dashboard
mode. On startup, the control plane creates or reuses one local organization
and administrator in PostgreSQL and keeps that development organization on the
Pro plan so hosted free-tier size gates do not restrict local testing. The
dashboard therefore shows the live cell’s sandboxes without requiring an
external identity provider.
Start the development UI
The deploy command syncs the dashboard source to the VM. In one terminal, run Vite there through the existing Docker installation:localhost:8080 on the
VM, so UI requests use the single-tenant identity and operate on the live
development cell.
Forward it to your machine
Keep Vite running. In a second local terminal, forward the VM’s loopback-only UI port to port3000 on your machine:
Operations
Check status:Rebuild the rootfs
Normal deploys reuse existing rootfs images. When you intentionally need to test a rootfs change, remove both cached bases and deploy again:Storage and shutdown
The 50 GB boot disk is a persistent block disk. The 375 GiB Local SSD mounted at/data holds active sandbox disks and rootfs images.
Google documents that Local SSD data is discarded by default when an instance
is stopped and recommends durable block storage for data that must survive
host replacement. See About Local SSD disks.
Delete the development VM when you are finished:
Troubleshooting
no workers available
The server became healthy before worker registration completed. Wait for the
worker registration log, then retry sandbox creation.
/dev/kvm is missing
Confirm that the VM is using a supported Intel machine type, nested
virtualization was enabled at instance creation, and your organization policy
allows nested virtualization.
The control-plane root redirects to localhost:3000
No built dashboard bundle is installed. Run Vite using one of the dashboard
modes above, or build web/dist before packaging the control plane.
API requests return 401
Use the same API key that was passed to deploy:
The public IP changed
Runstatus to refresh the deployment state, update
OPENCOMPUTER_URL, and confirm that the firewall still allows your current
source address.