Skip to content

Barn 1.2.0 · Stable · Apache-2.0

Multi-Node Linux Labs and Native macOS VMs

Define fixed-IP nodes in one Ansible inventory and boot them on macOS or Linux, or run isolated macOS 27 machines on Apple Silicon.

Bootstrap And Run Nodes · QEMU with HVF or KVM · Apple Virtualization

What’s new in 1.2.0

Quick start

Four Linux VMs, one command

Install Barn on your Mac, select Pigsty’s full template, and run barn up. The same pigsty.yml defines all four VMs.

Nodes
4 VMs · 10.10.10.10–13
Image
Ubuntu 24.04 · u24:stable
Per node
1 vCPU · 2 GiB memory
Disks
64 GiB root · 128 GiB /data
Barn 1.1.0 · macOS → Pigsty full

Recorded with Barn 1.1.0 on November 9. Barn 1.2.0 uses the same commands, with 1 vCPU / 2 GiB defaults and SPEC / ROOT status columns.

macOS · Homebrew
# Installs the CLI, Barn.app, and QEMU
brew install pgsty/infra/barn
cd pigsty  # Your Pigsty checkout
./configure -c full
barn up
barn status
Linux · single-node quick start
# Installs into ~/.local/bin without sudo
curl -fLO https://github.com/pgsty/barn/releases/latest/download/install.sh
bash install.sh && export PATH="$HOME/.local/bin:$PATH"
barn up
barn ssh

Core capabilities

Two workflows. One CLI.

Declarative Linux labs and native macOS machines share one install.

Linux labs

Declarative Linux Labs

◇ One YAML inventory for fixed-IP nodes

  • Nodes, CPU, memory, and disks in one barn.yml
  • Fixed private IPs and SSH keys; publish names with barn hosts install
  • Re-run barn up to converge; deletion stays explicit

Pass the same file to Pigsty or ansible-playbook -i.

barn.yml · barn up
# Minimal four-node inventory
all:
  vars: { admin_ip: 10.10.10.10 }
  children:
    nodes:
      hosts:
        10.10.10.10: { nodename: meta }
        10.10.10.11: { nodename: node-1 }
        10.10.10.12: { nodename: node-2 }
        10.10.10.13: { nodename: node-3 }
$ barn up
$ barn ssh meta

macOS guests

Native macOS Machines

◇ Isolated Apple Silicon guests on Apple Virtualization

  • Signed Barn.app ships with Homebrew and the arm64 archive
  • One macOS 27 base from Apple; new machines clone in seconds
  • Desktop window, ssh, shared folders, and clipboard

Each machine has its own disk, keys, and private subnet.

barn mac · Apple Virtualization
$ barn mac up dev --cpu 8 --memory 16G --share ~/src
$ barn mac open dev
$ barn mac ssh dev -- sw_vers -productVersion
27.0

Design notes

Predictable by design

Each rule links to the note that explains its trade-offs.

One deployment per user

Each user keeps one Linux lab under ~/.barn; switching directories never forks it.

One deployment per user

Omission never deletes

A host removed from YAML is only reported; deleting a VM always takes barn destroy.

Omission never deletes

Identity before PID

Barn signals or deletes a VM only after its QMP identity and journal agree.

Identity before PID

Signed image evidence

repo.yaml states intent; the signed catalog.json proves the bytes.

Signed image evidence

Before you begin

Common questions

What hosts does Barn support?

Linux labs run on macOS (Apple Silicon or Intel, QEMU with HVF) and on Linux (amd64 or arm64, QEMU with KVM). macOS guests need an Apple Silicon Mac running macOS 27 or later; the signed Barn.app ships with the Homebrew formula and the Darwin arm64 archive. See Platforms and Limits.

What does Barn change on my host?

The first barn up lists the QEMU packages, UEFI firmware, and private host network it needs, then asks once before applying them; sudo prompts only for steps that need it. Preview the plan with barn setup --dry-run, and see Uninstall and Clean Up to reverse it.

How does Barn relate to Pigsty and Ansible?

barn.yml is a standard Ansible YAML inventory (all.vars, all.children.<group>.hosts), so the same file works with ansible-playbook -i barn.yml and Pigsty playbooks. Barn prepares the machines and SSH access; Pigsty installs the services. Barn also works on its own.

Where does Barn store images and VM disks?

Deployment state, SSH keys, cached base images, and VM disks live under $BARN_HOME (~/.barn by default). Changing your working directory does not create a separate deployment unless you set a different BARN_HOME.

How do I upgrade Barn?

Stop any running macOS VMs, then run brew upgrade pgsty/infra/barn or re-run install.sh. VM disks, keys, and state under ~/.barn stay in place. See Upgrade Barn.

Ready to build your local lab?Follow the Linux tutorial from install to teardown, boot a native macOS VM, or look up a command.