lima-vm/lima · error
exiting, status=%+v (hint: see %#q)
Error message
exiting, status=%+v (hint: see %#q)
What it means
watchHostAgentEvents receives hostagent lifecycle events; when an event has Status.Exiting set, the hostagent reported it is exiting (usually after a fatal provisioning or startup error), and limactl converts the full status into this error, pointing at ha.stderr.log. The %+v of ev.Status includes errors and the last phase reported by the hostagent.
Source
Thrown at pkg/instance/start.go:403
progress := ev.Status.CloudInitProgress
if progress.Active && progress.LogLine == "" {
logrus.Infof("Cloud-init provisioning started...")
}
if progress.LogLine != "" {
logrus.Infof("[cloud-init] %s", progress.LogLine)
}
if progress.Completed {
cloudInitCompleted = true
logrus.Infof("Cloud-init progress monitoring done.")
}
}
if len(ev.Status.Errors) > 0 {
logrus.Errorf("%+v", ev.Status.Errors)
}
if ev.Status.Exiting {
err = fmt.Errorf("exiting, status=%+v (hint: see %#q)", ev.Status, haStderrPath)
return true
} else if ev.Status.Running {
receivedRunningEvent = true
if ev.Status.Degraded {
logrus.Warnf("DEGRADED. The VM seems running, but file sharing and port forwarding may not work. (hint: see %#q)", haStderrPath)
err = fmt.Errorf("degraded, status=%+v", ev.Status)
return true
}
if xerr := runAnsibleProvision(ctx, inst); xerr != nil {
err = xerr
return true
}
if showProgress && !cloudInitCompleted {
return false
}
View on GitHub (pinned to dd909d0973)
Solutions
- Read the ha.stderr.log path embedded in the error for the hostagent's fatal message
- Fix provisioning errors reported in ev.Status.Errors (printed just above)
- Validate lima.yaml fields (mounts, networks, provisioning scripts)
- Recreate the instance with `limactl delete -f` if state is corrupted
Example fix
// before
if err := lima.Start(ctx, inst); err != nil { return err }
// after
if err := lima.Start(ctx, inst); err != nil {
if strings.Contains(err.Error(), "exiting, status=") {
logrus.Errorf("hostagent exited; check %s", haStderrPath)
}
return err
} Defensive patterns
Strategy: try-catch
Validate before calling
// parse the status embedded in the error
re := regexp.MustCompile(`exiting, status=(.+?) \(hint`)
if m := re.FindStringSubmatch(err.Error()); m != nil { status := m[1] } Try / catch
if err != nil && strings.Contains(err.Error(), "exiting, status=") {
// read ha.stderr.log referenced in the message and surface its tail to the user
b, _ := os.ReadFile(haStderrPath)
logrus.Errorf("hostagent exited: %s", tail(b, 50))
} Prevention
- Test provisioning scripts independently before adding to lima.yaml
- Avoid racing `limactl stop` with `limactl start`
- Validate mounts/networks config before start
- Keep guest images up to date
When it happens
Trigger: Any `limactl start` where the hostagent emits an event with Exiting=true: failed provisioning scripts, fatal errors in port forwarding setup, guest agent never connecting, or explicit hostagent shutdown request.
Common situations: Broken provisioning in user-data/cloud-init scripts, invalid mount or network config in lima.yaml, guest image failing to boot, or `limactl stop` racing with `limactl start`.
Related errors
- host agent process has exited: %w
- did not receive an event with the `running` status
- expected status %#q, got %#q
- failed to check autostart registration: %w
- hostagent (%#q) did not start up in %v (hint: see %#q)
AI-assisted analysis of lima-vm/lima@dd909d0973 (2026-09-01).
Data as JSON: /api/errors/2b7cf5c2527a2fd2.
Report an issue: GitHub.