Skip to content

Use SSHAddress for SSH forwarding in QEMU#3254

Merged
AkihiroSuda merged 1 commit intolima-vm:masterfrom
arixmkii:qemu-ssh-address
Feb 19, 2025
Merged

Use SSHAddress for SSH forwarding in QEMU#3254
AkihiroSuda merged 1 commit intolima-vm:masterfrom
arixmkii:qemu-ssh-address

Conversation

@arixmkii
Copy link
Copy Markdown
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.

Signed-off-by: Arthur Sengileyev <arthur.sengileyev@gmail.com>
Comment thread pkg/qemu/qemu.go
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@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