{"record":{"id":"ca0130cc79e6839a","repo":"lima-vm/lima","slug":"failed-to-register-instance-q-to-start-at-login-ca0130","errorCode":null,"errorMessage":"failed to register instance %#q to start at login: %w","messagePattern":"failed to register instance %#q to start at login: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/limactl/autostart_others.go","lineNumber":44,"sourceCode":"\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)\n\t}\n\tlogrus.Infof(\"Instance %#q registered to start at login\", inst.Name)\n\treturn nil\n}\n\nfunc autostartDisableAction(cmd *cobra.Command, args []string) error {\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\tif registered, err := autostart.IsRegistered(ctx, inst); err != nil {\n\t\treturn err\n\t} else if !registered {","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/cmd/limactl/autostart_others.go#L26-L62","documentation":"autostartEnableAction delegates to the platform autostart manager via autostart.ManagerWith(keepAlive).RegisterToStartAtLogin(ctx, inst); this error wraps any failure from that registration (on non-Darwin: writing the desktop autostart entry or startup shortcut; propagated from the underlying manager).","triggerScenarios":"`limactl autostart <instance>` on Linux/Windows when RegisterToStartAtLogin fails: unwritable autostart location (~/.config/autostart on Linux, Startup folder on Windows), home directory missing, disk full, or the manager backend returning an OS-level error.","commonSituations":"Read-only or quota'd home directory; XDG_CONFIG_HOME pointing somewhere unwritable; enterprise policies blocking Startup-folder entries on Windows; disk full.","solutions":["Check the wrapped error text for the underlying cause","Verify the autostart directory exists and is writable: `mkdir -p ~/.config/autostart && touch ~/.config/autostart/test`","Check disk space in the home filesystem (`df -h ~`)","On Windows, confirm the user's Startup folder is writable and not policy-locked"],"exampleFix":"// before: limactl autostart myinstance  (fails: ~/.config/autostart unwritable)\n// after:  mkdir -p ~/.config/autostart && chmod u+w ~/.config/autostart && limactl autostart myinstance","handlingStrategy":"try-catch","validationCode":"mkdir -p ~/.config/autostart 2>/dev/null && touch ~/.config/autostart/.wtest && rm ~/.config/autostart/.wtest || {\n  echo \"autostart directory not writable\"; exit 1\n}\ndf -h ~ | awk 'NR==2 && $5+0 >= 95 {print \"home volume nearly full\"; exit 1}'","typeGuard":null,"tryCatchPattern":"cmd := exec.Command(\"limactl\", \"autostart\", inst)\nout, err := cmd.CombinedOutput()\nif err != nil {\n\tif strings.Contains(string(out), \"failed to register instance\") {\n\t\tlog.Fatalf(\"autostart registration failed (check autostart dir perms / disk space): %v: %s\", err, out)\n\t}\n\tlog.Fatal(err)\n}","preventionTips":["Keep ~/.config/autostart (Linux) and the Startup folder (Windows) writable","Watch home-directory quotas and disk space","Avoid exotic XDG_CONFIG_HOME values in automated environments","Read the wrapped %w cause first - it names the real OS failure"],"tags":["autostart","linux","windows","filesystem"],"backgroundTag":"autostart-registration-failed","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}