{"record":{"id":"88ed4ca326d5d29f","repo":"lima-vm/lima","slug":"instance-q-does-not-exist-run-limactl-create-88ed4c","errorCode":null,"errorMessage":"instance %#q does not exist, run `limactl create %s` to create a new instance","messagePattern":"instance %#q does not exist, run `limactl create (.+?)` to create a new instance","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/limactl/tunnel.go","lineNumber":72,"sourceCode":"\tif err != nil {\n\t\treturn err\n\t}\n\tif tunnelType != \"socks\" {\n\t\treturn fmt.Errorf(\"unknown tunnel type: %#q\", tunnelType)\n\t}\n\tport, err := flags.GetInt(\"socks-port\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tif port != 0 && (port < 1024 || port > 65535) {\n\t\treturn fmt.Errorf(\"invalid socks port %d\", port)\n\t}\n\tstdout, stderr := cmd.OutOrStdout(), cmd.ErrOrStderr()\n\tinstName := args[0]\n\tinst, err := store.Inspect(ctx, instName)\n\tif err != nil {\n\t\tif errors.Is(err, os.ErrNotExist) {\n\t\t\treturn fmt.Errorf(\"instance %#q does not exist, run `limactl create %s` to create a new instance\", instName, instName)\n\t\t}\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\tif port == 0 {\n\t\tport, err = freeport.TCP()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tsshExe, err := sshutil.NewSSHExe()\n\tif err != nil {\n\t\treturn err\n\t}","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/cmd/limactl/tunnel.go#L54-L90","documentation":"`limactl tunnel` looks up the target instance with `store.Inspect`; when the instance directory does not exist (os.ErrNotExist) the command returns this error suggesting `limactl create` with the same name. Note the suggestion itself is quirky — creating is normally done via `limactl create <template> --name <inst>`.","triggerScenarios":"Running `limactl tunnel <name> ...` where no instance named `<name>` exists under ${LIMA_HOME} (never created, wrong LIMA_HOME, or typo in name).","commonSituations":"Typos in the instance name; LIMA_HOME pointing at a different instance dir than used for create; instance deleted with `limactl delete`; running tunnel before ever running create/start.","solutions":["Run `limactl list` to see existing instance names and correct the name","Create the instance first (e.g. `limactl create template://default --name <inst>` then `limactl start <inst>`), then tunnel","Verify LIMA_HOME matches the environment used when the instance was created","If the instance was deleted, recreate it before tunneling"],"exampleFix":"// before\nlimactl tunnel myinst\n// error: instance \"myinst\" does not exist\n// after\nlimactl list\nlimactl create template://default --name myinst\nlimactl start myinst\nlimactl tunnel myinst","handlingStrategy":"validation","validationCode":"out, err := exec.Command(\"limactl\", \"list\", \"--json\").Output()\nif err != nil { return err }\nif !strings.Contains(string(out), fmt.Sprintf(\"%q\", instName)) {\n\treturn fmt.Errorf(\"instance %q not found; create it first\", instName)\n}","typeGuard":null,"tryCatchPattern":"inst, err := store.Inspect(ctx, instName)\nif err != nil {\n\tif errors.Is(err, os.ErrNotExist) {\n\t\treturn fmt.Errorf(\"instance %q does not exist; run `limactl create` first\", instName)\n\t}\n\treturn err\n}","preventionTips":["Run `limactl list` to confirm the instance name before tunneling","Use consistent LIMA_HOME across commands","Create and start the instance before running tunnel"],"tags":["cli","tunnel","instance"],"backgroundTag":"instance-not-found","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}