Saturday, October 26, 2013

Turning your Mac into an Ubuntu server

I have the original Mactel Pro 1,1. It has been a very trustworthy machine, even better than my MBP 8,2 which has fan issues... However, with OS X support stopping at Lion and a 32-bit EFI, the writing is on the wall. So I decided to turn it into an Ubuntu file and media server.

Linux has come a long way both in maturity and adoption since my first aborted effort with RH Linux eons ago. I love that you essentially don't need Microsoft or Apple anymore except that Apple still makes the best hardware for your money. Anyway, back to topic...

Dual-boot your Mac

The first thing you have to do is to make your Mac dual-bootable. With Macs, and with old Macs, this can be challenging. However, here is it distilled (in a Frankenstein-ish sort of way):
  1. In Mac OS, open a terminal window and type: "ioreg -l -p IODeviceTree | grep firmware-abi". If is says EFI32 like mine does, you can only install a 32-bit version of Ubuntu. I wasted a few DVD-ROMs before figuring this one out.
  2. Get Ubuntu and burn a bootable disk onto a DVD-ROM. I used 13.10 desktop. Follow these instructions to make your disk.
  3. Follow the directions here under "Dual Boot" > "Quick steps". Remember to first install rEFIt while still in Mac OS. It's brief but easy to follow. Mid-way through it becomes inaccurate. Some helpful hints here:
    • 13.x doesn't seem to have the "System" menu (or at least I couldn't find it...). Click on "Search your computer...", type "Terminal", open that, and type "sudo gparted". Helpful hint: gparted seems to only be available in the "Try Ubuntu" stage. If you want partition management after fully installing, you need to install it using "sudo apt-get install gparted"
    • When prompted, select "Something Else" then move to my next step...
  4. Once you're in gparted, the previous post breaks down quickly. Pick up the instructions here and scroll down to the first comment, which is the "accepted" answer.
  5. Ease on through the setup and when prompted to automatically download updates or sign into Ubuntu One, decline everything possible. A hang-up in any step will force you to do a hard reset and restart the installation process.
Most importantly, remember that Command-C is now Control-C. Gar.

Install Samba

I want to share my filesystem with other computers including (gag) Windows.  I typically run Windows-only software in VMWare Fusion and would like the files to be commonly accessible to all computers.

This document is a good summary of how to make that work and no re-booting is required to test it.  The limitation is that it doesn't include user-specific authentication, which is essentially part 2.

Install SSH

Of course, you will want to be able to administer a headless system.  This post describes it very succinctly.

Setup VNC

VNC is not recommended unless you are sure of your firewall, and only then, it should be between computers within your network.  If that's true, then enable "Desktop Sharing" by searching for "vino" (in Ubuntu).  A common Mac OS VNC client is Chicken of the VNC.

That's the basics!  In my case, I converted a second Mac OS hard drive to be used as a backup filesystem (since this is a file server after all...) but those details are not in the scope of this entry.