← Home Getting Started Commands SSH & Shutdown USB Accessories Metrics Building

Configuration

All fields are optional — havm run works with zero config. Place overrides in ~/.config/havm/config.yml (or /opt/homebrew/etc/havm/config.yml when running as a service).

Full Reference

vm:
  cpu_count: 4            # default: 4 — takes effect on next boot
  memory_size: "4 GiB"    # default: 4 GiB — takes effect on next boot
  disk_size: "32 GiB"     # default: 32 GiB — can be increased (not shrunk)

network:
  type: bridge            # bridge (default) or nat
  interface: "en0"        # override auto-detected bridge interface
  mac: "02:00:00:00:00:01"  # fixed MAC address (optional, random by default)
  hostname: "homeassistant.local"  # mDNS hostname or static IP

haos:
  release_channel: "pre-release"  # stable (default) or pre-release

ssh:
  authorized_keys: "~/.ssh/id_ed25519.pub"  # imported into HA OS for port 22222

usb:
  enabled: true           # default: true — USB accessory passthrough (macOS 27+)

ha:
  url: "https://homeassistant.local:443"  # default: probed — http://<ip> or http://<ip>:8123
  api_token: "eyJ..."     # HA long-lived access token (or use api_token_file / HAVM_HA_API_TOKEN)
  api_token_file: "~/.config/havm/ha.token"  # read token from a separate file
  ca_cert: "~/.config/havm/ca.pem"        # optional PEM/DER custom CA cert for HTTPS ha.url
  insecure_skip_verify: false             # set true to skip TLS verification for self-signed certs

logging:
  format: text            # text (default) or json (NDJSON, one object per line)
  level: debug            # debug, info (default), warning, error
  file: ~/Library/Logs/havm.log   # write the log here instead of stdout

metrics:
  enabled: true           # default: false
  type: prometheus        # prometheus (default) — extensibility point for OTLP
  prometheus:
    port: 9210            # default: 9210
    host: ["127.0.0.1", "::1"]  # default: both loopbacks — numeric bind addresses; the port above
                                #   applies to each. ["::"] for LAN access,
                                #   ["unix:///opt/homebrew/var/run/havm.sock"] for a Unix socket

shutdown:
  timeout_seconds: 90     # max wait for guest to halt (default: 90)

VM Settings

cpu_count

Number of virtual CPU cores. Default is 4, which is sufficient for HA OS with typical add-ons. Takes effect on the next boot.

memory_size

Memory allocated to the VM. Accepts human-readable sizes like "4 GiB", "2048 MiB", or "1 GiB". The configured amount is the maximum — a memory balloon device allows macOS to reclaim idle guest memory under host memory pressure. Takes effect on the next boot.

disk_size

Size of the persistent disk image. Can be increased from the default of 32 GiB, but cannot be shrunk. The underlying file is APFS sparse, so only actually-used blocks consume physical disk space.

Network

type

interface

When using bridge networking, specifies the physical interface to bridge (e.g., "en0" for Wi-Fi, "en5" for Ethernet). If omitted, havm auto-detects the primary interface.

mac

A fixed MAC address for the VM’s network interface. If not set, a random address is generated — but MachineIdentifier makes it stable across reboots anyway.

hostname

mDNS hostname (e.g., "homeassistant.local") or static IP. Used for SSH shutdown connections and HA API calls. Defaults to homeassistant.local in bridge mode; in NAT mode havm discovers the guest address from DHCP leases instead.

If another Home Assistant on your network already answers to homeassistant.local, set this explicitly so havm doesn’t address the wrong device — including for shutdown.

Slow uploads in bridge mode

On Macs whose bridged Ethernet interface lacks hardware TSO (TSO4/TSO6) — notably the 1 GbE Broadcom controller (AppleBCM5701Ethernet) in stock Mac mini M1/M4 models — Apple Virtualization’s bridge drops or mis-segments the guest’s 64 KB TSO/GSO frames on egress. The symptom is severely degraded TCP upload speeds from Home Assistant with high retransmission counts, while traffic between the guest and the Mac itself stays fast.

havm checks the bridged interface’s capabilities (SIOCGIFCAP) at startup and logs a warning when TSO4 or TSO6 is missing. You can verify the host interface directly with ifconfig en0 (options= will omit TSO4,TSO6).

Because the Virtualization framework exposes no offload control to havm, the fix lives in the guest. Connect over debug SSH (port 22222) and add a udev rule that caps GSO on the virtio NIC so the guest segments frames to MTU size:

cat <<'EOF' > /etc/udev/rules.d/90-havm-virtio-no-tso.rules
ACTION=="add", SUBSYSTEM=="net", DRIVERS=="virtio_net", RUN+="/usr/sbin/ip link set dev %k gso_max_size 1514 gso_max_segs 1"
EOF
udevadm trigger --action=add --subsystem-match=net --sysname-match=enp0s1

HA OS bind-mounts /etc/udev/rules.d from its persistent overlay partition and re-triggers udev at boot, so the rule survives reboots and HA OS updates without needing ethtool or modifying NetworkManager profiles.

Home Assistant

ha.url

Base URL of the Home Assistant web UI, e.g. https://homeassistant.local:443. By default havm probes the address the guest answered on — no port on HAOS 2026.8 and newer, 8123 on installations that predate it — and remembers which one replied. Set this only if Home Assistant lives somewhere neither default covers, or behind HTTPS.

Redirects are followed only when they stay on the same host and do not downgrade https to http (for example, an http:// → https:// upgrade on the same host is allowed). A reverse proxy that canonicalises to a different hostname is refused with a warning — set ha.url to the canonical URL instead.

ha.api_token / ha.api_token_file / HAVM_HA_API_TOKEN

A long-lived access token, used for the REST API shutdown call and for the Dock menu’s “Restart Home Assistant”. Without it, havm shuts the guest down over SSH instead.

To keep credentials out of config.yml, havm resolves the token in this order:

  1. The HAVM_HA_API_TOKEN environment variable
  2. ha.api_token_file — path to a file containing the token (whitespace trimmed)
  3. ha.api_token — inline in config.yml

The token is a bearer credential: anyone who can read the file holding it can use it. havm warns at startup and on hot-reload when config.yml (with an inline token) or api_token_file is accessible by other users:

chmod 600 ~/.config/havm/config.yml

On shared or untrusted LANs, note that the default probed endpoint uses plaintext HTTP over mDNS (homeassistant.local). Configure ha.url with HTTPS (or a static IP) to avoid transmitting the bearer token in the clear.

ha.ca_cert / ha.insecure_skip_verify

When ha.url uses HTTPS with a private CA or self-signed certificate:

Logging

havm logs to stdout. The format and level are configurable both in the config file and via CLI flags:

havm run -v                    # debug level
havm run -j                    # NDJSON output
havm run --log-format json --log-level warning

For launchd/Homebrew services, JSON logging to a file via StandardOutPath is recommended.

Hot Reload

The following settings take effect immediately when you edit and save config.yml — no restart required:

Setting Effect
logging.level Changes log verbosity within seconds
metrics.enabled / metrics.prometheus.port / metrics.prometheus.host Starts, stops, or reconfigures the Prometheus exporter. Changing host re-binds: a unix:// entry’s socket file appears, and the one it replaced is removed. A value that parses but cannot be bound leaves metrics down until it is fixed — the guest keeps running
ha.api_token / ha.api_token_file / ha.url / ha.ca_cert / ha.insecure_skip_verify Updates Home Assistant REST API credentials, endpoint, and TLS trust settings
shutdown.timeout_seconds Applies to the next shutdown attempt

Settings that do require a restart (they only take effect when the VM is recreated): CPU, memory, disk size, network type/interface/mac, USB, SSH key path, and log format. Run kill -HUP $(cat ~/Library/Application\ Support/havm/vm/havm.pid) for a graceful restart — havm halts the guest cleanly, reloads config.yml, re-applies disk size and SSH key settings, and starts a fresh VM in-process.

Metrics

See the Metrics page for Prometheus setup, available gauges, scrape configuration, and Grafana dashboard examples.