Skip to content

Use SSHAddress for SSH forwarding in QEMU #3254

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 19, 2025

Conversation

arixmkii
Copy link
Contributor

Fixes #3241

Extending config (effectively data object to pass into driver) with a new field. The field is filled in with the value from Instance. The field is filled only in Start method as it is only used during QEMU machine startup and make no sense in other methods.

Right now it will always be 127.0.0.1 as it is hardcoded during Instance inspect, but in my Windows experiment this value is updated based on WSL2 networking mode (this code still distant from upstream). There is no immediate use for this change, but there is no good reason to have this hardcoded inside driver, when there is already configurable source of truth.

Copy link
Member

Choose a reason for hiding this comment

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

This line needs to be updated too?

inst.SSHAddress = "127.0.0.1"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It will. Eventually. I have this changed in my prototype https://github.com/arixmkii/lima/blob/ffb66c42509c3575d74ca78e562e9085f1ecbd5e/pkg/store/instance.go#L99 But it uses new external dependencies and it is too early to enable this code here. This change is just a refactoring of existing code to make it configurable.

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 95f0262 into lima-vm:master Feb 19, 2025
31 checks passed
@arixmkii arixmkii deleted the qemu-ssh-address branch March 6, 2025 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

QEMU commandline should use Instance.SSHAddress insead of hardcoded loopback
2 participants