Container like ‘anka run’ interface for Anka macOS VM

Anka run command line interface enables command execution inside Anka macOS VMs directly from the host. It’s very similar to container docker run.



Why is this interesting – It allows Devops to take their existing container based Linux CI workflow automation, repurpose it for macOS and use it on Anka Build macOS Cloud infrastructure for iOS CI.



anka run --help



Usage: anka run [OPTIONS] VM_NAME COMMAND [ARGS]...



Run commands inside VM environment



Options:


-w, --workdir PATH Working directory inside the VM [optional]


-v, --volumes-from, --volume PATH
Mount host directory (current directory by
default) into VM . '--volumes-from' is
deprecated form [optional]


-n, --no-volumes-from, --no-volume
Use this flag to prevent implicit mounting
of current folder (see --volume option).
'--no-volumes-from' is deprecated form
[optional]


-E, -e, --env Inherit environment variables. '-e' is
deprecated form [optional]


-f, --env-file PATH Provide environment variables from file
[optional]


-N, --wait-network Wait till guest network interface up
[optional]



‘anka run’ by default mounts the current folder from the host into the Anka macOS VM and executes commands on this mount point as the current directory. Upon completion of command execution, the mount directory is automatically released.
As a developer, this can be quite useful to be able to execute operations inside the VM environment in an isolated manner using artifacts/code residing on the developer machine.
Example,




anka run xcodebuild -sdk iphonesimulator -scheme Kickstarter-iOS build



–volume (-v) – Mount directory into VM. Mountpoint could be specified explicitly in this form:–volume /host/dir:/mountpoint, or assigned dynamically: –volume /host/dir. If no –workdir option is specified, mountpoint will be selected as working directory for running command.



Example :
anka run -v ~/Projects/anka:/tmp/anka run build



–no-volume (-n) – By default anka run command mounts current directory into VM, (implicit –volume $PWD option). Specify this option to disable implicit mounting. If no –workdir option is specified, working directory will be set to VM user’s home directory.



Example :



anka run -n xcodebuild -sdk iphonesimulator -scheme Kickstarter-iOS build - Will not mount the current host directory and execute build in the VM current directory.



–workdir (-w) – Specify working directory inside the VM



Example :



anka run -n -w /tmp/workspace/project git clone ${URL} src




anka run -n -w /tmp/workspace/project/src xcodebuild



–env (-E) – Inherit host environment variables in non-overriding mode.
Example :
CFLAGS=-O2 CC=clang anka run -E ${VM} make test.c



–env-file (-f) – Provide environment variables in overriding mode from file specified. Format of the environment file can be:



VAR=VALUE



VAR2=VALUE2



–wait-network (-N) – Resumed VMs require some time to reconfigure networking interface, so scripts which use networking immediately (e.g: git clone) could fail on network inaccessibility. This option postpones execution of the command till network is up. Incorporate it in your VM bootstrapping automation before starting to access network from inside the VM.

Share this post

Anka wordmark above a coding agent sending a commit to a CI agent in a fresh Anka VM inside a network boundary, with the Git mirror allowed and the host Mac and neighbor VM blocked
Why CI Agents for macOS and iOS Need Network-Secure Disposable Environments
AI coding agents hand commits to CI agents that make decisions while the job runs. On macOS and iOS, each CI agent needs a fresh VM per commit and a network boundary that limits what it can reach.
Read More
Anka wordmark above two macOS VMs and the host Mac, with VM-to-host and VM-to-VM links blocked by block local and --no-local
Network Isolation for macOS VMs: VM-to-VM, VM-to-Host, and ARP Spoofing Prevention
Meet macOS VM compliance requirements with Anka: block local for VM-to-VM and VM-to-host isolation, --no-local for a hard cut from the host, ARP spoofing prevention, and ipf-style IP filters on shared networking.
Read More
Diagram of Anka Build Cloud monitoring: anka_agent and Controller feed the Anka Prometheus Exporter, Prometheus scrapes it, promtail pushes Node and container logs to Loki, and Grafana reads both for dashboards and alerts
Monitor Anka Build Cloud Disk Space with Prometheus, Grafana, and Loki
Anka Build Cloud exposes node disk, capacity, and instance metrics through the Anka Prometheus Exporter, and its agent and container logs reach Loki through promtail. Here is how to scrape the metrics into Prometheus, graph free disk in Grafana, and alert...
Read More
Cursor Origin logo above an Origin PR to Buildkite to Anka VM flow for macOS CI on hardware you control.
Cursor Origin, Buildkite, and Anka: macOS CI on Agent-Hosted Repos
Cursor Origin now connects Buildkite for CI on Origin-hosted repos. Pair that with Anka's Buildkite plugin so each job runs in a disposable macOS VM on hardware you control.
Read More
Anka wordmark above two isolated VM windows: macOS 14 with Xcode 15, and macOS 15 with Xcode 16, on one Mac.
Running Several macOS and Xcode Versions Side by Side on One Mac
Run concurrent Anka macOS VMs with different OS and Xcode stacks on one host: density math for vCPU and RAM, and why per-project templates beat a shared mutable machine.
Read More
anka-and-kubernetes
On-Demand macOS VMs in Azure DevOps Pipelines with Anka
Run macOS VMs in Azure DevOps Pipelines with Anka. Anklet-style on-demand agents are blocked by Microsoft self-hosted pools today; use a registered agent plus per-job Anka VMs.
Read More
AWS + Anka Build Cost Diagramv3
Ephemeral macOS VMs on AWS EC2 Mac with Anka
Run ephemeral macOS VMs on AWS EC2 Mac with Anka and Anklet. Pack more iOS CI capacity per instance, start jobs in seconds, and cut cost.
Read More
Screenshot 2025-01-08 at 2.16
Enterprise macOS GitHub Actions Runners with Anka
Run self-hosted macOS GitHub Actions at enterprise scale with Anka and Anklet: ephemeral Apple Silicon VMs, more control than hosted runners.
Read More
The Anka product ladder: Develop, Flow, Build, and EC2 Mac as four ascending steps, with Crypt, MCP, Anka Scan, and AMI Scan named below
Which Anka Product Do You Actually Need? A Walkthrough of the Whole Lineup
A situation-first guide to every Veertu product: Anka Develop, Anka Flow, Anka Build, AWS EC2 Mac, Anka Crypt, Anka MCP, Anka Scan, and EC2 Mac AMI Scan, including the moment you move from one to the next.
Read More
anka2024v1-1536x768
A Year of Anka: Highlights from 2024
We’re starting a new annual tradition here at Veertu with our A Year of Anka blog posts. We want our customers to know how the product has grown over the past year and think this is a great avenue to do so. Please enjoy and happy holidays from all...
Read More