{"record":{"id":"05ea37fb3b885feb","repo":"lima-vm/lima","slug":"failed-to-request-start-via-autostart-manager-w","errorCode":null,"errorMessage":"failed to request start via autostart manager: %w","messagePattern":"failed to request start via autostart manager: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/instance/start.go","lineNumber":313,"sourceCode":"\n\t\thaCmd.SysProcAttr = executil.BackgroundSysProcAttr\n\n\t\thaCmd.Stdout = haStdoutW\n\t\thaCmd.Stderr = haStderrW\n\n\t\tif launchHostAgentForeground {\n\t\t\tif isRegisteredToAutoStart {\n\t\t\t\tlogrus.Warn(\"The instance is registered to start at login, but the --foreground option was given, so starting the instance directly\")\n\t\t\t}\n\t\t\thaCmd.SysProcAttr = executil.ForegroundSysProcAttr\n\t\t\tif err := execHostAgentForeground(limactl, haCmd); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t} else if err := haCmd.Start(); err != nil {\n\t\t\treturn err\n\t\t}\n\t} else if err = autostart.RequestStart(ctx, inst); err != nil {\n\t\treturn fmt.Errorf(\"failed to request start via autostart manager: %w\", err)\n\t}\n\n\tif err := waitHostAgentStart(ctx, haPIDPath, haStderrPath); err != nil {\n\t\treturn err\n\t}\n\n\twatchErrCh := make(chan error)\n\tgo func() {\n\t\twatchErrCh <- watchHostAgentEvents(ctx, inst, haStdoutPath, haStderrPath, begin, showProgress)\n\t\tclose(watchErrCh)\n\t}()\n\twaitErrCh := make(chan error)\n\tif haCmd != nil {\n\t\tgo func() {\n\t\t\twaitErrCh <- haCmd.Wait()\n\t\t\tclose(waitErrCh)\n\t\t}()\n\t} else {","sourceCodeStart":295,"sourceCodeEnd":331,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/instance/start.go#L295-L331","documentation":"When the instance IS registered with an autostart manager (and the host agent should not run in the foreground), Lima delegates launching to the manager via autostart.RequestStart (e.g. kickstartctl/systemctl start). If that request fails, start aborts with this wrapped error.","triggerScenarios":"`limactl start <inst>` on an autostart-registered instance where RequestStart fails: systemd unit failed to start, launchd service rejected the kickstart, unit file missing/mangled, or the manager is not running.","commonSituations":"User systemd unit broken after an upgrade; instance registered under a different user than the one invoking start; launchd plist pointing to a stale limactl binary path; disk/log directory permission issues making the service fail instantly.","solutions":["Inspect the manager's own error/unit logs: journalctl --user -u 'lima*' (Linux) or log show --predicate for launchd (macOS).","Verify the autostart entry points at the current limactl binary; re-register: limactl autostart remove/unregister then re-register, or `limactl start` again after fixing.","Confirm the systemd user instance/launchd is healthy (systemctl --user status).","Bypass the manager by unregistering autostart for the instance and starting it in the foreground."],"exampleFix":"// before\nlimactl start myvm  # registered, RequestStart fails\n// after\njournalctl --user -u 'lima*' -e   # find the real failure\nlimactl stop -f myvm && limactl start myvm  # or re-register autostart","handlingStrategy":"try-catch","validationCode":"// verify the manager can act before requesting a start\nif runtime.GOOS == \"linux\" {\n  if err := exec.Command(\"systemctl\", \"--user\", \"is-active\", \"basic.target\").Run(); err != nil {\n    log.Println(\"systemd user manager not active\")\n  }\n}","typeGuard":null,"tryCatchPattern":"err := instance.Start(ctx, inst, \"\")\nif err != nil && strings.Contains(err.Error(), \"request start via autostart manager\") {\n  // unregister and start in foreground as fallback\n  _ = autostart.UnregisterFromStartAtLogin(ctx, inst)\n  err = instance.Start(ctx, inst, \"\")\n}","preventionTips":["Inspect manager unit logs (journalctl --user, launchd logs) when registered starts fail","Re-register autostart after upgrading/relocating the limactl binary","Keep the systemd user session active (linger) on servers","Use foreground start for interactive debugging instead of the manager path"],"tags":["autostart","systemd","launchd","startup"],"backgroundTag":"autostart-manager-unavailable","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}