/etc/hosts, will, and that can be useful: they run against a clean machine that’s thrown away afterwards.
Who and where
Processes
PID 1 isephemera-guest, ephemera’s guest agent. It starts your command and reaps orphaned processes, and that’s all. So:
- There’s no systemd.
systemctlis in the image, but with no systemd running it fails, and so doessystemctl --user. Start background programs yourself, with&ornohup. - There’s no Docker, and no other service runs: no cron, no SSH server, no syslog.
--timeout stops the command’s whole process group, background programs included.
Files
The root filesystem is writable. The guest image is shared and read-only, and everything written lands on the sandbox’s own disk on top of it, so you can change any file,/etc/hosts included, or apt install a package. The disk is sparse, 20 GB by default, and it’s deleted with the sandbox.
/tmp, /run and /dev/shm are in memory, and count against the sandbox’s memory.
Network
The sandbox has no network device, only loopback. Programs reach the internet through an HTTP proxy at127.0.0.1:3128, set in HTTP_PROXY, HTTPS_PROXY and their lowercase forms, and only to the hosts you allow. See Network access.
Name resolution is the part most likely to surprise:
- There’s no DNS server. The proxy looks up names on the host, so programs that use the proxy don’t need DNS. A program that resolves a name itself, before connecting, gets an error.
-
localhostresolves, from/etc/hosts, but other names under.localhostdon’t. On many desktops,app.localhostreaches 127.0.0.1 through systemd’s resolver; here, Node.js, Python and Go programs can’t find it. Add the names you need to/etc/hosts:
Tools in the default image
The default guest image is Ubuntu 24.04 with:
It doesn’t have
jq, wget, sudo, docker, an editor such as vim or nano, less, nc or dig.
The sandbox can’t download anything by default, so to add a tool, allow Ubuntu’s archive and install it in a setup step. The snapshot keeps it, so later runs skip the install:
--image picks one.