Like many of you, I need to share folders, time machine backup drive, and access to external DVD drive for my Mac machine. I have been using Ubuntu machine for many years with bunch of disks, share it to other machines.
I faced issues after upgrade my Mac to 10.7.x. Time Machine didn't work. I couldn't play DVD movies either. This problem is confirmed by Apple Support, they and suggest you to buy an expensive Super Drive.
This article is to help you solve those problems. The trick is to broadcast your Ubuntu server (announcing Netatalk AFP fileserver with Avahi) to Mac machines in the network automatically. So your Mac will see the Ubuntu server every time it's up, read shared folders, including time machine backup drive, and DVD sharing that you have setup in Ubuntu machine.
If you do something on the shared folders in Ubuntu, it will automatically tell your Mac. For example unmount/mount a shared disk or change CD/DVD. Mac and Ubuntu are finally a perfect match machines for you.
I use Ubuntu 11.04 LTS Natty Narwhal and Mac OSX Lion 10.7.3. I use latest Netatalk 2.2.2. But I think this should also work in newer version.
First thing to do is make sure you have setup Netatalk and Avahi properly in your Ubuntu machine. Second thing is optional, only if you also share DVD. Make sure you can see shared folder (and/or DVD drive) in your Ubuntu from Finder in your Mac.
If you haven't setup them, follow steps in this two blog spots: Share Folder in Ubuntu 11.04 for Mac OSX Lion, and Setup Shared DVD in Ubuntu for Mac OSX Lion.
After everything works then you can follow below simple additional steps.
Setup Avahi name server
Go to your Ubuntu machine, open terminal, edit hosts file using your favorite text editor (I use nano):
$ sudo nano /etc/avahi/hosts
Add the following line:
My Ubuntu server name is Ubuntu-Server, change the name as your PC's name and IP address as what you have set in your Ubuntu machine. Always use .local domain for Mac OSX compatibility.
Create Avahi service
Now create a new Avahi service for your machine.
$ sudo nano /etc/avahi/services/Ubuntu-Server.service
Add the following code:
<?xml version=”1.0″ standalone=’no’?>
<!DOCTYPE service-group SYSTEM “avahi-service.dtd”>
Restart Avahi service:
$ sudo service avahi-daemon restart
Go to your Mac and open Finder. You will see your Ubuntu Server automatically in Finder.
Additional tuning for DVD sharing
This step is only if your Mac is diskless or if you need to access shared DVD drive in Ubuntu machine.
One thing that I noticed after the setup is I found that Mac will complain that cnidb is not compatible and automatically change it to the default value. So let's change it a bit. Edit
$ sudo nano /etc/netatalk/AppleVolumes.default
Find the line for DVD sharing and change
macuserto the user you have setup in Ubuntu. The line will look like the below:
/media/dvd $v allow:macuser cnidscheme:last options:use dots,upriv
According to Netatalk documentation, this
lastoption is no longer recommended as dbd is heavily used for CNID backends. But I found it is still very-very useful especially for CD/DVD sharing. Luckily the latest version of Netatalk still keep it there.
The only small problem is Remote Disc in Finder still cannot recognize the shared DVD. Actually this is not a real problem, as long as you can play music and movie, or any CD. Am I right?
Play Movies using DVD Player
Login to your Ubuntu Machine. Insert the DVD disc into DVD drive in your Ubuntu. Go to your Mac, open DVD Player from Applications in Finder. Wait for few seconds until the content is mounted in Finder. Click File, select Open DVD media (command O), select the Ubuntu-Server (or whatever is your server name), select the share DVD drive, click Choose.
Alternatively you can play movies using VLC. Similar steps as above, open VLC. From the menu bar click File, select Open Disc. From Open Source window select DVD radio button, click File tab, then click Browse button. Then select Ubuntu-Server, select the shared DVD drive, check "Treat as a pipe rather than as a file", then click Open button.
Now you can get rid of all hassles to get all you need for your Mac from a fileserver: shared folders, time machine backup drive, and the most fun is to enjoy DVD movies from your Mac.
Next additional step to make it works perfectly for you is to auto mount DVD drive so every time you change disc it will automatically also change the content from your Mac.
Share your experience, or tell me if you have better trick.
Announcing remote Netatalk AFP servers with Avahi
Share Folder in Ubuntu 11.04 for Mac OSX Lion
Setup Shared DVD in Ubuntu for Mac OSX Lion