lima icon indicating copy to clipboard operation
lima copied to clipboard

ability to import standalone qemu instances to lima to manage

Open developer-guy opened this issue 2 years ago • 6 comments

Description

lima can create VMs based on QEMU. I could also create VMs based on QEMU, in those cases, I'd like to import this VM to lima to be managed by it like the env driver of buildx which lets you create a buildkitd daemon separetely and add it as a builder instance to buildx.

cc: @AkihiroSuda @dentrax

developer-guy avatar Jun 06 '22 19:06 developer-guy

For detailed context, see:

https://github.com/docker/buildx/pull/1078

developer-guy avatar Jun 06 '22 19:06 developer-guy

What do you mean by "import"

AkihiroSuda avatar Jun 06 '22 23:06 AkihiroSuda

What I mean by import is handing over to lima for managing the state of my VM created by me.

developer-guy avatar Jun 07 '22 07:06 developer-guy

This is not possible; the VM must be created/managed by Lima, which provides configuration via cloud-init.

If you create the VM manually, why don't you want to start/stop it with qemu as well?

jandubois avatar Jun 07 '22 16:06 jandubois

This is not about just starting/stopping, and it is about installing the necessary tools and software to my VM based on cloud-init configs provided by lima. When lima installs the necessary tooling to my VM, then my VM becomes one of the VMs that lima can manage/start/stop. I'm just shooting in the dark.

developer-guy avatar Jun 07 '22 20:06 developer-guy

Ok, I think this can work as long as your VM is using just a single disk image: shut down your VM and reference the image in a new lima.yaml file:

images:
- location: ~/some/path/my-vm.qcow2
  arch: "x86_64"

And then create a new Lima VM with that config. It should copy the image of your existing VM and use it as the basedisk of a new machine. Not sure if this is "importing", but I guess you can argue that it is.

jandubois avatar Jun 07 '22 22:06 jandubois