Skip to content

limactl edit: support editing a running instance#5072

Draft
itsme-ranger wants to merge 1 commit into
lima-vm:masterfrom
itsme-ranger:fix/edit-running-instance
Draft

limactl edit: support editing a running instance#5072
itsme-ranger wants to merge 1 commit into
lima-vm:masterfrom
itsme-ranger:fix/edit-running-instance

Conversation

@itsme-ranger
Copy link
Copy Markdown

What This PR Changes

Removes the hard error when limactl edit is called on a running instance, replacing it with two sensible behaviours:

  • Interactive (tty, no --set): prompts the user to stop the instance first; aborts if declined. After editing and validation, prompts to restart as usual.
  • Non-interactive (--set or similar flags): validates the new config on the current content first so the instance stays running if validation fails. Stops, applies, and restarts automatically only after validation succeeds.

Linked Issue

Closes #3346

How I Tested This

Unit tests pass. Integration test requires a running instance — tested the logic manually by reading through the control flow.

Previously `limactl edit` returned an error when the instance was running.

- Interactive (tty, no --set): prompt the user to stop the instance first;
  abort if declined. After editing and validation, prompt to restart as usual.

- Non-interactive (--set): validate the new config first so the instance
  stays running if validation fails. Stop, apply, and restart automatically
  only after validation succeeds.

Fixes: lima-vm#3346

Signed-off-by: Ramadhan Gerry Akbar <ramadhan.gerry@gmail.com>
@itsme-ranger itsme-ranger force-pushed the fix/edit-running-instance branch from d03bce0 to cd9db12 Compare June 2, 2026 09:36
@itsme-ranger itsme-ranger marked this pull request as draft June 3, 2026 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow editing a running instance

1 participant