Skip to content

Building in a VM

The base image is Alpine. rsync is already installed.

Unpack a toolchain at /usr/local/go. Login shells and ssh <vm> command both have /usr/local/go/bin on PATH, and the guest links those binaries into /usr/local/bin on boot and again when a setup script finishes. A file already at that name in /usr/local/bin is left as it is.

Terminal window
sudo apk add postgresql
sudo rc-update add postgresql
sudo rc-service postgresql start

PostgreSQL 18 stores its cluster in /var/lib/postgresql/18/data. Other majors use /var/lib/postgresql/<major>/data. sudo rc-service postgresql setup creates the directory, and so does the first start when the directory is missing.

initdb -D /var/lib/postgresql/data writes a different directory. The OpenRC service does not open it, so the server comes up empty or fails to find a cluster.

rc-update add keeps the service enabled across a reboot and across cp. It starts after localhost and the VM address are up.

/dev/shm is mounted noexec. GOTMPDIR=/dev/shm fails because the Go tool runs programs it writes there. Set TMPDIR and GOTMPDIR to /tmp or your home directory.

Some sandboxes answer the lobby name with a fake address. HostKeyAlias only picks the known-hosts entry; the host you dial is still the one on the command line. Use the lobby’s IP:

Terminal window
ssh -o HostKeyAlias=turm.dev <lobby-ip>
ssh -o HostKeyAlias=turm.dev vm+demo@<lobby-ip>

The first opens the lobby. The second opens the VM demo. ssh vm+demo@turm.dev still dials the lobby name.