lima-vm/lima · error
instance %q not found
Error message
instance %q not found
What it means
autostartEnableAction calls store.Inspect(ctx, args[0]) to load the instance; when the returned error matches os.ErrNotExist it is rewritten to this message. It means no instance with the given name exists under ${LIMA_HOME} (no <name>.yaml in the instances directory).
Source
Thrown at cmd/limactl/autostart_others.go:33
"github.com/lima-vm/lima/v2/pkg/autostart"
"github.com/lima-vm/lima/v2/pkg/store"
)
func autostartEnableAction(cmd *cobra.Command, args []string) error {
condition, err := cmd.Flags().GetString("condition")
if err != nil {
return err
}
if condition == "boot" {
return errors.New("--condition=boot is only supported on macOS")
}
ctx := cmd.Context()
inst, err := store.Inspect(ctx, args[0])
if err != nil {
if errors.Is(err, os.ErrNotExist) {
return fmt.Errorf("instance %q not found", args[0])
}
return err
}
keepAlive, err := cmd.Flags().GetBool("keep-alive")
if err != nil {
return err
}
mgr := autostart.ManagerWith(keepAlive)
if err := mgr.RegisterToStartAtLogin(ctx, inst); err != nil {
return fmt.Errorf("failed to register instance %#q to start at login: %w", inst.Name, err)
}
logrus.Infof("Instance %#q registered to start at login", inst.Name)
return nil
}
func autostartDisableAction(cmd *cobra.Command, args []string) error {
ctx := cmd.Context()View on GitHub (pinned to dd909d0973)
Solutions
- List instances with `limactl list` and use the exact name
- Check LIMA_HOME points at the intended data directory (`echo $LIMA_HOME`)
- Create the instance first with `limactl create <template> --name=<name>` if it never existed
- Quote the name in shell scripts to avoid mangling
Example fix
// before: limactl autostart myinstence // after: limactl list && limactl autostart myinstance
Defensive patterns
Strategy: validation
Validate before calling
if ! limactl list | awk '{print $1}' | grep -qx "$INSTANCE"; then
echo "instance '$INSTANCE' does not exist"; exit 1
fi Try / catch
try:
subprocess.run(["limactl", "autostart", name], check=True)
except subprocess.CalledProcessError as e:
if 'not found' in e.stderr.decode():
print(f"Instance '{name}' missing - run 'limactl list' or create it first")
else:
raise Prevention
- Always `limactl list` before scripting against an instance name
- Pin LIMA_HOME in scripts so enable/disable target the same store
- Quote instance names in shell to avoid truncation/word-splitting
- Recreate the instance before re-enabling autostart after deletion
When it happens
Trigger: `limactl autostart <name>` (or with --condition) where <name> does not match an existing instance: typo in the name, instance deleted, or LIMA_HOME pointing to a different Lima data directory than the one holding the instance.
Common situations: Typo'd instance name; running limactl with a custom LIMA_HOME that lacks the instance; instance removed by `limactl delete` but autostart still configured in scripts; new machine without `limactl create` having been run.
Related errors
- instance %#q does not exist, run `limactl create %s` to crea
- instance %#q not found
- failed to inspect instance %#q: %w
- instance %#q does not exist, run `limactl create %s` to crea
- failed to delete instance %#q: %w
AI-assisted analysis of lima-vm/lima@dd909d0973 (2026-09-01).
Data as JSON: /api/errors/d4bb53b5e04263ed.
Report an issue: GitHub.