Oh how I love Canada and the freedom of speech and expression. Back to the point of this blog.
Continue Reading »
Arbus Advisors, Let’s Leave the Bitch at Home Today
Emulate Ubuntu as OSX with Avahi
Why do I always want to eat Apple Pie when I hear “Apple Filling Protocol”? My Macbook Pro is my main workstation, however, I have 2 Ubuntu file servers sitting at home serving/streaming media across the network. Mac OSX’s Finder has a feature known as Bonjour, which allows the computers and devices to auto discover each other on a network. I have a bunch of services running on each of my Ubuntu file servers, namingly Vino VNC server for desktop sharing, Netatalk AFP for Ubuntu (for sharing files with Apple, and as well as Time Machine), and Samba file sharing (for Windows). While Bonjour is nice, in the sense that it performs auto discovery, however, different services publish their names differently, which results in a long list of services from a single machine. This post will show you how to get a long list of “devices and computers” into one nice and near package, as shown below:
First of all, I recently upgraded my machine to 11.10, which broke, the bloody netatalk package, so we need to download a custom version of netatalk.
Installing netatalk
Or rather reinstalling it. Since Ubuntu 11.10′s copy of netatalk is broken we need to use an alternative package: Logging in as root:
su #Enter root password
Remove the netatalk package:
apt-get remove netatalk --purge rm /etc/netatalk -R -f
Add new repository to the /etc/apt/sources.list by appending:
deb http://ppa.launchpad.net/jstrunk-math/ppa/ubuntu oneiric main deb-src http://ppa.launchpad.net/jstrunk-math/ppa/ubuntu oneiric main
Reinstall netatalk by:
apt-get update apt-get install netatalk
Replace the content of /etc/netatalk/afpd.conf with:
- -tcp -noddp -uamlist uams_dhx.so,uams_dhx2_passwd.so -nosavepassword
Edit the content of /etc/netatalk/AppleVolumes.default to export the local shares:
# The line below sets some DEFAULT, starting with Netatalk 2.1. :DEFAULT: options:upriv,usedots /share "Share"
Restart netatalk by:
service netatalk restart
Cool now your Ubuntu machine can talk to an Apple computer by using the Apple Filling Protocol
Installing avahi
Time to install avahi, the Ubunutu implementation of the ZeroConf protocol. Which will broadcast the devices and services on the machine to the network, so that they can be discovered by Bonjour, and vice versa.
apt-get install avahi-daemon libnss-mdns
We need to edit the /etc/nsswitch.conf by:
nano /etc/nsswitch.conf
Add “mdns” at the end of the host line. The line should look like:
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 mdns
We need to edit the avahi configuration file to disable
Time to add services to avahi in /etc/avahi/services, the 4 services we are interested in are:
/etc/avahi/services/afpd.service
Bill Li's %h File Server _afpovertcp._tcp 548 _device-info._tcp 0 model=MacPro
/etc/avahi/services/rfb.service
Bill Li's %h File Server _rfb._tcp 5900 model=MacPro
/etc/avahi/services/samba.service
Bill Li's %h File Server _smb._tcp 139
/etc/avahi/services/workstation.service
Bill Li's %h File Server _workstation._tcp 9 model=MacPro
Restart avahi by:
service avahi-daemon restart
And now you should be able to see the Ubuntu machines on your OSX machine.

