-
Notifications
You must be signed in to change notification settings - Fork 602
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
Support for native driver specific guest agent connection #1998
Conversation
49d6db2
to
85be61b
Compare
a6dca6a
to
853e43b
Compare
cmd/lima-guestagent/daemon_linux.go
Outdated
var ( | ||
vSockPort = 0 | ||
|
||
qemuFile = "/dev/virtio-ports/lima.guest_agent.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you document these virtio ports in https://lima-vm.io/docs/dev/internals/ ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, "qemuFile" sounds confusing.
Maybe this should be called virtioPort
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
qemuFile = "/dev/virtio-ports/lima.guest_agent.0" | |
virtioPort = "/dev/virtio-ports/io.lima-vm.guest_agent.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
else | ||
sudo "${LIMA_CIDATA_GUEST_INSTALL_PREFIX}"/bin/lima-guestagent install-systemd | ||
fi | ||
sudo "${LIMA_CIDATA_GUEST_INSTALL_PREFIX}"/bin/lima-guestagent install-systemd --vsock-port "${LIMA_CIDATA_VSOCK_PORT}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--vsock-port
shouldn't be specified for qemu mode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True but by default the port will be 0 for qemu so either way it will be ignored
pkg/qemu/qemu.go
Outdated
const MinimumQemuVersion = "4.0.0" | ||
const ( | ||
MinimumQemuVersion = "4.0.0" | ||
LimaGuestSock = "lima-guest.sock" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be called ga.sock
to match ha.sock
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was un-used, removed it
Signed-off-by: Balaji Vijayakumar <kuttibalaji.v6@gmail.com>
853e43b
to
f947de0
Compare
@@ -49,6 +49,7 @@ func installSystemdAction(cmd *cobra.Command, _ []string) error { | |||
args := [][]string{ | |||
{"daemon-reload"}, | |||
{"enable", "--now", "lima-guestagent.service"}, | |||
{"try-restart", "lima-guestagent.service"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was needed to properly upgrade on first start.
Without this, the below case was failing
lima 0.15 create and start -> stop -> lima 1 start -> guest is updated but not restarted to pick up latest one -> This will be taken only after second restart
Each drivers use their own mode of communication | ||
- `qemu`: uses virtio-port `io.lima-vm.guest_agent.0` | ||
- `vz`: uses vsock port 2222 | ||
- `wsl2`: uses free random vsock port |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we use a random port for vz too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vz create port on per vm basis so there is no way to get it ahead of time.
Since we are bootstrapping the vm i think we can be sure that it will be free
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
This seems to break connectivity on non-native and experimental drivers, due to missing directories.
It would have been nice if it had been backwards-compatible, to work with old agents and old drivers. |
Does this only affect #2000? |
As long as you have a working cidata/cloud-init and a regular driver, it should work (and was tested) But I was able to restore the functionality, and also removed the ugly hardcoded paths in lima-guestagent PR update is coming, but like so:
|
Implementation for #1925
Advantages
Tasks