🚀 B200 bare metal now at $5.6/hr. The best price you'll find. DC in US West → (Access it from Bare metal button on top after login).

Get Your B200 →
Start Building
Cover image
Engineering

How Persistent Workspaces Actually Work (A Deep Dive)

Persistent Workspaces mount a PVC at /workspace so files, packages, and models survive pod restarts. Detach the GPU to stop paying; reattach right where you left off.

Author photo
packet.ai Team
January 27, 2025

Persistent Workspaces on packet.ai mount a PVC at /workspace so your files, pip packages, and environment survive pod restarts — while you only pay for GPU time when the GPU is attached.

Key takeaways

  • A PVC mounts at /workspace and persists across all pod restarts — your files, packages, and models stay
  • On first boot, an init script copies your home directory to /workspace/home/ and writes a marker file so subsequent boots skip the copy
  • /workspace/bin/ is automatically added to PATH — install binaries there for instant access across restarts
  • Pip packages installed to /workspace/pip-packages/ persist when you set PYTHONPATH accordingly
  • Detach the GPU to stop paying hourly — reattach later and your workspace is exactly where you left it

GPU pods are ephemeral. Every restart, the container starts fresh from the base image. Persistent Workspaces solve this by mounting a PVC that outlives the GPU attachment, so your working environment accumulates over time rather than resetting to zero on every restart.

How Persistent Workspaces work under the hood

When you launch a GPU on packet.ai with persistent storage, we mount a PVC at /workspace. An init script runs on every pod start:

#!/bin/bash
if [ ! -d "/workspace" ]; then exit 0; fi

mkdir -p /workspace/home

# First boot: copy home directory to workspace
if [ ! -f "/workspace/home/.packet-init" ]; then
    cp -r $HOME/. /workspace/home/ 2>/dev/null || true
    touch /workspace/home/.packet-init
fi

# Add workspace bin to PATH
echo 'export PATH="/workspace/bin:$PATH"' >> /workspace/home/.bashrc

The marker file /workspace/home/.packet-init is the key: on first boot it doesn’t exist, so the home directory is copied. On all subsequent boots it exists, so the copy is skipped and your accumulated changes are preserved.

What persists and what doesn’t

Location Persists? Notes
/workspace/✓ YesPVC, survives all restarts and GPU detaches
/workspace/bin/✓ YesAuto-added to PATH
/home/ubuntu/.local/× NoDefault pip install location, ephemeral
/tmp/× NoCleared on restart

Practical setup recipes

Persist pip packages:

# Install to workspace
pip install --target=/workspace/pip-packages torch transformers vllm

# Add to .bashrc in workspace (survives restarts)
echo 'export PYTHONPATH="/workspace/pip-packages:$PYTHONPATH"' \
  >> /workspace/home/.bashrc

Auto-run setup on boot:

# Store requirements in workspace
pip freeze > /workspace/requirements.txt

# Startup script reads it
if [ -f /workspace/requirements.txt ]; then
  pip install -r /workspace/requirements.txt
fi

Persist conda environments:

conda create --prefix /workspace/envs/myenv python=3.11
conda activate /workspace/envs/myenv

Cost model: GPU detach and reattach

The economic case for Persistent Workspaces is straightforward: when your job is done for the day, detach the GPU. You stop paying the GPU hourly rate. Your workspace persists on the PVC (which has its own lower storage rate). Reattach the next morning and you’re exactly where you left off — files, packages, conda environments, model weights all intact.

At H100 rates from $0.65/hr, an 8-hour workday costs $5.20. Without persistent workspaces, spending 30 minutes on setup each morning costs $0.33 in GPU time — plus the productivity loss. Across a team of 5 engineers, that’s $1.65/day or ~$430/year burned on reinstalling packages.

Frequently asked questions

A PVC is mounted at /workspace. On first boot, an init script copies your home directory to /workspace/home/ and writes a marker file. On subsequent boots, the marker exists so the copy is skipped — your accumulated changes are preserved, not overwritten.
Yes. Use pip install --target=/workspace/pip-packages <package> and add export PYTHONPATH=/workspace/pip-packages:$PYTHONPATH to your /workspace/home/.bashrc. Packages installed this way survive all pod restarts.
The workspace PVC persists independently of the GPU. When you detach, GPU billing stops immediately. The PVC continues at its own storage rate. Reattach a GPU and the workspace is exactly as you left it — files, packages, conda environments all intact.
Yes. Create conda environments with a prefix inside /workspace/: conda create --prefix /workspace/envs/myenv python=3.11. The environment persists across restarts and can be activated with conda activate /workspace/envs/myenv.

Last reviewed: 10 June 2026. Browse GPU clusters on packet.ai →

Waste less compute.

Same models. Same API. Fraction of the cost. Start free — no credit card required.

Start Building →

More from the blog