Skip to content
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

Wrong host in _device-info._tcp (AVAHI) using macvlan networking #154

Open
chrisridd opened this issue Feb 1, 2025 · 3 comments
Open

Wrong host in _device-info._tcp (AVAHI) using macvlan networking #154

chrisridd opened this issue Feb 1, 2025 · 3 comments

Comments

@chrisridd
Copy link

What I see

Browsing macOS 15.3 Finder's "Networks" shows an entry called "files". Double-clicking it fails to connect.

Using Finder's "Go to server" I can use the correct URL for my Samba container, which opens, and adds another entry called "files.local" (with the TimeCapsule icon) into Finder's "Networks".

What I expected

I expected "Networks" to list my Samba container with the TimeCapsule icon, and for opening it to succeed and show the list of shares.

More info

My docker host is called portainer.local, and my Samba container using macvlan networking is called files.local. The entrypoint.sh script is writing this samba.service:

<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
 <name replace-wildcards="yes">files</name>
 <service>
   <type>_smb._tcp</type>
   <port>445</port>
 </service>

 <service>
  <type>_device-info._tcp</type>
  <port>0</port>
  <txt-record>model=TimeCapsule</txt-record>
 </service>

 <service>
  <type>_adisk._tcp</type>
  <txt-record>sys=waMa=0,adVF=0x100</txt-record>
  <txt-record>dk0=adVN=TimeMachine,adVF=0x82</txt-record>
 </service>
</service-group>

Wild guess

I think <hostname> needs to go in the _device-info._tcp section. Maybe the others too? Currently the dns-sd tool in macOS outputs the portainer address, which may explain the failure to connect.

$ dns-sd -L files _device-info._tcp 
Lookup files._device-info._tcp.local
DATE: ---Sat 01 Feb 2025---
14:17:14.671  ...STARTING...
14:17:15.102  files._device-info._tcp.local. can be reached at portainer.local.:0 (interface 14)
 model=TimeCapsule

But I don't really understand what's happening or what Finder is expecting.

@MarvAmBass
Copy link
Member

Hi there,

keep in mind that the zeroconf might be a bit hacky - it usually works only within a network and is not routable.

For me it usually works with both - I see the hostname and the pretty configured name with it's icon.

If you want to be sure, install avahi on your dockerhost and make a explicit configuration of your configuration.

I just checked, I have both in finder and both seem to work.

@chrisridd
Copy link
Author

I agree, zeroconf is only going to work on the LAN, which is fine. I'm apparently seeing all the published records so that part seems "OK".

I am using the example compose template, which does appear to create that samba.service file on the docker host, so must be relying on the host to publish the records, explaining the unexpected hostname. I was expecting the samba container to be publishing the service instead..

So removing the volume mapping '/etc/avahi/services/:/external/avahi' and the now bogus samba.service from the docker host (and reloading its avahi-service), does fix the dns-sd output.

Unfortunately I'm still getting 'files' (an iMac icon) in "Networks", which still does not open. Again, "go to server" with files.local works (and adds a server with the expected custom icon.) Maybe there's some stale stuff in Networks; I'm not sure how to debug that though except by rebooting the Mac. Which is kind of a 🔨 .

@chrisridd
Copy link
Author

I rebooted the Mac.

One icon now in Networks, matches the one specified by Samba, and opening it works.

...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants