NEW(1)General Commands ManualNEW(1)

new — create and boot a VM

ssh chroot.dev new [-w] [-c cpus] [-d disk] [-i image] [-m memory] [-n name] [-s script] [--integration name ...]

new creates a VM and boots it. Without -n the name is random. The VM counts against the plan's limits for the account, with all its other VMs, stopped ones included; see billing(1). A suspended account cannot create VMs.

The VM gets a private IPv4 and a public IPv6 address, both shown; see chroot.dev(7). The public address is open to the internet on every port: anything that listens on the VM answers there, to anyone, whatever share(1) says. Filter it with pf.conf(5) in the VM before starting services.

The options are as follows:

cpus
Number of cpus. The default is 1.
disk
Size of the data disk in GiB, or with a G or T suffix.
image
Image to start from. The default is base.
memory
Memory in MiB, or with an M or G suffix. The default is 128 MiB. The base image adds 512 MiB of swap in /var/swap.
name
Name of the VM: lowercase letters, digits and hyphens, up to 63 characters. It is also the hostname and the HTTPS name.
script
Run script once as on the first boot. ‘\n’ is a line break; /dev/stdin reads the script from standard input.
Wait until the VM is ready: ssh answers with its own host key and the account's keys. With -s, wait as well for the script to end, for at most 10 minutes. Print how long each took. A script that exits with an error fails the command with its last line of output; the whole output is in /var/db/vmagent/setup.log on the VM. If the VM is not ready within 60 seconds, the command fails with its last lines. Either way the VM is kept, and log(1) shows the rest of its console.
name
Attach the account's integration name to the VM; repeatable. See integrations(1).

Create a VM named web and wait for ssh:

$ ssh chroot.dev new -n web -w

More memory and a data disk:

$ ssh chroot.dev new -n db -m 512M -d 4G

Install packages on the first boot:

$ ssh chroot.dev new -n app -w -s /dev/stdin < setup.sh

On -current, while a new package snapshot reaches the mirrors, the listing that pkg_add(1) reads can name a version whose file is already gone, and the install fails with “Couldn't install”. A script can try another mirror when that happens:

doas pkg_add -I go ||
    doas env PKG_PATH=https://ftp.openbsd.org/pub/OpenBSD/snapshots/packages/amd64/ \
    pkg_add -I go

billing(1), cp(1), integrations(1), log(1), pkg_add(1), resize(1), rm(1), share(1), pf.conf(5), chroot.dev(7), copies(7)

chroot.devOctober 14, 2026NEW(1)