{"record":{"id":"12ac0d6b8e79b9ad","repo":"lima-vm/lima","slug":"instance-q-does-not-exist-run-limactl-create-12ac0d","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/show-ssh.go","lineNumber":90,"sourceCode":"\tshellCmd.Flags().StringP(\"format\", \"f\", sshutil.FormatCmd, \"Format: \"+strings.Join(sshutil.Formats, \", \"))\n\t_ = shellCmd.RegisterFlagCompletionFunc(\"format\", func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective) {\n\t\treturn sshutil.Formats, cobra.ShellCompDirectiveNoFileComp\n\t})\n\treturn shellCmd\n}\n\nfunc showSSHAction(cmd *cobra.Command, args []string) error {\n\tctx := cmd.Context()\n\tformat, err := cmd.Flags().GetString(\"format\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tinstName := args[0]\n\tw := cmd.OutOrStdout()\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\tlogrus.Warnf(\"`limactl show-ssh` is deprecated. Instead, use `ssh -F %s %s`.\",\n\t\tfilepath.Join(inst.Dir, filenames.SSHConfig), inst.Hostname)\n\tsshExe, err := sshutil.NewSSHExe()\n\tif err != nil {\n\t\treturn err\n\t}\n\topts, err := sshutil.SSHOpts(\n\t\tctx,\n\t\tsshExe,\n\t\tinst.Dir,\n\t\t*inst.Config.User.Name,\n\t\t*inst.Config.SSH.LoadDotSSHPubKeys,\n\t\t*inst.Config.SSH.ForwardAgent,\n\t\t*inst.Config.SSH.ForwardX11,\n\t\t*inst.Config.SSH.ForwardX11Trusted)","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/cmd/limactl/show-ssh.go#L72-L108","documentation":"showSSHAction inspects the named instance via the instance store; when store.Inspect returns os.ErrNotExist it converts it into this user-facing error telling you the instance does not exist and suggesting `limactl create <name>`. It is a deliberate, friendly wrapper around a missing-instance lookup.","triggerScenarios":"Running `limactl show-ssh <name>` where no instance directory named <name> exists under ${LIMA_HOME} (default ~/.lima).","commonSituations":"Typo in instance name; instance never created; LIMA_HOME pointing to a different instance directory than expected; instance deleted; running as another user so a different home is used.","solutions":["List existing instances with `limactl list` and use the correct name","Create the instance first: `limactl create <name>` (or `limactl start <template>`)","Verify LIMA_HOME points at the directory containing the instance if it is customized","Run as the same user that created the instance"],"exampleFix":"// before\nlimactl show-ssh ubunut\n// after\nlimactl list           # find the real name\nlimactl show-ssh ubuntu","handlingStrategy":"validation","validationCode":"limactl list | grep -qx \"$inst\" || { echo \"instance $inst not found; run: limactl list\" >&2; exit 1; }","typeGuard":null,"tryCatchPattern":"if ! limactl show-ssh \"$inst\" 2>err.log; then\n  grep -q 'does not exist' err.log && limactl create \"$inst\"\nfi","preventionTips":["Always list instances before scripting against them","Set/verify LIMA_HOME consistently across shells and CI","Use the same OS user that created the instances"],"tags":["instance","cli","not-found"],"backgroundTag":"instance-not-found","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}