Skip to main content
Operating System

Filesystem

Read and write VM files, and mount durable storage, host directories, S3, and other filesystem backends.

Every language and shell in the VM sees the same filesystem, so files written here are immediately visible to Bash, JavaScript, Python, and installed software.

Both APIs also provide batch readFiles, stat, readdir, readdirEntries, exists, move, remove, export for a snapshot of the root filesystem, and listMounts. Hosted VMs report byte counts in stat and readdirRecursive as sizeBytes; the library reports them as size. The library can also mount and unmount filesystems on a running VM.

Root filesystem

By default, each VM uses an in-memory overlay over the bundled base image. Writes survive for the VM’s lifetime and are discarded when the VM is replaced or disposed. See Persistence to keep files across VM recreation.

Mounts

Mount additional filesystem backends at any guest path.

Hosted VMs resolve filesystem configuration through a closed registry, such as durable storage. Unknown backends, JavaScript VFS objects, callbacks, and host paths are rejected. The library accepts native mount plugins, each identified by an id and a config object:

PluginBackend
host_dirA directory on the host, confined to the configured path
chunked_s3An S3 or S3-compatible bucket
chunked_sqliteThe VM’s SQLite database
google_driveA Google Drive folder

Host-backed mounts are confined to their configured root on every operation, including symlink and .. resolution. nodeModulesMount() is a library shortcut that exposes a host node_modules tree read-only at /root/node_modules.

File transfers are bounded. An operation that exceeds a payload limit fails with a typed limit error that names the limit.