SMB shares: what determines macOS Finder icon?

seanm

Guru
Joined
Jun 11, 2018
Messages
570
I have a FreeNAS VM for testing, and a real box for production. In the macOS Finder, the former gets a nice server icon, and the latter gets a generic computer monitor icon. See attached image.

Any idea how this icon is determined? Is it something FreeNAS/samba supplies to clients? Or is it something macOS decides upon somehow or other? It'd be nice if my production system had the same icon as my test system, any idea how I can achieve that?
 

Attachments

  • FreeNASFinderIcons.png
    FreeNASFinderIcons.png
    6 KB · Views: 917

JaimieV

Guru
Joined
Oct 12, 2012
Messages
742
macOS (or rather Finder) decides based on the fingerprint it gets from the far server - sharing protocols advertised, Time Machine capability. When it's an Apple device, it generally gets the right outline. When it's not it's a bit pot luck, erring towards iMacs recently. I've never had any show up as Xserve+disk arrays, like you have there.
 

seanm

Guru
Joined
Jun 11, 2018
Messages
570
Weird, today my VM is no longer showing that "server" icon, but showing an iMac too...

I've filed <rdar://49168077> with Apple, asking for nicer icons for FreeNAS shares.
 

Michael Wenyon

Dabbler
Joined
Jan 3, 2016
Messages
23
I seem to remember that a line in the samba config file could be added to make the MacOS Finder show it as a server.

Freenas used to show up as a server icon for me, but not in the last year or so.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
It depends on the string presented in _device-info._tcp. mdns broadcast. Following is from 11.3.
Code:
class DevType(enum.Enum):
    AIRPORT = 'AirPort'
    APPLETV = 'AppleTv1,1'
    MACPRO = 'MacPro'
    RACKMAC = 'RackMac'
    TIMECAPSULE = 'TimeCapsule6,106'
    XSERVE = 'Xserve'

    def __str__(self):
        return self.value


class ServiceType(enum.Enum):
    ADISK = ('_adisk._tcp.', 9)
    AFPOVERTCP = ('_afpovertcp._tcp.', 548)
    DEV_INFO = ('_device-info._tcp.', 9)
    FTP = ('_ftp._tcp.', 21)
    HTTP = ('_http._tcp.', 80)
    HTTPS = ('_https._tcp.', 443)
    ISCSITARGET = ('_iscsi._tcp.', 3260)
    MIDDLEWARE = ('_middleware._tcp.', 6000)
    MIDDLEWARE_SSL = ('_middleware-ssl._tcp.', 443)
    NFS = ('_nfs._tcp.', 2049)
    SSH = ('_ssh._tcp.', 22)
    SFTP_SSH = ('_sftp-ssh._tcp.', 22)
    SMB = ('_smb._tcp.', 445)
    TFTP = ('_tftp._udp.', 69)
    WEBDAV = ('_webdav._tcp.', 8080)


If vfs_fruit is enabled, the device info is also returned as part of the SMB2 AAPL extensions. So you can test 11.3 and see if it shows up right.
 

Michael Wenyon

Dabbler
Joined
Jan 3, 2016
Messages
23
I am still on 11.2. I have 'fruit' checked in my VFS Objects for all my Samba shares.
 

seanm

Guru
Joined
Jun 11, 2018
Messages
570
I have an 11.3b1 test VM and just tried from several Macs and they all indeed seem to show a server-like icon now. Of course it did so sometimes with 11.2 also, so I can't be 100% it's not a coincidence.
 

Michael Wenyon

Dabbler
Joined
Jan 3, 2016
Messages
23
As some point I moved my Time Machine backups from an AFP share to an SMB share. I no longer have any AFP shares on my FreeNAS. I wonder if that had an effect?
 

Michael Wenyon

Dabbler
Joined
Jan 3, 2016
Messages
23
Here is a page on the samba.org Wiki where some modifications of the samba config file are listed, including 'fruit:model = MacSamba'
I have a feeling if I manually edit that using the command line on my FreeNAS that it will only work as long as the next upgrade (if that).
 

seanm

Guru
Joined
Jun 11, 2018
Messages
570
Here is a page on the samba.org Wiki where some modifications of the samba config file are listed, including 'fruit:model = MacSamba'

OTOH, here:


it says that fruit:model = MacSamba is the default, so not sure explicitly setting it will change anything. But I'll try this weekend when I reboot to install 11.2-U7.
 

seanm

Guru
Joined
Jun 11, 2018
Messages
570
It depends on the string presented in _device-info._tcp. mdns broadcast. Following is from 11.3.

Ah, do you mean to say this is new in 11.3? I've just noticed that my test VM (on 11.3) presents _device-info._tcp. but my production 11.2-U6 machine does not.
 

simon_b

Cadet
Joined
Mar 26, 2020
Messages
2
Ah, do you mean to say this is new in 11.3? I've just noticed that my test VM (on 11.3) presents _device-info._tcp. but my production 11.2-U6 machine does not.

I realise this thread is a little old but I've been trying to find a solution to this problem myself and discovered this thread while searching.

I think I've found the answer, just followed the Samba wiki instructions posted here but used Xserve instead of MacSamba for the model string and now my Samba server comes up as the server icon in Finder.

fruit:model = Xserve
 

Michael Wenyon

Dabbler
Joined
Jan 3, 2016
Messages
23
Glad it is working for you. The server icon for my Freenas recently (around 11.3) started appearing as a server on my Mac as well, even with

fruit:model = MacSamba
 

JaimieV

Guru
Joined
Oct 12, 2012
Messages
742
Mine did go to server for a while in 11.3, but is now showing as a Windows box in Finder. I'll have a go at setting fruit:model = Xserve when I get a moment.
 

simon_b

Cadet
Joined
Mar 26, 2020
Messages
2
An update for those who are having problems with fruit:model = Xserve in the Big Sur sidebar.

For me the Xserve icon was no longer showing in the sidebar but instead the generic icon again. To fix this I used the Macpro 2019 Rackmount model instead, like so:

fruit:model = MacPro7,1@ECOLOR=226,226,224

At least then it still looks a bit like a server :smile:
 

seanm

Guru
Joined
Jun 11, 2018
Messages
570
I've just tried on Big Sur 11.2, and I think it's buggy. The default "RackMac" icon shows if I click "Network" but not in the Finder sidebar. That's got to be a Finder bug. I filed FB8984475 with Apple.
 

Eric3

Cadet
Joined
Aug 16, 2022
Messages
1
I want to document exactly what changed between 11.2 and 11.3 with respect to how icons are shown for a FreeNAS server in the Finder. As mentioned above, the primary factor is the string presented in the _device-info._tcp. mDNS broadcast. The following screenshots use the Flame utility to show exactly what's being returned, although you can also inspect a record's value in Terminal with dns-sd -L servername _device-info._tcp.

Screen Shot 1.png

In this first screenshot, my zfstest server is running FreeNAS 11.2. With this version, a _device-info record with the default value of RackMac (the Xserve icon) will be broadcast only if the AFP service is running. But in this case, I have set hostname = ZFS-Test-NAS and mimic model = AirPort in the AFP service's aux params, causing both the mDNS records for AFP ("Personal file sharing") and _device-info to present an alternate hostname, resulting in a separate icon in Finder just for that service. The "zfstest" server is retaining its cached icon from before adding the aux params; relaunching the Finder will revert it to a generic one.

Screen Shot 2.png

The second screenshot shows the same server after upgrading to FreeNAS 11.3, which always broadcasts a _device-info record regardless of whether AFP is running. It doesn't pull the fruit:model value from the SMB service's aux params, nor does it pull mimic model or hostname from the AFP service's aux params — it's always set to RackMac.

Screen Shot 3.png

The only time that the SMB service's fruit:model value is used by the Finder is when the mDNS broadcast is not available, e.g. when accessing the server over a VPN, or when accessing it via a name or address that does not have a matching _device-info record. The third screenshot shows that a TrueNAS 12 server with fruit:model = MacPro7,1 set in its SMB service's aux params, when being accessed by its IP address directly, is shown in Finder with the Mac Pro icon instead of the Xserve.
 

seanm

Guru
Joined
Jun 11, 2018
Messages
570
Interesting research! Did you try 12 and 13? FreeNAS 11 is quite old by now.
 
Top