Mac Mini G4 Homeserver With Ubuntu Linux 10.04, WPA2

I finally got WPA2 to work on my old Mac Mini G4, which is running Ubuntu Linux 10.04 server edition for PowerPC (Update: WLAN worked for a while, but it seems to be very unstable. Could be the location where it sits, or the software – Update2: running it at another location, it seems to work fine and stable).

I wanted to use the old Mini as a homeserver for a long time, but my girl-friend had complained about the (faint) noise it makes. Without a wireless connection, I had to place it next to the router, which in turn is placed next to her room.

Now with wireless I put it on the fridge in the kitchen, which is already quite noisy. Unfortunately, my girl-friend still complains. But I hope she’ll either get used to it, or I can still find a better place. With WLAN, there are more options.

Since I have installed Ubuntu Server and Samba for serving Windows shares months ago, I have forgotten the steps and can not talk about them now. I remember that the Ubuntu installation was really simple. Also I had apparently already configured the driver for the Mini’s wireless card, so I am not sure how I got that working. For a long time, I was unable to get wireless to actually work, especially not with WPA_SUPPLICANT providing access to my WPA2 encrypted network.

Hopefully information for installing the correct drivers for the Mac Mini wireless card can be found reasonably easy, as I can not retrace the steps anymore. My Mini required the b43 drivers, which requires download of the firmware by installing the b43-fwcutter package (sudo aptitude install b43-fwcutter).

So assuming your driver is working, I eventually found WPAHowTo for an old version of Ubuntu that describes most of the steps for configuring WPA2 (I only read the WPA_SUPPLICANT parts of that HowTo). All the newer how-tos seem to assume a graphical user interface and only describe how to use network-manager.

All instructions say to shut down eth0 before trying to start wlan0 (that’s how they are called on my system). So I grudgingly connected the Mini to a monitor and a keyboard again to complete the configuration. I also tested wlan without encryption, which worked.

Next install wpa_supplicant if not already done (sudo aptitude install wpasupplicant).

My wlan network uses a preshared key, so I used wpa_passphrase to generate the basis for a config file:

wpa_passphrase NetworkEssid passphrase

(replace NetworkEssid and passphrase according to your network’s setttings).

which resulted in output like

network={
ssid="NetworkEssid"
#psk="TextPassphrase"
psk=somerandomnumbersandletters
}

Then create or edit /etc/wpa_supplicant.conf (on my system the file did not exist yet). Since it needs the output of wpa_passphrase, I actually piped the output of wpa_passphrase into a file and copied it to /etc/wpa_supplicant.conf (somehow piping there directly didn’t work). (all operations in /etc require root privileges, so sudo accordingly). Also change owner and group of the conf file back to root in case by copying it or creating it it became owned by your “normal” user (chgrp root thefile and chown root thefile).

After some searching around, I found an example wpa_supplicant.conf for a WPA2 WLAN network using a preshared key and CCMP/AES encryption here They say they need a weird “double configuration” for it to work, but actually it also worked for me when I removed the TKIP stuff. So my final wpa_supplicant.conf file looks like this:

network={
ssid="dummy"
proto=WPA2
key_mgmt=WPA-PSK
pairwise=CCMP
group=CCMP
#psk="dummydummy"
psk=somerandomnumbersandletters
}

(Except of course other values for dummy and psk). It is probably save to delete the line with the clear text password, too.

Now the instructions from the WPAHowTo said to test wpa_supplicant like this (already with my parameters, not the ones from the HowTo):

sudo wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -Dwext

(Omitting the -w parameter from the HowTo, doesn’t seem to exist anymore)

The problem here was the -D parameter, as here you are supposed to state the correct driver (also, apparently, instead of wlan0 your wlan might have a different device name). At the Homepage of the linux driver for the b43 I found the information that “wext” should be used for wpa_supplicant.

So, again following the old HowTo, I put the following into my /etc/networks/interfaces:

auto lo
iface lo inet loopback
address 127.0.0.1
netmask 255.0.0.0

#auto eth0
iface eth0 inet dhcp

auto wlan0
iface wlan0 inet dhcp
wpa-driver wext
wpa-conf /etc/wpa_supplicant.conf

Now if I power up the server, it automatically connects to my WPA2-encrypted WLAN. I was very happy about this and put the server on the fridge. However, while I started writing up this summary, I experienced several connection losses. Now I feel like giving up on connecting the server via WLAN and try one of those Powerline networking things instead, which enable networking through the electric power lines (like this one).. On the other hand, I just moved the Mac Mini server into my room to connect it to the monitor again, and here WLAN seems to work fine. So maybe it was just the location on top of the fridge that doesn’t work – it is closer to the router, but at another angle and with different walls in between. I might try some other places for the server yet.

One candidate might be the bathroom, but I am bit worried about the occasional high humidity.

There are yet more issues to be solved before my home server is ready. Backups, what kind of file systems to share, iTunes server (?) or something else?

One small thing I also haven’t yet found a solution for yet: it would be nice if the Mini would shutdown if I press the power button. At the moment the power button simply seems to be ignored by the Ubuntu Server installtion. I could not yet find a solution for this – in the net there are some instructions for making the power button initiate the shutdown sequence, but they are all for normal PCs, not for PowerPC Minis. If anybody knows of a solution, please let me know!

That way, my girl-friend could also power the server on and off without having to learn about ssh and linux shells, and it wouldn’t have to run all the time.

This entry was posted in Uncategorized. Bookmark the permalink.

5 Responses to Mac Mini G4 Homeserver With Ubuntu Linux 10.04, WPA2

  1. Chris says:

    Hi Bjorn,

    I got this working on my G4 Quicksilver with Ubuntu by installing pbbuttonsd.

    I had to modify /etc/pbbuttonsd.conf and change this line:

    OnAC_KeyAction = none

    to:

    OnAC_KeyAction = shutdown

    I ran /etc/init.d/pbbuttonsd restart to restart the daemon, and then the power button worked to trigger a clean shutdown.

  2. Björn says:

    Thanks, just tried it but it didn’t work. But I guess it is a start that could warrant further investigating, once I find the time :-/

  3. Oyvind says:

    I have never been able to get pbbutton to work on my old Mac mini (G4). But, in case others are looking for a quick but not so elegant solution the following small script worked for me:

    #!/bin/bash
    cat /dev/pmu | (while true ; do hd -n6 | grep 0000000 && shutdown -h now ; done)

    Saved as /usr/local/bin/shutdownscript and added to rc.local to start at boot. Don’t know why, but I need to press the power button twice to have it shutdown, but at least I can run the computer without keyboard and screen..

  4. Ricardo says:

    Great HowTo, I was fighting with wireless on my home server as well, now it works :thu:

  5. Daehenoc says:

    Hey Bjorn, I found a very useful guide for manually configuring WPA wireless and used it for my Mac Mini G4, so it’s attached to my wireless and is my weather station: http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch13_:_Linux_Wireless_Networking

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>