Skip to content

Conversation

afbjorklund
Copy link
Member

@afbjorklund afbjorklund commented Sep 23, 2025

Other container drivers with dynamic addresses and static ports also want to set the port after start.

This means that we have to provide their names too in "limatype", instead of making it fully external.

if *inst.Config.VMType == limatype.WSL2 || *inst.Config.VMType == limatype.AC || *inst.Config.VMType == limatype.DC

There is some weird hard-coded path handling left, that could be the topic of another PR perhaps?

@afbjorklund afbjorklund requested a review from unsuman September 23, 2025 16:11
@afbjorklund
Copy link
Member Author

afbjorklund commented Sep 23, 2025

There is a chicken-and-egg problem here, where the driver must be provided with a host port on creation...

Even though it is ignored, and then replaced with the real address and port as a side-effect of InspectStatus

@unsuman
Copy link
Contributor

unsuman commented Sep 23, 2025

There is a chicken-and-egg problem here, where the driver must be provided with a host port on creation...

Yes, I tried to tackle this in #3901, but was unable to do so due to time constraints. What are the possible ways to tackle this? 🤔
Earlier, I tried to first configure a driver with the port from the determineSSHLocalPort() func and then if the driver possessed the dynamicSSHAddress then we would have to create the driver once again

@afbjorklund
Copy link
Member Author

afbjorklund commented Sep 23, 2025

Another problem is that the ssh.config is written with the dummy response, so it remains at 127.0.0.1:22 forever.

So while the instance is updated, and limactl ls and limactl shell work, you can't use plain ssh to connect to it.

@AkihiroSuda AkihiroSuda added this to the v2.0.0 milestone Sep 24, 2025
@AkihiroSuda AkihiroSuda added the area/vmdrivers VM driver infrastructure label Sep 24, 2025
@afbjorklund
Copy link
Member Author

afbjorklund commented Sep 25, 2025

We will need to fix the issues with "no-op and side-effects" driver API and the address/port allocation separately.

@afbjorklund afbjorklund changed the title Use driver feature instead of the name Use driver feature instead of checking the name Sep 25, 2025
@AkihiroSuda
Copy link
Member

WSL2 CI failing

Other container drivers with dynamic addresses and
static ports also want to set the port after start.

Signed-off-by: Anders F Björklund <[email protected]>
type DriverFeatures struct {
CanRunGUI bool `json:"canRunGui,omitempty"`
DynamicSSHAddress bool `json:"dynamicSSHAddress"`
StaticSSHPort bool `json:"staticSSHPort"`
Copy link
Member

Choose a reason for hiding this comment

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

For consistency with DynamicSSHAddress, can we invert the logic and make this DynamicSSHPort ?

Copy link
Member Author

Choose a reason for hiding this comment

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

We could, but then it would be true by default - where we have mostly tried to keep our struct false by default

Copy link
Member Author

Choose a reason for hiding this comment

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

Since DynamicSSHAddress doesn't really do much at the moment, we could look at revising both of them?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Let's keep StaticSSHPort then.

DynamicSSHAddress can be revisited in a separate issue

Copy link
Member Author

Choose a reason for hiding this comment

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

I will draft a new PR, how we can revise the API (hopefully before 2.0 is out)

Move InspectStatus to the core, and make SSHAddress and GetStatus work

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.

Thanks

@AkihiroSuda AkihiroSuda merged commit b562d97 into lima-vm:master Oct 6, 2025
62 of 63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/vmdrivers VM driver infrastructure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants