---
title: "Building fast filesystems for VMs"
description: "Modal replaced virtio-fs with a custom virtio-blk backend, ImageFS-blk, for its VM Sandboxes."
url: "https://swe.quest/articles/building-fast-filesystems-for-vms-c974511fa7175ffd"
canonical: "https://modal.com/blog/vm-sandbox-filesystem"
source: "Modal"
published: "2026-10-16"
difficulty: "hard"
kind: "Case study"
reading_minutes: 9
tags: ["storage-systems","virtualization","performance","linux","sandboxing"]
---

# Building fast filesystems for VMs

A post on [Modal](https://swe.quest/sources/modal.md), published 2026-10-16, 9 min read, Case study. Original: [https://modal.com/blog/vm-sandbox-filesystem](https://modal.com/blog/vm-sandbox-filesystem)

## Summary

Modal replaced virtio-fs with a custom virtio-blk backend, ImageFS-blk, for its VM Sandboxes. Under virtio-fs every metadata operation crosses the VM boundary: one chown cost three guest-to-host FUSE round trips and six host syscalls. ImageFS-blk synthesizes ext4 inode and extent metadata from lazily loaded image metadata, leaves file data sparse, and serves blocks on demand from a tiered cache. Writes go to a sparse file tracked by a dirty bitmap, giving block-level copy-on-write. Metadata operations now stay in the guest's ext4 journal (chown drops from ~99 µs to ~2.1 µs), bun install runs 12x faster (12.5s to 1.07s), and sub-second cold starts are preserved.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Storage systems](https://swe.quest/tags/storage-systems.md) (Infrastructure)
- [Virtualization](https://swe.quest/tags/virtualization.md) (Infrastructure)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Linux](https://swe.quest/tags/linux.md) (Infrastructure)
- [Sandboxing & isolation](https://swe.quest/tags/sandboxing.md) (Security)

## Prerequisites

- Linux filesystems and FUSE ([easy posts on Linux](https://swe.quest/tags/linux.md?difficulty=easy))
- ext4 inodes and extents
- virtualization I/O (virtio) ([easy posts on Virtualization](https://swe.quest/tags/virtualization.md?difficulty=easy))
- OverlayFS copy-on-write

## Keywords

ImageFS, ImageFS-blk, virtio-fs, virtio-blk, virtiofsd, ext4, OverlayFS, FUSE

## Related posts

- [SBD: We Have a Filesystem at Home](https://swe.quest/articles/sbd-we-have-a-filesystem-at-home-3c737c700e710a53.md): Fly.io · 2026-10-22 · Medium · 5 min read · Storage systems, Linux, Testing
  Fly.io replaced the modified JuiceFS stack behind Sprites with the Sprites Block Device (SBD), which exposes an object storage bucket to the Linux kernel as an NBD block device formatted with ext4.
- [Litestream Writable VFS](https://swe.quest/articles/litestream-writable-vfs-4f950262d6c7f5b0.md): Fly.io · 2026-01-29 · Medium · 7 min read · SQLite, Storage engines, Replication, Storage systems
  Litestream's SQLite VFS now supports an optional write mode and background hydration, built so the Sprites storage stack can serve reads and writes milliseconds after a cold boot without first downloading its JuiceFS block map from object storage.
- [Server-side sandboxing: An introduction](https://swe.quest/articles/server-side-sandboxing-an-introduction-7a8a0dd3442f4e4f.md): Figma · 2023-10-24 · Easy · 9 min read · Sandboxing & isolation, Security, Virtualization, Containers, Linux
  Server-side workloads like image processing, parsing and thumbnailing often depend on memory-unsafe C++ libraries with histories of exploitable bugs (e.g. ImageTragick), so Figma isolates them with sandboxing rather than relying solely on preventing vulnerabilities.
- [Speeding up Deployments with Lazy Image Streaming](https://swe.quest/articles/speeding-up-deployments-with-lazy-image-streaming-e38be965e3d7f740.md): Replit · 2023-09-06 · Medium · 8 min read · Containers, Performance engineering, Linux, Deployment, Storage systems
  Replit cut cold-boot times for large Deployment container images from 3-4 minutes to under 30 seconds by lazily streaming images through a FUSE filesystem instead of pulling and unpacking every layer up front.
- [Memory snapshots: Checkpoint/restore for sub-second startup](https://swe.quest/articles/memory-snapshots-checkpoint-restore-for-sub-second-startup-543b0ee4c645204a.md): Modal · 2025-01-28 · Medium · 9 min read · Serverless, Containers, Sandboxing & isolation, Performance engineering, Linux
  Modal cuts serverless container cold starts roughly 2.5x by checkpointing a gVisor container's full process tree and filesystem mutations just before it accepts a request, then restoring it instead of re-running Python's syscall-heavy import path (import torch alone makes 26,000 syscalls through OverlayFS and a FUSE lazy-loading server).

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
