lima-vm/lima · error

instance %#q does not exist, run `limactl create %s` to crea

Error message

instance %#q does not exist, run `limactl create %s` to create a new instance

What it means

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.

Source

Thrown at cmd/limactl/show-ssh.go:90

	shellCmd.Flags().StringP("format", "f", sshutil.FormatCmd, "Format: "+strings.Join(sshutil.Formats, ", "))
	_ = shellCmd.RegisterFlagCompletionFunc("format", func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective) {
		return sshutil.Formats, cobra.ShellCompDirectiveNoFileComp
	})
	return shellCmd
}

func showSSHAction(cmd *cobra.Command, args []string) error {
	ctx := cmd.Context()
	format, err := cmd.Flags().GetString("format")
	if err != nil {
		return err
	}
	instName := args[0]
	w := cmd.OutOrStdout()
	inst, err := store.Inspect(ctx, instName)
	if err != nil {
		if errors.Is(err, os.ErrNotExist) {
			return fmt.Errorf("instance %#q does not exist, run `limactl create %s` to create a new instance", instName, instName)
		}
		return err
	}
	logrus.Warnf("`limactl show-ssh` is deprecated. Instead, use `ssh -F %s %s`.",
		filepath.Join(inst.Dir, filenames.SSHConfig), inst.Hostname)
	sshExe, err := sshutil.NewSSHExe()
	if err != nil {
		return err
	}
	opts, err := sshutil.SSHOpts(
		ctx,
		sshExe,
		inst.Dir,
		*inst.Config.User.Name,
		*inst.Config.SSH.LoadDotSSHPubKeys,
		*inst.Config.SSH.ForwardAgent,
		*inst.Config.SSH.ForwardX11,
		*inst.Config.SSH.ForwardX11Trusted)

View on GitHub (pinned to dd909d0973)

Solutions

  1. List existing instances with `limactl list` and use the correct name
  2. Create the instance first: `limactl create <name>` (or `limactl start <template>`)
  3. Verify LIMA_HOME points at the directory containing the instance if it is customized
  4. Run as the same user that created the instance

Example fix

// before
limactl show-ssh ubunut
// after
limactl list           # find the real name
limactl show-ssh ubuntu
Defensive patterns

Strategy: validation

Validate before calling

limactl list | grep -qx "$inst" || { echo "instance $inst not found; run: limactl list" >&2; exit 1; }

Try / catch

if ! limactl show-ssh "$inst" 2>err.log; then
  grep -q 'does not exist' err.log && limactl create "$inst"
fi

Prevention

When it happens

Trigger: Running `limactl show-ssh <name>` where no instance directory named <name> exists under ${LIMA_HOME} (default ~/.lima).

Common situations: 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.

Related errors


AI-assisted analysis of lima-vm/lima@dd909d0973 (2026-09-01). Data as JSON: /api/errors/12ac0d6b8e79b9ad. Report an issue: GitHub.