lima icon indicating copy to clipboard operation
lima copied to clipboard

Implement suspend and resume of VM

Open afbjorklund opened this issue 3 years ago • 2 comments

Description

Seems like QMP has these nice commands:

stop Suspend execution of VM

cont Reverse a previous stop command - resume execution of VM.

https://en.wikibooks.org/wiki/QEMU/Monitor#Virtual_machine

Allows you to suspend and resume the VM, through qmp.sock:

Welcome to the QMP low-level shell!
Connected to QEMU 4.2.1
(QEMU) stop
{"return": {}}
(QEMU) cont
{"return": {}}

afbjorklund avatar Jan 26 '22 20:01 afbjorklund

This would be super awesome for people on the go - easily free up some battery capacity by suspending the docker VM. We could even detect "no containers running" and do it automatically at some point.

I see @afbjorklund has taken a stab at implementing this in https://github.com/lima-vm/lima/pull/642, is that something lima would consider merging today if brought up-to-date?

cfstras avatar Sep 24 '24 11:09 cfstras

I can rebase it, but the main issue was that Lima lacked a "reconnect" option to bring the ssh socket back to life again.

  • https://github.com/lima-vm/lima/pull/642#issuecomment-1034209048

EDIT: Rebased the PR

afbjorklund avatar Sep 25 '24 05:09 afbjorklund