I’m switching my web hosting to a Mac Mini running Ubuntu Linux. These are my notes for getting it set up.
Here’s the hardware specs:
- Apple Mac Mini 6,2 (Late 2012)
- Intel Core i7-3615QM 2.3 GHz quad-core processor
- 16 GB DDR3-1600 memory
- 128 GB solid state drive
- 1 TB 5400 RPM hard drive
The Mac Mini is built to run OS X 10.8, but Ubuntu 12.04.1 runs nicely with a couple of tweaks.
- Installing required the “noapic” flag (F6 when at the boot menu)
- Set “Boot after power failure” by running the following, and adding it to /etc/rc.local:
setpci -s 0:1f.0 0xa4.b=0
- Fan control doesn’t work without applesmc and macfanctld installed from Ubuntu’s Mactel PPA
- the network card doesn’t work out of the box, you need to download/compile a new version of the tg3 module from Broadcom
For networking, I didn’t want to have to remember to recompile the module after reinstalling each kernel. I setup DKMS to take care of it automatically.
- Download the Linux “tg3” driver from Broadcom (version 3.124c (10/18/12) at the time of this writing)
- Extract it
- Navigate to Server/Linux/Driver/tg3-3.124c.tar.gz
- Extract that file to /usr/src/tg3-3.124c/src/
- Create a file called /usr/src/tg3-3.124c/dkms.conf with the following contents:
PACKAGE_NAME=tg3 PACKAGE_VERSION=3.124c CLEAN="make -C src/ clean" MAKE="cd src/ && make BUILD_KERNEL=${kernelver} KVER=${kernelver}" BUILT_MODULE_NAME[0]="tg3" BUILT_MODULE_LOCATION[0]="src/" DEST_MODULE_LOCATION[0]=/updates AUTOINSTALL=yes |
- Add the module to DKMS so that it’s automatically built for new kernels:
sudo dkms add -m tg3 -v 3.124c sudo dkms build -m tg3 -v 3.124c sudo dkms install -m tg3 -v 3.124c |
- The module is now ready, either load it with “modprobe tg3” or reboot
- If you need to remove it at a later time, do:
sudo dkms remove -m tg3 -v 3.124c --all |
After these changes the Mac Mini is working great. I didn’t test Wi-Fi, Thunderbolt, or Sound, since I won’t be using them. USB works as far as being able to connect a keyboard and mouse, and Ubuntu’s 12.04.1 LiveCD boots into the full desktop.
Update:
Ubuntu has released 12.04.2 install/live CDs based on kernel version 3.5. I have not tested the above instructions with kernel 3.5, so if you’re following them you probably want to stick with the 12.04.1 install ISOs with kernel 3.2. If you install from 12.04.1, you will automatically stay on 3.2 even when updating to 12.04.2.
Update 2 (2014-10-05):
Ubuntu 14.04 and 12.04 with the Trusty hardware enablement stack (installed by default from the 12.04.5 ISO) have the required tg3 driver and do not need the custom DKMS config above.