Setup Samba for Bonjour networking with OS X 10.5 Leopard

| 8 Comments

finder-shared.png In previous versions of OS X it was never really convenient to connect to fileservers. Whenever you rebooted or got back to the home network you had to go apple-K, pick the previous selection, login, etc.

Alternatively you could do a bunch of voodoo to have the system auto-login, but whenever the fileserver was unavailable the Finder would hang a lot and it'd all be really annoying. Oh, and configuring it was a gigantic pain.

Not so in 10.5! Shared servers automatically Just Appear in all finder windows. So awesome!

Of course our main fileserver is a Linux box running Samba, so by default that didn't show up, but that is easy to fix.

On the Linux server, add a samba.service file in /etc/avahi/services (or somewhere similar; that's the location in Fedora 6 and 7).

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">

<service-group>
    <name replace-wildcards="yes">%h filer</name>
    <service>
        <type>_smb._tcp</type>
        <port>139</port>
        <host-name>zaphod.bn.dev</host-name>
    </service>
</service-group>

The <host-name> block was necessary on my system to get the client to connect to the right IP. If you server only has one IP on the network, it might not be necessary.

Now restart avahi (service avahi-daemon restart on Fedora / RHEL) and viola - you should see the server show up in OS X right away. The first time I connected I had to click the "Connect as ..." button to make it use my user credentials. After that it logs in automatically when I click on the icon.

Perfect!

8 Comments

Good article. Shame that the Samba guys dont do this automatically and get on the 21st century.

Shouldn't the icon share be something other than the picture of an LCD? The samba share that Leopard sees automatically (not configured through avahi) appears in my finder as a computer icon. If I manually add the samba.service file to avahi I get another icon of an LCD. My AFP share appears as an LCD too.

I stand corrected. I guess it's always an icon of a monitor, and for something it detects as PC (even though it's samba on Linux) it uses the CRT icon??

Spencer, Yeah - I'm not really sure why my Samba box at home shows up with the LCD icon. At the office our samba server (and the test windows computer) shows up with the CRT icon...

Marc, well - Samba is supposed to announce itself via NETBIOS (or whatever it's called). At the office I noticed this works, but at home it didn't for some reason.

Unfortunately, this didn't work for me..

I use this method for AFP (with an afpd.service) file, and I can see the dynamic changes if I move this file in and out of the /etc/avahi/services/ directory. When I move the file out, the server disappears from the "places" list almost instantly, and when I move it back, it reappears.

Not so I'm afraid for the samba.service.. It just doesn't appear and I can't figure out why.


Would this also work for VNC? I've been wanting to get that 'share screen...' button for my Linux and Windows installations through the sidebar. Note that I can connect to these installations using the Screen Sharing application. Does anyone know if this button is also Bonjour-based?

Thank you so much!

Leave a comment

About this Entry

This page contains a single entry by Ask Bjørn Hansen published on October 27, 2007 4:18 PM.

Find recent content on the main index or look in the archives to find all content.

Pages

OpenID accepted here Learn more about OpenID
Powered by Movable Type 4.33-en
/* bf */