Hangar: open-source macOS/Linux/Windows VMs to sandbox AI coding agents
ozgursoy · reddit · 2026-11-22
Hangar is a free, open-source (Apache 2.0) Mac app and CLI built on Apple's Virtualization.framework that runs macOS, Linux and Windows VMs — the author uses it to run Claude Code and Codex with approvals off, so bad commands land in a VM instead of on the host.
Key isolation features:
- Folders: the VM only sees directories you explicitly share (read-only optional); /Documents and /.ssh stay hidden.
- Secrets: API keys stay in macOS Keychain; VM programs see placeholders, and Hangar injects real values only to hosts you name.
- Network: all connections and DNS lookups logged from outside; allow-list mode or full network cutoff.
- Snapshots: instant rollback if the agent wrecks the VM.
Debian/Ubuntu/Fedora VMs start in seconds, Windows 11 on Arm installs from Microsoft's ISO. An MCP server lets agents on your Mac create VMs, run commands and take snapshots, while secrets, passwords and VM deletion stay human-controlled. Install via brew install --cask baseguard/tap/hangar.
Related event: Baseguard Open-Sources Hangar to Sandbox AI Coding Agents in VMs(2 posts)→
More from coding & agent
- Hugging Face's Lewis Tunstall Maps the Road from LLMs to Agent Swarms — _lewtun · 2026-11-22
- Grok Build CLI vs AFK Pilot vs T3 Code: feature comparison across three grok runners — PawelHuryn · 2026-11-22
- A local 8B model made a GGUF quant cheat sheet — all 16 numbers check out — Impressive-Kick293 · 2026-11-22
- GPT-6.2 is hard to steer via system prompt — OpenAI says use it directly in Codex — pvncher · 2026-11-22
- Comet cut Opik dataset ingestion time from 39 minutes to 80 seconds by fixing 8 bottlenecks — dl_weekly · 2026-11-22
- Ghost Mode: open-source Rust Code Mode cuts ~60% of agent tool-call token costs — legend-of-alan · 2026-11-22