Run Windows and macOS jobs
A job says what it needs. Takt runs it in the box that fits and throws the box away afterwards:
| Job needs | Runs in | Where |
|---|---|---|
| nothing special | the project’s container image (.devcontainer/ or Dockerfile) |
any Linux machine; a Mac’s Linux VM; a Windows machine’s WSL2 distro |
darwin, xcode, ios-simulator |
a fresh macOS VM (Tart) | a Mac with Apple silicon, at most two at a time |
windows |
a fresh Windows 11 VM, or a joined Windows machine | an x86_64 Linux machine with KVM, or a Windows machine with QEMU |
A machine that runs a job natively comes before one that would run it in a VM: a Linux machine’s own Docker before a Mac’s Linux VM or a Windows machine’s WSL2, a Windows machine before a Windows VM. A job never waits for a native machine, and when it runs in a VM anyway its log says why. One machine builds a project’s image and pushes it to the coordinator’s registry; the others pull it. Package and build caches persist per project on each machine. Nothing a project needs is installed on any host.
What a machine runs besides containers is a setting in its ⋯ menu on the dashboard, or:
takt machine set build-box --windows on # Windows VMs (off by default)
takt machine set mac-mini --macos off # macOS VMs (on by default on a Mac)
takt machine set laptop --linux-vm on # the Linux VM for containers (on for a Mac, off for Windows)
macOS
A Mac runs the worker and Tart, nothing else. Each macOS job gets a fresh VM, deleted afterwards, so your Mac stays as you left it. Apple’s licence allows two macOS VMs per Mac, and Takt keeps to it.
A VM that doesn’t boot within 5 minutes is replaced once by a fresh one, and the job’s log says so. Only a second failure loses the job.
macOS VMs run only from a logged-in session, so on a Mac Takt installs for you and starts at your login. With FileVault, the Mac needs a login after a restart. A Mac installed with --whole-machine starts at boot instead, and runs Linux container jobs only.
Linux container jobs run in one Linux VM that starts on demand and stops after 15 idle minutes. It gets all of the Mac but what macOS keeps (at least 4 GB or a quarter of its memory, and 2 cores): macOS gives a VM memory only as it uses it, so the Mac lends what its jobs use, not the VM’s size. When its disk runs short, Takt grows it by half if the Mac has room, and the dashboard says when it hasn’t.
Windows
Windows jobs (--feature windows) run like GitHub’s hosted runners: each in a fresh Windows 11 VM with its own short-lived worker, destroyed when the job ends. A short command takes 16 to 19 seconds end to end. One host builds the Windows image from Microsoft’s download servers and shares it through the registry.
Declare a project’s Windows tools once, and Takt bakes them into the project’s own Windows image; every Windows job starts from a fresh copy:
windows:
setup: |
winget install --id RubyInstallerTeam.RubyWithDevKit.3.4 -e --silent --accept-package-agreements --accept-source-agreements
gem install bundler
The image is keyed by a hash of the setup, so every checkout with the same setup shares it. See takt.yml.
A Windows PC can join too, with the line takt join-command --windows prints, pasted into PowerShell there (see Add machines). The join line sets it up: Git for Windows, and, after one explained administrator prompt, what its VMs need. It runs Windows jobs natively, faster than a VM boots, and Takt prefers it when it has room. A PC without WSL says “WSL isn’t installed: Linux jobs won’t run here” on its card, with the command that installs it, and Linux jobs run elsewhere; a container job that waits for that PC names the same command. Setup runs that command itself; when WSL’s installer can’t install WSL there, setup turns WSL’s Windows features on and installs WSL with winget, so one restart finishes it. Until that restart, the card says WSL waits for it. If winget can’t install WSL either, setup’s summary says the one step left: after the restart, run wsl --update in PowerShell as administrator. Windows sleeps an idle PC after 15 minutes by default; see A Windows PC between jobs.
A coordinator on Windows opens TCP port 7743, and UDP 5353 so other machines’ installers find it, in Windows Firewall on private and domain networks only, under the rule “Takt coordinator (TCP 7743)”, before it first listens, so Windows doesn’t ask about it. On a network Windows calls Public (its default for a new network), the installer says how to make it private (your own network), again in its summary’s Next steps, or to allow the ports there too with Set-NetFirewallRule -Name takt-coordinator, takt-discovery -Profile Any. Uninstalling Takt removes the rules. A coordinator installed for you alone (TAKT_USER=1) has no administrator to add them: allow it when Windows asks, on private networks.
On a Windows machine Takt runs as its own account, which can’t act as you in your folders, so it runs no --here jobs there. takt run -- echo hello from your home folder runs in a folder of Takt’s own instead; a project’s jobs ship its git repository.
| On a Windows machine | Runs in |
|---|---|
| Windows jobs | Natively, as Takt’s account, in a Job Object |
| Windows VMs | QEMU with the Windows Hypervisor Platform, Windows 11 Home included. These VMs have no AVX: QEMU can’t read a guest’s extended state back from WHPX. Setup turns them on once the PC can run them and has 60 GB free for the Windows image; with less, they stay off until you turn them on. |
| Linux containers | WSL 2, in a distro of Takt’s own, once its Linux VM is on. Takt never touches your own distros or your .wslconfig. The distro gets takt from Windows through its view of the C: drive, never over the network, so it works in WSL’s NAT and mirrored networking alike, whether the coordinator runs on this PC or another machine. The PC sets the distro up by itself once WSL 2 runs, which takes a few minutes the first time, and takes container jobs once that has worked. If it fails, its card, takt status and takt doctor say why, and Takt tries again every 10 minutes, or at once when takt doctor runs. On a whole-machine install the distro, takt-linux, belongs to Takt’s account, so wsl -l -v in your own window says it has no installed distributions: WSL is fine, and the distro is listed only for that account. |
For a project whose takt.yml declares windows, jobs run only in VMs from its image, so a pass means the same thing everywhere. --feature windows-native sends one to a Windows machine instead, and --feature windows-vm asks for a fresh VM from any project. A job that waits for a Windows VM while no machine runs them names each machine that could and what it lacks first, as takt capabilities does.
GPUs
Ask for the capability, not a vendor: cuda, nvenc, vaapi, vulkan, opengl, rocm or metal. Each machine offers only what its jobs can really use, and --gpu-mem reserves GPU memory. Metal runs in the macOS VM, on Apple’s paravirtualized GPU.