I have a home network with two Macs and a PC running Debian (and possible other distros in the future). I currently have Avahi set up on the Debian PC along with Netatalk, advertising the PC as an iMac.
When I click on the Mac Mini in the Finder sidebar, I see the following: The connection is authenticated as my Apple ID, and in addition to the AFP shares there is a button labeled "Share Screen..."
When I click "Share Screen...", a VNC connection to the Mac Mini opens in the first-party macOS VNC client.
When I click on the Debian PC ("Alpha") in the Finder sidebar, I see the following: The connection is authenticated as the remote local username, and I only see the Netatalk (AFP) shares.
Note that in the past I have used CIFS/SMB shares instead of AFP/Netatalk, and that worked just as well.
In the third-party application Screens, the "Nearby and Remote Computers" shows "Kandinsky" (an older Mac Mini that's actually offline) as well as the current Mac Mini. It's unclear whether or not Screens uses Bonjour (Avahi) in addition to its own handshake service, Screens Connect (which does not support Linux), for "Nearby and Remote Computers", but it seems potentially relevant here. The reason I use Screens is that the authentication protocol for GNOME's default VNC server is not compatible with the first-party macOS VNC client. Or something like that. (This is a known issue.)
Anyway.
When I run the command
$ avahi-browse --all --ignore-local --resolve --terminate
on the Debian PC, the output includes the following:
+ enp3s0 IPv6 Mac Mini VNC Remote Access local
+ enp3s0 IPv4 Mac Mini VNC Remote Access local
= enp3s0 IPv6 Mac Mini VNC Remote Access local
hostname = [macmini.local]
address = [192.168.4.63]
port = [5900]
txt = []
and
= enp3s0 IPv4 Mac Mini VNC Remote Access local
hostname = [macmini.local]
address = [192.168.4.63]
port = [5900]
txt = []
(My MacBook doesn't show up because it doesn't have Screen Sharing enabled.)
I know I can do the following with dns-sd
on my Mac:
% dns-sd -B <type> <domain>
which might give me some useful information, but
% dns-sd -B
doesn't show the Mac Mini, and trying to browse for "VNC Remote Access":
% dns-sd -B "VNC Remote Access"
Browsing for VNC Remote Access._tcp
DNSService call failed -65540
doesn't work, so that seems like a dead end.
To reiterate my question with all this background:
How can I have the Avahi daemon on my Debian PC advertise VNC Remote Access?
While I'm bearish on being able to use the first-party macOS VNC client, I'm bullish on what other possibilities might be opened up if the Debian PC (which presents itself as an iMac) were to present itself as having VNC Remote Access.
My best guess as to the solution is that I would create an Avahi service file, but the Avahi documentation (e.g. the man page for avahi.service(5)
) is pretty minimal on that front. The only service I currently have set up is /etc/avahi/services/afp.service
, which reads as the following:
$ cat /etc/avahi/services/afp.service
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>
<service>
<type>_device-info._tcp</type>
<port>0</port>
<txt-record>model=iMac</txt-record>
</service>
<service>
<type>_adisk._tcp</type>
<port>9</port>
<txt-record>sys=waMa=0,adVF=0x100,adVU=fbdbccf4-6b71-4995-8fa7-ad066939d808</txt-record>
<txt-record>dk0=adVN=Backups,adVF=0x81</txt-record>
</service>
</service-group>
Any idea how I might go about creating a corresponding file for VNC?
Or whatever it is I need to do?