{"record":{"id":"35715484639cdc58","repo":"lima-vm/lima","slug":"condition-boot-is-only-supported-on-macos","errorCode":null,"errorMessage":"--condition=boot is only supported on macOS","messagePattern":"--condition=boot is only supported on macOS","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/limactl/autostart_others.go","lineNumber":26,"sourceCode":"import (\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/cobra\"\n\n\t\"github.com/lima-vm/lima/v2/pkg/autostart\"\n\t\"github.com/lima-vm/lima/v2/pkg/store\"\n)\n\nfunc autostartEnableAction(cmd *cobra.Command, args []string) error {\n\tcondition, err := cmd.Flags().GetString(\"condition\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tif condition == \"boot\" {\n\t\treturn errors.New(\"--condition=boot is only supported on macOS\")\n\t}\n\n\tctx := cmd.Context()\n\tinst, err := store.Inspect(ctx, args[0])\n\tif err != nil {\n\t\tif errors.Is(err, os.ErrNotExist) {\n\t\t\treturn fmt.Errorf(\"instance %q not found\", args[0])\n\t\t}\n\t\treturn err\n\t}\n\n\tkeepAlive, err := cmd.Flags().GetBool(\"keep-alive\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tmgr := autostart.ManagerWith(keepAlive)\n\tif err := mgr.RegisterToStartAtLogin(ctx, inst); err != nil {\n\t\treturn fmt.Errorf(\"failed to register instance %#q to start at login: %w\", inst.Name, err)","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/cmd/limactl/autostart_others.go#L8-L44","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Drop the flag and use the default: `limactl autostart <instance>` (starts at login)","On Linux, use systemd units directly for boot-time start (e.g. a systemd system unit running `limactl start`)","Update cross-platform scripts to branch on OS before passing --condition=boot"],"exampleFix":"// before: limactl autostart myinstance --condition=boot   # Linux -> error\n// after:  limactl autostart myinstance                      # login-time start on Linux","handlingStrategy":"validation","validationCode":"if [ \"$(uname -s)\" != \"Darwin\" ] && [[ \"$*\" == *\"--condition=boot\"* ]]; then\n  echo \"--condition=boot is macOS-only; omit the flag on this platform\"\n  exit 1\nfi\nlimactl autostart \"$@\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Branch installer scripts on `uname -s` before passing --condition","On Linux use systemd for boot-time startup instead of limactl flags","Keep macOS-specific flags out of shared provisioning scripts"],"tags":["macos","linux","windows","cli-flags","platform-support"],"backgroundTag":"unsupported-platform-feature","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}