01/29 2013

Ubuntu 12.04 LTS on 2011 Mac Mini

This post should be short and sweet, because it was easy. This is a Macmini5,3, and with Ubuntu Server 12.04.

  1. Boot the Mac Mini and do the initial setup stuff.
  2. Using Disk Utility, resize the Mac partition to 40GB or so.
  3. Hook up an external CD drive (my Mini doesn’t have an internal one).
  4. Download Ubuntu, and burn it to a CD.
  5. Hold down “option” while you reboot the Mac Mini with the CD in.
  6. Use the arrow keys to pick the “EFI Boot” option when it appears on the far right.
  7. Go through the normal Ubuntu install process. Make sure you configure a wired network connection.
  8. The system should boot into Linux after setup.
  9. Do Linux things.

I lied

This post should be short and sweet, but I’m bad at computers.

Since I kind of quit doing PC hardware I mostly stopped having spare wired keyboards around; my desktop has a wired keyboard, my notebook computers are keyboards, and there’s some Bluetooth keyboards that came with computers in the closet. The only spare wired board I have is an Apple Design Keyboard, which hooks to USB through a Griffin iMate.

Apple Design Keyboard

The iMate is not a USB HID device. It’s an Apple Desktop Bus adaptor that exposes ADB to the system. Mac OS X 10.8 Mountain Lion still has ADB keyboard drivers. Ubuntu does not (Linux might, but Ubuntu doesn’t put them on the install CD because it’s 2012 2013 and Apple haven’t shipped ADB hardware for eight years). So I had to swap the USB keyboard off my desktop for the ADB keyboard.

Side note: look at the funky blue color of the USB cable on the iMate.

During Ubuntu setup, I didn’t have a spare network port at my desk, so I told it I’d do the network later when I plugged it in downstairs. Setup went normally, and the computer booted to a console. Hooray! Time to move the computer downstairs.

re-created screenshot of me repeatedly running nmap

Hmm, Airport Utility doesn’t show me a list of what IP addresses its DHCP server has allocated, but I can hammer everything with nmap! I learned that my Nest thermostat has a network presence, but couldn’t find my Linux box.

Wait, I thought I saw the light on the front blinking, could it possibly be freaking out because it has no monitor?

I bring the thing upstairs, and decide it should also have a network connection. I disconnect the PS3 and TV from wires (the PS3 has wifi, and the TV sucks at network stuff anyways), and rummage through the closet for the World’s Ugliest Switch.

World's Ugliest Switch, 2006

In 2006, this switch was recovered from (what amounts to) the trash after being ruined by a thunderstorm. My roommate and I replaced the busted power supply board with an old power cord for an internal hard drive, and jammed a wire into an ATX power supply wiring block to give it the 5V it wanted. Since then I’ve lost the ATX supply we hacked, so I had to spend a few minutes finding an appropriate wire to strip, finding the appropriate tool to do so (fingernail clippers), and the appropriate way to keep it in the wire harness (packing tape, which didn’t work very well, but it worked).

Network Configuration and Leaps of Faith

After getting the Mini hooked to the monitor, keyboard, and network, I found that it didn’t just assume I wanted to auto-discover network settings; it didn’t want to join the network at all. I told it to discover settings, rebooted it, and it worked, and showed on mmap.

Moved it back downstairs, and all was good!

I’m using the machine as a virtual machine host with OpenStack. I want an easy way to try stuff with Chef and other tools to make computers disposable in a sense: I want fixing settings to be done by demolishing the computer and re-building it, not by manually connecting and editing a file. OpenStack likes to have manually assigned IPs.

I open Airport Utility, tell it to only pass out IP addresses from 1-100 instead of 1-200, wait for it to restart, and reconfigure the VM host to be 101.

This involves changing a file that controls the network interface, asking the computer to take the interface down and back up, and hoping you didn’t mess it up or you’ll have to physically go to the computer and fix it. Low stakes when it’s downstairs, but still…

~> sudo ifdown eth0; sudo ifup eth0
[sudo] password for bkerley: 
 * Disconnecting iSCSI targets   ...done.
 * Stopping iSCSI initiator service   ...done.
 * Starting iSCSI initiator service iscsid   ...done.
 * Setting up iSCSI targets   ...done.
ssh stop/waiting
ssh start/running, process 27089
~>  

Somehow, I got it right the first time. Exciting!

By this time, it’s late, and I just go to bed with the SSH connection hanging open.

In the morning, it’s not on the network. First order of business:

With my hot cup of aeropressed Panther Finca las Mercedes (good coffee), I reboot the machine on my way upstairs, wait a minute, and it’s back. I read the logs, and it forgot to not auto-configure, and changed addresses on me in the middle of the night. That should be fixed since I rebooted it.

I went to switch keyboards on my desktop, but I pulled the wrong cord. The groovy translucent blue the iMate uses is also the same color as the Firewire 800 cord for my external SSD I run my iMac from, so I had to reboot that after facepalming.

I also forgot to configure name resolution (turns “facebook.com” into “173.252.110.27”), so that involved a second leap of faith.

With that nailed down, I seem to have run out of broken things to mess with, which is pretty much the story of computing right there.