{"record":{"id":"1104265aba8b8366","repo":"abiosoft/colima","slug":"s-not-running","errorCode":null,"errorMessage":"%s not running","messagePattern":"(.+?) not running","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/app.go","lineNumber":308,"sourceCode":"\t\t}\n\n\t\tif err := store.Reset(); err != nil {\n\t\t\tlog.Trace(\"error resetting store: %w\", err)\n\t\t}\n\t}\n\n\tlog.Println(\"done\")\n\n\tif err := generateSSHConfig(false); err != nil {\n\t\tlog.Trace(\"error generating ssh_config: %w\", err)\n\t}\n\treturn nil\n}\n\nfunc (c colimaApp) SSH(args ...string) error {\n\tctx := context.Background()\n\tif !c.guest.Running(ctx) {\n\t\treturn fmt.Errorf(\"%s not running\", config.CurrentProfile().DisplayName)\n\t}\n\n\tworkDir, err := os.Getwd()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error retrieving current working directory: %w\", err)\n\t}\n\t// peek the current directory to see if it is mounted to prevent `cd` errors\n\t// with limactl ssh\n\tif err := func() error {\n\t\tconf, err := configmanager.LoadInstance()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tpwd, err := util.CleanPath(workDir)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfor _, m := range conf.MountsOrDefault() {","sourceCodeStart":290,"sourceCodeEnd":326,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/app/app.go#L290-L326","documentation":"App.SSH refuses to run when the guest VM is not running; the message includes the profile display name. It is a precondition failure, not a crash: the VM must be started first.","triggerScenarios":"Running `colima ssh` while the VM is stopped, still starting, or gone after a crash/host reboot that killed the VM.","commonSituations":"New shell after a Mac reboot without `colima start`; VM stopped in another terminal; COLIMA_PROFILE pointing at a stopped or non-existent profile.","solutions":["Start the VM: `colima start`, then retry `colima ssh`","Confirm state first with `colima status`","Check the profile: `colima list` and set COLIMA_PROFILE correctly","If it should be running but is not, inspect `limactl list` for a wedged instance"],"exampleFix":"# before\ncolima ssh\n# error: colima not running\n\n# after\ncolima status || colima start\ncolima ssh","handlingStrategy":"validation","validationCode":"// gate ssh on a running VM\nif err := exec.Command(\"colima\", \"status\").Run(); err != nil {\n    if serr := exec.Command(\"colima\", \"start\").Run(); serr != nil {\n        return serr\n    }\n}\nreturn a.SSH(args...)","typeGuard":"func isVMNotRunning(err error) bool {\n    return err != nil && strings.Contains(err.Error(), \"not running\")\n}","tryCatchPattern":"if err := a.SSH(\"echo\", \"ok\"); err != nil {\n    if isVMNotRunning(err) {\n        // start the VM and retry once\n        if serr := exec.Command(\"colima\", \"start\").Run(); serr != nil {\n            return serr\n        }\n        return a.SSH(\"echo\", \"ok\")\n    }\n    return err\n}","preventionTips":["Start colima at login (brew services or a shell hook)","Check `colima status` in scripts before ssh","Verify COLIMA_PROFILE points at the intended profile"],"tags":["ssh","vm","precondition","status"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}