lima-vm/lima · error

--condition=boot is only supported on macOS

Error message

--condition=boot is only supported on macOS

What it means

autostartEnableAction on non-Darwin platforms (autostart_others.go) rejects --condition=boot because boot-time startup is implemented only via macOS launchd LaunchDaemons. The non-macOS build only supports starting at login.

Source

Thrown at cmd/limactl/autostart_others.go:26

import (
	"errors"
	"fmt"
	"os"

	"github.com/sirupsen/logrus"
	"github.com/spf13/cobra"

	"github.com/lima-vm/lima/v2/pkg/autostart"
	"github.com/lima-vm/lima/v2/pkg/store"
)

func autostartEnableAction(cmd *cobra.Command, args []string) error {
	condition, err := cmd.Flags().GetString("condition")
	if err != nil {
		return err
	}
	if condition == "boot" {
		return errors.New("--condition=boot is only supported on macOS")
	}

	ctx := cmd.Context()
	inst, err := store.Inspect(ctx, args[0])
	if err != nil {
		if errors.Is(err, os.ErrNotExist) {
			return fmt.Errorf("instance %q not found", args[0])
		}
		return err
	}

	keepAlive, err := cmd.Flags().GetBool("keep-alive")
	if err != nil {
		return err
	}
	mgr := autostart.ManagerWith(keepAlive)
	if err := mgr.RegisterToStartAtLogin(ctx, inst); err != nil {
		return fmt.Errorf("failed to register instance %#q to start at login: %w", inst.Name, err)

View on GitHub (pinned to dd909d0973)

Solutions

  1. Drop the flag and use the default: `limactl autostart <instance>` (starts at login)
  2. On Linux, use systemd units directly for boot-time start (e.g. a systemd system unit running `limactl start`)
  3. Update cross-platform scripts to branch on OS before passing --condition=boot

Example fix

// before: limactl autostart myinstance --condition=boot   # Linux -> error
// after:  limactl autostart myinstance                      # login-time start on Linux
Defensive patterns

Strategy: validation

Validate before calling

if [ "$(uname -s)" != "Darwin" ] && [[ "$*" == *"--condition=boot"* ]]; then
  echo "--condition=boot is macOS-only; omit the flag on this platform"
  exit 1
fi
limactl autostart "$@"

Prevention

When it happens

Trigger: Running `limactl autostart <instance> --condition=boot` on Linux/Windows (or any non-Darwin build): the action sees condition=="boot" and returns this error immediately, before touching the instance.

Common situations: Copying a macOS-oriented command line (e.g. from documentation or a script written for a Mac) onto a Linux or Windows machine; scripting autostart across a heterogeneous fleet.

Related errors


AI-assisted analysis of lima-vm/lima@dd909d0973 (2026-09-01). Data as JSON: /api/errors/35715484639cdc58. Report an issue: GitHub.