-
Notifications
You must be signed in to change notification settings - Fork 719
pkg/cidata: Enable mDNS in guest using systemd
#4272
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
pkg/cidata: Enable mDNS in guest using systemd
#4272
Conversation
This change allows resolving `<guest's hostname>.local` to guest ip by mDNS on macOS host. e.g. ```console $ limactl start --name shared-and-vznat --tty=false --network=lima:shared,vzNAT --containerd=none --log-level error ... $ dns-sd -q lima-shared-and-vznat.local DATE: ---Sat 01 Nov 2025--- 15:31:14.555 ...STARTING... Timestamp A/R Flags IF Name Type Class Rdata 15:31:14.555 Add 40000003 27 lima-shared-and-vznat.local. Addr IN 192.168.64.2 15:31:14.555 Add 40000002 31 lima-shared-and-vznat.local. Addr IN 192.168.105.3 ^C $ ping -c 1 lima-shared-and-vznat.local PING lima-shared-and-vznat.local (192.168.64.2): 56 data bytes 64 bytes from 192.168.64.2: icmp_seq=0 ttl=64 time=0.568 ms --- lima-shared-and-vznat.local ping statistics --- 1 packets transmitted, 1 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 0.568/0.568/0.568/0.000 ms ``` Signed-off-by: Norio Nomura <[email protected]>
f7797d5 to
4584ef8
Compare
… is enabled Signed-off-by: Norio Nomura <[email protected]>
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.
Doesn't this work with other drivers with lima:shared ?
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.
It works.
$ limactl start --name bridged --tty=false --network=lima:bridged --containerd=none --log-level=error
...
$ ping -c 1 lima-bridged.local
PING lima-bridged.local (192.168.12.43): 56 data bytes
64 bytes from 192.168.12.43: icmp_seq=0 ttl=64 time=1.068 ms
--- lima-bridged.local ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 1.068/1.068/1.068/nan ms
$ limactl start --name host-only --tty=false --network=lima:host --containerd=none --log-level=error
...
$ ping -c 1 lima-host-only.local
PING lima-host-only.local (192.168.106.2): 56 data bytes
64 bytes from 192.168.106.2: icmp_seq=0 ttl=64 time=1.090 ms
--- lima-host-only.local ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 1.090/1.090/1.090/nan msThere 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.
Does it work with QEMU, krunkit, and other potential drivers 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.
Sorry, PR's title was not correct. Fixed.
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.
I'll test with other drivers on macOS.
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.
It works with qemu and krunkit.
$ ping -c 1 lima-qemu.local
PING lima-qemu.local (192.168.105.6): 56 data bytes
64 bytes from 192.168.105.6: icmp_seq=0 ttl=64 time=0.748 ms
--- lima-qemu.local ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.748/0.748/0.748/0.000 ms
$ ping -c 1 lima-krunkit.local
PING lima-krunkit.local (192.168.105.5): 56 data bytes
64 bytes from 192.168.105.5: icmp_seq=0 ttl=64 time=1.005 ms
--- lima-krunkit.local ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 1.005/1.005/1.005/nan msIs there already a way to limit the execution of the boot script by the host OS?
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.
The script shouldn't care about the host OS. There should be a CIDATA variable that indicates the existence of IP-reachable network.
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.
At first, I tried to enable mDNS on the corresponding interface when Direct IP was detected, not as a boot script.
However, if there is no mDNS environment on the host OS side, I thought it would be meaningless to enable it, so I wanted to limit it to macOS.
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.
Moved 06-enable-mdns-on-systemd.sh from pkg/driver/vz to pkg/cidata.
systemd on macOS hostsystemd on VZ
Signed-off-by: Norio Nomura <[email protected]>
systemd on VZsystemd
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
|
Thanks! 🙏🏻 |
This change allows resolving
<guest's hostname>.localto guest ip by mDNS on macOS host.e.g.