<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/coding-agent-vms-on-nixos-with-microvm-nix-srrlmefyj" -->

---
title: Coding Agent VMs on NixOS with microvm.nix | daily.dev
description: Setting up ephemeral virtual machines on NixOS using microvm.nix provides a safe sandbox for running AI coding agents without exposing personal files. The...
canonical: https://daily.dev/posts/coding-agent-vms-on-nixos-with-microvm-nix-srrlmefyj
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Coding Agent VMs on NixOS with microvm.nix | daily.dev
og:description: Setting up ephemeral virtual machines on NixOS using microvm.nix provides a safe sandbox for running AI coding agents without exposing personal files. The...
og:url: https://daily.dev/posts/coding-agent-vms-on-nixos-with-microvm-nix-srrlmefyj
og:image: https://api.daily.dev/og/posts/SRRLmeFyj.png
og:image:alt: Coding Agent VMs on NixOS with microvm.nix
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Coding Agent VMs on NixOS with microvm.nix

**[Lobsters](https://daily.dev/sources/lobsters)** · 12 min read · 0 upvotes · 0 comments

## Summary

Setting up ephemeral virtual machines on NixOS using microvm.nix provides a safe sandbox for running AI coding agents without exposing personal files. The approach uses declarative configuration to create disposable VMs with shared workspaces, network isolation via bridge networking and NAT, and integration with tools like Claude Code. The setup includes network configuration with systemd-networkd, shared directories for workspaces and Nix store, and project-specific package environments. Claude Skills can automate the creation of new MicroVMs by analyzing existing configurations and generating similar structures. This method enables running untrusted code safely while maintaining minimal maintenance overhead through NixOS's declarative model.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://michael.stapelberg.ch/posts/2026-02-01-coding-agent-microvm-nix/>

## Similar posts on daily.dev

- [Docker Sandboxes: Run Claude Code and More Safely](https://daily.dev/posts/docker-sandboxes-run-claude-code-and-more-safely-6ydoupfk7) · Docker · 1 upvotes · 0 comments
- [Sandbox AI coding agents with microVMs on Fedora Linux](https://daily.dev/posts/sandbox-ai-coding-agents-with-microvms-on-fedora-linux-xfe5hlygw) · Fedora Magazine · 0 upvotes · 0 comments
- [Sandboxing local AI Agents](https://daily.dev/posts/sandboxing-local-ai-agents-jja6mrthe) · OctopusDeploy · 0 upvotes · 0 comments
- [GitHub - clawkwork/clawk: Disposable, network-restricted Linux VMs for AI coding agents](https://daily.dev/posts/github---clawkwork-clawk-disposable-network-restricted-linux-vms-for-ai-coding-agents-vix8abjbp) · Hacker News · 3 upvotes · 1 comments
- [I let Claude Code run wild in a virtual machine, and it changed how I use auto mode](https://daily.dev/posts/i-let-claude-code-run-wild-in-a-virtual-machine-and-it-changed-how-i-use-auto-mode-q1rsvahja) · XDA Developers · 0 upvotes · 0 comments

---

Tags: [#ai](https://daily.dev/tags/ai), [#security](https://daily.dev/tags/security), [#devops](https://daily.dev/tags/devops), [#infrastructure](https://daily.dev/tags/infrastructure), [#nixos](https://daily.dev/tags/nixos)

[View this post on daily.dev](https://daily.dev/posts/coding-agent-vms-on-nixos-with-microvm-nix-srrlmefyj)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Coding Agent VMs on NixOS with microvm.nix","url":"https://daily.dev/posts/coding-agent-vms-on-nixos-with-microvm-nix-srrlmefyj","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/coding-agent-vms-on-nixos-with-microvm-nix-srrlmefyj"},"datePublished":"2026-02-02T07:09:14.744Z","dateModified":"2026-02-02T07:09:42.561Z","description":"Setting up ephemeral virtual machines on NixOS using microvm.nix provides a safe sandbox for running AI coding agents without exposing personal files. The...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/024acff6299749bbb5c00747f09b3dd9?_a=AQAEulh","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/024acff6299749bbb5c00747f09b3dd9?_a=AQAEulh","isAccessibleForFree":true,"articleSection":"Lobsters","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Lobsters","logo":"https://media.daily.dev/image/upload/s--tl8v_Fku--/f_auto,t_logo/v1698841318/logos/lobste.jpg","url":"https://daily.dev/sources/lobsters"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/coding-agent-vms-on-nixos-with-microvm-nix-srrlmefyj","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ai,security,devops,infrastructure,nixos","timeRequired":"PT12M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Lobsters","item":"https://daily.dev/sources/lobsters"},{"@type":"ListItem","position":3,"name":"Coding Agent VMs on NixOS with microvm.nix"}]}
```

