<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Command Reference on Barn</title><link>https://barn.pgsty.com/v1.5/docs/reference/commands/</link><description>Recent content in Command Reference on Barn</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Thu, 03 Dec 2026 00:00:00 +0800</lastBuildDate><atom:link href="https://barn.pgsty.com/v1.5/docs/reference/commands/index.xml" rel="self" type="application/rss+xml"/><item><title>Guest Time Synchronization</title><link>https://barn.pgsty.com/v1.5/docs/reference/commands/time/</link><pubDate>Thu, 19 Nov 2026 00:00:00 +0800</pubDate><guid>https://barn.pgsty.com/v1.5/docs/reference/commands/time/</guid><description>&lt;p&gt;While the host sleeps or a VM is paused, the guest does not run, so its clock falls behind the host&amp;rsquo;s; in an offline lab, guest NTP has no source to correct it. &lt;code&gt;barn time&lt;/code&gt; measures each Linux guest against the host clock and sets it over management SSH, so it works without guest Internet access. Barn checks clocks on demand with &lt;code&gt;barn time sync&lt;/code&gt;, when &lt;code&gt;up&lt;/code&gt;, &lt;code&gt;start&lt;/code&gt;, &lt;code&gt;restart&lt;/code&gt;, &lt;code&gt;reload&lt;/code&gt;, or &lt;code&gt;recreate&lt;/code&gt; brings guests to ready, and, if you opt in, every minute from an OS timer.&lt;/p&gt;</description></item><item><title>macOS Commands</title><link>https://barn.pgsty.com/v1.5/docs/reference/commands/mac/</link><pubDate>Wed, 11 Nov 2026 00:00:00 +0800</pubDate><guid>https://barn.pgsty.com/v1.5/docs/reference/commands/mac/</guid><description>&lt;p&gt;Syntax, options, and examples for every &lt;code&gt;barn mac&lt;/code&gt; subcommand. The machine model, networks, JSON results, and failure reasons these commands share are defined in the &lt;a href="../../mac/"&gt;Mac Runtime Reference&lt;/a&gt;; a guided first run is in &lt;a href="../../../start/macos/"&gt;macOS Virtual Machines&lt;/a&gt;.&lt;/p&gt;&#10;&lt;h2 id="common-rules"&gt;Common rules&#10;&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Host.&lt;/strong&gt; The commands need an Apple Silicon Mac on macOS 27 or later with the matching &lt;code&gt;Barn.app&lt;/code&gt;, run as the logged-in desktop user (&lt;a href="../../../start/macos/#requirements"&gt;requirements&lt;/a&gt;). At most two macOS VMs run at a time per Mac; starting a third fails with &lt;code&gt;mac_vm_limit&lt;/code&gt;.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Machine names.&lt;/strong&gt; A command with an optional &lt;code&gt;[name]&lt;/code&gt; uses the only existing machine, or &lt;code&gt;mac1&lt;/code&gt;. With several machines and none named &lt;code&gt;mac1&lt;/code&gt;, pass a name. &lt;code&gt;configure&lt;/code&gt;, &lt;code&gt;recreate&lt;/code&gt;, and &lt;code&gt;destroy&lt;/code&gt; always need one. &lt;code&gt;start&lt;/code&gt; and &lt;code&gt;stop&lt;/code&gt; take several names or &lt;code&gt;--all&lt;/code&gt;, not both.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Sizes.&lt;/strong&gt; &lt;code&gt;--memory&lt;/code&gt; and &lt;code&gt;--disk&lt;/code&gt; are binary even when written &lt;code&gt;GB&lt;/code&gt;: &lt;code&gt;16G&lt;/code&gt;, &lt;code&gt;16GiB&lt;/code&gt;, and &lt;code&gt;16GB&lt;/code&gt; all mean 16 GiB, and a bare number is bytes. Linux inventory &lt;code&gt;GB&lt;/code&gt; is decimal.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Confirmation.&lt;/strong&gt; &lt;code&gt;recreate&lt;/code&gt; and &lt;code&gt;destroy&lt;/code&gt; print what they will delete and ask you to type the command name. &lt;code&gt;--yes&lt;/code&gt; or &lt;code&gt;--force&lt;/code&gt; skips the question and is required without a terminal; neither command has a &lt;code&gt;-y&lt;/code&gt; shorthand. Commands that download macOS from Apple (&lt;code&gt;up&lt;/code&gt;, &lt;code&gt;setup&lt;/code&gt;, &lt;code&gt;image update&lt;/code&gt;) ask first; &lt;code&gt;-y&lt;/code&gt;/&lt;code&gt;--yes&lt;/code&gt; skips that question and is required without a terminal.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;State.&lt;/strong&gt; Machines live under &lt;code&gt;$BARN_HOME/mac&lt;/code&gt;, separate from the Linux inventory. These commands ignore the Linux &lt;code&gt;BARN_IMAGE/BARN_ARCH/BARN_CPU/BARN_MEM/BARN_SCALE/BARN_DISK&lt;/code&gt; overrides.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Every option below has been available since 1.1.0.&lt;/p&gt;</description></item><item><title>Host Network Commands</title><link>https://barn.pgsty.com/v1.5/docs/reference/commands/network/</link><pubDate>Wed, 11 Nov 2026 00:00:00 +0800</pubDate><guid>https://barn.pgsty.com/v1.5/docs/reference/commands/network/</guid><description>&lt;p&gt;Every Linux node gets two NICs: one reaches the Internet through QEMU&amp;rsquo;s built-in NAT, and one sits on a fixed &lt;code&gt;/24&lt;/code&gt; where the host and the other nodes reach it at the address your inventory names (&lt;a href="https://barn.pgsty.com/v1.5/blog/design/fixed-ip-two-nics/"&gt;why two NICs&lt;/a&gt;). These commands manage the host side of that second network, &lt;code&gt;socket_vmnet&lt;/code&gt; on macOS and the &lt;code&gt;barn0&lt;/code&gt; bridge on Linux. &lt;code&gt;barn setup&lt;/code&gt; and the first interactive &lt;code&gt;barn up&lt;/code&gt; install it for you (&lt;a href="../setup/#barn-setup"&gt;host preparation&lt;/a&gt;); use these commands to check, repair, reconfigure, or remove it.&lt;/p&gt;</description></item><item><title>Repository Commands</title><link>https://barn.pgsty.com/v1.5/docs/reference/commands/repo/</link><pubDate>Wed, 11 Nov 2026 00:00:00 +0800</pubDate><guid>https://barn.pgsty.com/v1.5/docs/reference/commands/repo/</guid><description>&lt;p&gt;A static repository has a flat &lt;code&gt;images/&lt;/code&gt; directory and a generated &lt;code&gt;catalog.json&lt;/code&gt;. In 1.5.0, &lt;code&gt;barn repo build&lt;/code&gt; reads names, versions and architectures from filenames. Add &lt;code&gt;repo.yaml&lt;/code&gt; for aliases, channels, nonstandard names or different boot settings. &lt;a href="../../../start/images/#build-a-static-repository"&gt;Build a static repository&lt;/a&gt; · &lt;a href="../../images/#static-repository-format"&gt;Repository format&lt;/a&gt;&lt;/p&gt;&#10;&lt;div class="td-code td-code--untitled" id="td-code-813a5959-fence-0" data-td-code data-td-code-auto-id&#10; data-td-language="bash" data-td-line-count="3"&gt;&#10; &lt;div class="td-code__viewport" id="td-code-813a5959-fence-0-viewport" data-td-code-viewport&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;barn repo scan /srv/barn &lt;span class="c1"&gt;# inspect the files under images/&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;barn repo build /srv/barn &lt;span class="c1"&gt;# write catalog.json&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;barn repo verify /srv/barn &lt;span class="c1"&gt;# compare the catalog with the images and optional metadata&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;p&gt;All three have been available since 1.1.0. Each takes one repository root and has no options beyond the &lt;a href="https://barn.pgsty.com/v1.5/docs/reference/commands/#global-options"&gt;global options&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Image Commands</title><link>https://barn.pgsty.com/v1.5/docs/reference/commands/image/</link><pubDate>Wed, 11 Nov 2026 00:00:00 +0800</pubDate><guid>https://barn.pgsty.com/v1.5/docs/reference/commands/image/</guid><description>&lt;p&gt;Refresh signed catalogs, inspect or download images, import local files, and prune caches.&lt;/p&gt;&#10;&lt;p&gt;&lt;code&gt;barn image update&lt;/code&gt; is available from 1.4.0. &lt;a href="https://barn.pgsty.com/v1.5/docs/reference/commands/#versions"&gt;Version baseline&lt;/a&gt; · &lt;a href="https://barn.pgsty.com/v1.5/docs/reference/commands/#global-options"&gt;Global options&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;Official repositories and HTTP sources require a trusted detached signature. An explicitly selected custom HTTPS repository or local directory can be unsigned, provided the source is exactly that repository&amp;rsquo;s &lt;code&gt;catalog.json&lt;/code&gt;. Any supplied signature must verify. See &lt;a href="../../images/#trust-and-verification"&gt;catalog trust&lt;/a&gt;.&lt;/p&gt;&#10;&lt;h2 id="barn-update"&gt;&lt;code&gt;barn update&lt;/code&gt;&#10;&lt;/h2&gt;&#10;&lt;div class="td-code td-code--untitled" id="td-code-7f25fe65-fence-0" data-td-code data-td-code-auto-id&#10; data-td-language="text" data-td-line-count="1"&gt;&#10; &lt;div class="td-code__viewport" id="td-code-7f25fe65-fence-0-viewport" data-td-code-viewport&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;barn update [flags]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;p&gt;Fetch &lt;code&gt;catalog.json&lt;/code&gt; and its signature when required by repository policy, verify trust and revision rules, then atomically activate the catalog. Ordinary commands read local metadata. A newly built local repository can be read directly before its first explicit update. Remote catalogs require an explicit refresh. This updates image metadata, not the Barn executable. Repository precedence is &lt;code&gt;--repo&lt;/code&gt; &amp;gt; &lt;code&gt;--mirror&lt;/code&gt; &amp;gt; &lt;code&gt;BARN_REPO&lt;/code&gt; &amp;gt; the global official repository. See &lt;a href="../../images/#runtime-policy"&gt;repository selection and trust&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Guest Access and Hosts</title><link>https://barn.pgsty.com/v1.5/docs/reference/commands/access/</link><pubDate>Wed, 11 Nov 2026 00:00:00 +0800</pubDate><guid>https://barn.pgsty.com/v1.5/docs/reference/commands/access/</guid><description>&lt;p&gt;These commands reach running Linux guests from the host: &lt;code&gt;ssh&lt;/code&gt; and &lt;code&gt;exec&lt;/code&gt; run a shell or one command, &lt;code&gt;provision&lt;/code&gt; streams a script to several nodes, and &lt;code&gt;logs&lt;/code&gt; shows what a node printed. &lt;code&gt;ssh-config&lt;/code&gt; and &lt;code&gt;hosts&lt;/code&gt; publish node names so other host tools can reach the nodes too. Every command accepts the &lt;a href="https://barn.pgsty.com/v1.5/docs/reference/commands/#global-options"&gt;global options&lt;/a&gt;; &lt;strong&gt;Available in&lt;/strong&gt; shows availability from the 1.1.0 baseline onward (&lt;a href="https://barn.pgsty.com/v1.5/docs/reference/commands/#versions"&gt;version baseline&lt;/a&gt;).&lt;/p&gt;&#10;&lt;h2 id="remote-commands"&gt;Remote commands and &lt;code&gt;--&lt;/code&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;&lt;code&gt;barn ssh&lt;/code&gt; and &lt;code&gt;barn exec&lt;/code&gt; share one argument rule: Barn flags and at most one node name, then &lt;code&gt;--&lt;/code&gt;, then the remote command. They differ in what the guest receives:&lt;/p&gt;</description></item><item><title>Linux Lifecycle</title><link>https://barn.pgsty.com/v1.5/docs/reference/commands/lifecycle/</link><pubDate>Wed, 11 Nov 2026 00:00:00 +0800</pubDate><guid>https://barn.pgsty.com/v1.5/docs/reference/commands/lifecycle/</guid><description>&lt;p&gt;These commands take a Linux lab from an inventory to running VMs, change it, and tear it down. The &lt;strong&gt;Available in&lt;/strong&gt; column of each option table names the release that introduced the option (&lt;a href="https://barn.pgsty.com/v1.5/docs/reference/commands/#versions"&gt;version baseline&lt;/a&gt;).&lt;/p&gt;&#10;&lt;h2 id="choosing-a-command"&gt;Choosing a command&#10;&lt;/h2&gt;&#10;&lt;div class="td-table-scroll td-table-scroll--static"&gt;&#10;&lt;table class="wide expand td-table--wide"&gt;&#10; &lt;thead&gt;&#10; &lt;tr&gt;&#10; &lt;th scope="col"&gt;You want to&lt;/th&gt;&#10; &lt;th scope="col"&gt;Run&lt;/th&gt;&#10; &lt;th scope="col"&gt;What happens to disks&lt;/th&gt;&#10; &lt;/tr&gt;&#10; &lt;/thead&gt;&#10; &lt;tbody&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;See what a change would do&lt;/td&gt;&#10; &lt;td&gt;&lt;code&gt;plan&lt;/code&gt;&lt;/td&gt;&#10; &lt;td&gt;Nothing; read-only&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;Create the lab, or bring it back after a stop or reboot&lt;/td&gt;&#10; &lt;td&gt;&lt;code&gt;up&lt;/code&gt;&lt;/td&gt;&#10; &lt;td&gt;Kept&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;Boot, shut down, or reboot existing nodes as they are&lt;/td&gt;&#10; &lt;td&gt;&lt;code&gt;start&lt;/code&gt;, &lt;code&gt;stop&lt;/code&gt;, &lt;code&gt;restart&lt;/code&gt;&lt;/td&gt;&#10; &lt;td&gt;Kept&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;Restart nodes and re-apply the inventory (stop, then &lt;code&gt;up&lt;/code&gt;)&lt;/td&gt;&#10; &lt;td&gt;&lt;code&gt;reload&lt;/code&gt;&lt;/td&gt;&#10; &lt;td&gt;Kept; nodes new in the inventory are created&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;Change CPU or memory, or grow the root disk&lt;/td&gt;&#10; &lt;td&gt;&lt;code&gt;resize&lt;/code&gt;&lt;/td&gt;&#10; &lt;td&gt;Kept&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;Change image, architecture, data disks, network, or shares&lt;/td&gt;&#10; &lt;td&gt;&lt;code&gt;recreate&lt;/code&gt;&lt;/td&gt;&#10; &lt;td&gt;Root and non-persistent data disks replaced&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;Remove some nodes, or the whole lab but keep persistent data&lt;/td&gt;&#10; &lt;td&gt;&lt;code&gt;destroy&lt;/code&gt;&lt;/td&gt;&#10; &lt;td&gt;Deleted, except persistent data disks&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;Start over from nothing&lt;/td&gt;&#10; &lt;td&gt;&lt;code&gt;purge&lt;/code&gt;&lt;/td&gt;&#10; &lt;td&gt;Everything deleted, persistent data disks included&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&#10;&lt;p&gt;The full retention rules are in &lt;a href="../../../start/storage/#what-survives-each-operation"&gt;What survives each operation&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Preparation and Utilities</title><link>https://barn.pgsty.com/v1.5/docs/reference/commands/setup/</link><pubDate>Wed, 11 Nov 2026 00:00:00 +0800</pubDate><guid>https://barn.pgsty.com/v1.5/docs/reference/commands/setup/</guid><description>&lt;p&gt;&lt;code&gt;barn setup&lt;/code&gt; prepares a host to run Linux VMs: it installs QEMU and UEFI firmware, creates the fixed-IP network the nodes share, and writes an inventory if you have none. This page also covers &lt;code&gt;init&lt;/code&gt;, &lt;code&gt;validate&lt;/code&gt;, &lt;code&gt;doctor&lt;/code&gt;, &lt;code&gt;version&lt;/code&gt;, and &lt;code&gt;completion&lt;/code&gt;. Every command accepts the &lt;a href="https://barn.pgsty.com/v1.5/docs/reference/commands/#global-options"&gt;global options&lt;/a&gt;; &lt;strong&gt;Available in&lt;/strong&gt; shows availability from the 1.1.0 baseline onward (&lt;a href="https://barn.pgsty.com/v1.5/docs/reference/commands/#versions"&gt;version baseline&lt;/a&gt;).&lt;/p&gt;&#10;&lt;h2 id="barn-setup"&gt;&lt;code&gt;barn setup&lt;/code&gt;&#10;&lt;/h2&gt;&#10;&lt;div class="td-code td-code--untitled" id="td-code-2fb81c00-fence-0" data-td-code data-td-code-auto-id&#10; data-td-language="text" data-td-line-count="1"&gt;&#10; &lt;div class="td-code__viewport" id="td-code-2fb81c00-fence-0-viewport" data-td-code-viewport&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;barn setup [meta|dual|trio|full] [flags]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;p&gt;On a terminal, the first &lt;code&gt;barn up&lt;/code&gt; runs this preparation itself and asks once. Run &lt;code&gt;barn setup&lt;/code&gt; directly to preview the changes, to prepare a host from a script or CI job, or to get ready before the first &lt;code&gt;up&lt;/code&gt;. It creates no VMs and downloads no base images; &lt;a href="../lifecycle/#barn-up"&gt;&lt;code&gt;barn up&lt;/code&gt;&lt;/a&gt; does that.&lt;/p&gt;</description></item></channel></rss>