Yesterday, I blogged about my various issues setting up Apple Filesharing on the Debian virtual server I’ve got running in Parallels. As of OS X 10.5, Leopard, the Finder has a shared area which shows the machines it’s discovered via Bonjour so you can easily connect to them. Today I got bored of having the default icon for my server, bizarrely Apple have set the default icon as a Cinema Display (what?), I wanted something more visually informative. After some Googling around and a bit of configuration on the Debian side, the server is now using an XServe icon.
This all takes advantage of an enhancement Apple added in Leopard, which allows a savvy server to specify its type and model. Leopard then uses one of its icons for various Mac hardware to represent that server.
The MacRumours forums provided the solution to how to configure Avahi to specify the hardware type in it’s broadcast announcement. Before starting to mess around, I had the following text in my Avahi service definition at /etc/avahi/services/afpd.service (N.B. that path is for a Debian machine, other distros may put their service definitions elsewhere):
<?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-group>
After my alterations, the file read (I’ve emboldened the new portion):
<?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=RackMac</txt-record>
</service>
</service-group>
The model information I’ve used, sets the icon to an XServe icon (see the screenshot above). You can determine the model text you need to broadcast for other icons by digging through the Plist at /System/Library/CoreServices/CoreTypes.bundle/Contents/Info.plist.
Hi,
Exactly what i was looking for!! Now my NAS shows up as a Xserve device instead of an iMac
Greetz
Eldrik
Hi Eldrik – Glad to be of service!
Excellent tip! Thanks a lot!
For the lazy ones, these are other possible models:
Xserve (same a RackMac)
PowerBook
PowerMac
Macmini
iMac
MacBook
MacBookPro
MacBookAir
MacPro
AppleTV1,1
AirPort
There is a lot of submodels defined. But for those you’ll have to look in the plist.
Is there a possibility of editing this .plist file and adding diff models? I’m looking at the .plist file right now and testing it…
Hi Nils,
Did you ever get your tests with modifying the Info.plist file to work? I want to add a custom icon to Finder for a remote device mounted onto my Snow Leopard Mac. My device’s Avahi/AFP service config contains “model=DeviceX”. And I’ve copied my DeviceX.icns file into /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources. But I haven’t figured out what changes I need to make to the Info.plist. If you have any suggestions for me, let me know. Thanks.
By the way, if anyone else has suggestions for me, I’d appreciate hearing them.
Mark
Hi Nils… let us know how you get on with editing the .plist file, please!
Just FYI for anyone who may be curious: to show a Quicksilver instead of a Graphite PowerMac, use PowerMac3,5
Does anyone know how to accomplish this with mDNSresponder instead of Avahi ?
FreeNAS is forced to use mDNSresponder due to storage constraints for the emmbedded version so Avahi is out of the question..
Thanks in advance,
Adi
Adi, you can do the same with mDNSresponder by adding the following to the config file:
your-machines-hostname
_device-info._tcp.
1
model=Xserve
You can also let your device come up as a nifty iPhone icon by using the iPhone2,1 identifier. Very nice