Isolation levels
| Proposed vocabulary. These terms are a proposal from the essay Virtual environments are neither virtual nor temporaryunchecked. They describe existing tools; they do not rename them. |
Words like "virtual environment", "container" and "sandbox" do not say what is separated, how long it lasts, or what it applies to. This page gives each of those a small fixed vocabulary.
Three things, not one
| Term | Meaning | Examples |
|---|---|---|
Recipe |
A description of what is wanted. |
|
Artifact |
What was built from a recipe and stored. |
a venv folder, a Node version folder, a container image, a VM disk |
Attachment |
A process, session or folder currently using an artifact. |
an activated venv, |
Artifacts and attachments each have their own lifetime.
Isolation: what is separated
| Level | What changes | Examples |
|---|---|---|
overlay |
Only name lookup: |
Python venv, nvm / nvm-windows, pyenv, asdf, mise, direnv, Nix dev shells, Volta |
fence |
Same view of the OS; permissions are reduced. |
seccomp, Landlock, AppArmor, SELinux confinement, macOS sandbox, Windows AppContainer, Firejail profiles |
partition |
Own view of files, processes and network; shared kernel. |
Docker / Podman containers, FreeBSD jails, systemd-nspawn, Linux namespaces, Windows Server containers (process isolation) |
guest |
Own kernel on virtual hardware. |
Hyper-V, VirtualBox, QEMU/KVM VMs, Firecracker microVMs, WSL2, Windows Sandbox, Hyper-V-isolated containers |
Plan 9 per-process namespaces sit between overlay and partition: each process gets its own file tree, built by binding, without a separate kernel.
Lifetime: how long it lasts
| Term | Ends when |
|---|---|
run |
the command or process exits |
session |
the shell session closes |
kept |
someone deletes it |
Writing a full name
<lifetime> <level>, optionally @<scope> for the attachment.
| Thing | Full name | Why |
|---|---|---|
Python venv, activated |
kept overlay, attached @session |
The folder persists; |
|
kept overlay, attached @session |
Versions are persistent folders; |
mise / asdf / direnv pin |
kept overlay, attached @folder |
A file in the project selects; the effect follows the current folder. |
|
run partition |
The writable layer is removed on exit; the image stays. |
Named container |
kept partition |
The writable layer lasts until |
Windows Sandbox |
run guest |
A lightweight VM discarded on close. |
Hyper-V / VirtualBox VM |
kept guest |
Disk persists; snapshots allow rewinding. |
Common misconceptions
-
"A venv dies with the shell." Only its activation does. The venv is a folder.
-
"Containers are persistent." Images are. A container lasts until removed, which with
--rmis on exit. -
"A container is a lightweight VM." On Linux it shares the host kernel; that is what separates a partition from a guest.
-
"A sandbox is a VM." Usually it is a fence. Windows Sandbox is the exception: it is a guest.
See also
-
Virtual environments are neither virtual nor temporaryunchecked (essay)
-
Command namespace and context requestsunchecked (OpenShellOrg, proposed)