Skip to content

Conversation

jandubois
Copy link
Member

This is similar to passing in the full path to limactl to allow an embedding application stored in a different location to launch a VM.

Simplified the internal calls by removing the limactl argument to instance.Start.

Also changed the order to look for external drivers first in LIMA_DRIVERS_PATH before looking in libexec, allowing the user to override the drivers in the default location. This also makes sure that the LIMA_DRIVERS_PATH drivers are found even when libexec cannot be located.

This is similar to passing in the full path to limactl to allow an embedding
application stored in a different location to launch a VM.

Simplified the internal calls by removing the limactl argument to instance.Start.

Also changed the order to look for external drivers first in LIMA_DRIVERS_PATH
before looking in libexec, allowing the user to override the drivers in the default
location. This also makes sure that the LIMA_DRIVERS_PATH drivers are found even
when libexec cannot be located.

Signed-off-by: Jan Dubois <jan.dubois@suse.com>
@jandubois jandubois added this to the v2.0.0 milestone Oct 4, 2025
// limactl and the guest agent is located from the corresponding <prefix>/share/lima directory.
//
// StartWithPaths calls Prepare by itself, so you do not need to call Prepare manually before calling Start.
func StartWithPaths(ctx context.Context, inst *limatype.Instance, launchHostAgentForeground, showProgress bool, limactl, guestAgent string) error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function seems to be called only from Start()? Then no need to make this function public?

Copy link
Member Author

@jandubois jandubois Oct 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole point of having limactl and guestAgent parameters is for calling it externally (outside of limactl itself); internally it always passes empty strings to use the default mechanism to locate them.

So I could have just added guestAgent as an extra parameter to Start, but I found it silly to pass the empty strings everywhere, so I instead turned it into a wrapper.

I know this is not a supported API, but I still find it useful that it is possible.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What applications calls Start externally?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What applications calls Start externally?

I have some; probably nobody else; idk. Currently playing with a Kubernetes controller that will provision Lima instances as an example of orchestration. Not yet open source, but will be, if it works out... I accept full responsibility of keeping it updated with whatever changes we make in Lima, but would like the capabilities to be exposed in some way.

Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging, but I suggest executing limactl

@AkihiroSuda AkihiroSuda merged commit ccc3adf into lima-vm:master Oct 4, 2025
36 checks passed
@jandubois jandubois deleted the usrlocal branch October 4, 2025 05:07
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.

2 participants