{"record":{"id":"1abb507ba7478545","repo":"lima-vm/lima","slug":"instance-q-is-stopped-run-limactl-start-s-to","errorCode":null,"errorMessage":"instance %#q is stopped, run `limactl start %s` to start the instance","messagePattern":"instance %#q is stopped, run `limactl start (.+?)` to start the instance","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/limactl/guest-install.go","lineNumber":68,"sourceCode":"\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tout = bytes.TrimSuffix(out, []byte{'\\n'})\n\treturn string(out), nil\n}\n\nfunc guestInstallAction(cmd *cobra.Command, args []string) error {\n\tinstName := DefaultInstanceName\n\tif len(args) > 0 {\n\t\tinstName = args[0]\n\t}\n\n\tinst, err := store.Inspect(cmd.Context(), instName)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif inst.Status == limatype.StatusStopped {\n\t\treturn fmt.Errorf(\"instance %#q is stopped, run `limactl start %s` to start the instance\", instName, instName)\n\t}\n\n\tctx := cmd.Context()\n\n\tsshExe := \"ssh\"\n\tsshConfig := filepath.Join(inst.Dir, filenames.SSHConfig)\n\tsshFlags := []string{\"-F\", sshConfig}\n\n\tscpExe := \"scp\"\n\tscpFlags := sshFlags\n\n\thostname := fmt.Sprintf(\"lima-%s\", inst.Name)\n\tprefix := *inst.Config.GuestInstallPrefix\n\n\t// lima-guestagent\n\tguestAgentBinary, err := usrlocal.GuestAgentBinary(*inst.Config.OS, *inst.Config.Arch)\n\tif err != nil {\n\t\treturn err","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/cmd/limactl/guest-install.go#L50-L86","documentation":"limactl guest-install refuses to operate on an instance whose recorded status is 'Stopped'. The instance directory exists, but there is no running VM to install guest files into, so the command aborts with a hint to start the instance first. This is a pre-flight state check in guestInstallAction right after inspecting the instance from the store.","triggerScenarios":"Running `limactl guest-install <name> ...` when store.Inspect returns an Instance with Status == limatype.StatusStopped, i.e. the instance was created or previously shut down and never started.","commonSituations":"Scripting guest-install after `limactl create` without a `limactl start`; an instance crashed or was stopped by `limactl stop`; running guest-install in CI where the VM was torn down between steps.","solutions":["Run `limactl start <instance>` first, then retry guest-install","Verify the intended instance name with `limactl list` — you may be targeting the wrong (stopped) instance","If the instance is broken, delete and recreate it with `limactl delete <instance>` then `limactl create/start`"],"exampleFix":"// before\nlimactl guest-install myinstance /path/script.sh\n// after\nlimactl start myinstance && limactl guest-install myinstance /path/script.sh","handlingStrategy":"validation","validationCode":"inst, err := store.Inspect(ctx, instName)\nif err != nil { return err }\nif inst.Status == limatype.StatusStopped {\n    return fmt.Errorf(\"start instance first: limactl start %s\", instName)\n}","typeGuard":"func isRunning(inst *limatype.Instance) bool { return inst != nil && inst.Status != limatype.StatusStopped }","tryCatchPattern":"if err := startInstance(ctx, instName); err != nil {\n    if strings.Contains(err.Error(), \"is stopped\") { /* recover by starting */ }\n    return err\n}","preventionTips":["Check `limactl list` status before guest-side commands","Chain start && command in scripts","Handle the Status field explicitly in automation"],"tags":["cli","instance-lifecycle","lima"],"backgroundTag":"instance-not-running","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}