Debian Wheezy Linux on a Mac G5 – How To

My HackinTOS

English: Debian etch default Xfce install
English: Debian etch default Xfce install (Photo credit: Wikipedia)

I have had a Mac G5 for about a year now. I call it my HackinTOS.  I like having two 64-bit CPUs chugging away to edit audio. It has been a great beast but the Debian Squeeze on it has ended it’s support life.  It is time to wipe it and upgrade.  I know there are not too many of these machines around anymore but, based on the forum posts I have read, I imagine there are many who have had a “fun time” getting the machines to submit to Linux.  I thought I might share how to do so.  While I admit, I am a tad of a two-bit hack, I feel that I have some knowledge on this matter.

Before you do anything, back up all of your files.  If you do install Debian as I describe below, you are going to be erasing and re-writing you hard drive.

In this post I will cover:

  1. Getting my display to work with a Nividia GeForce 5200 Ultra graphics card
  2. Installing the XFCE desktop environment
  3. Installing some extra packages via synaptic
  4. Adding additional repositories
  5. Getting Synergy to start on login
  6. Automatically logging in when I hit the power button (failed)
  7. Getting the sound card to work
  8. Assigning keys to open and close the CD/DVD tray

Step One – Get an Image

CD
CD (Photo credit: grytr)

The first thing you will need is an install image on either a DVD or thumbdrive.  I went with a net install version of Debian Wheezy.  I opted to go with the lightweight XFCE desktop when I installed it. I suggest that you use the largest free space option and simply install every thing under home directory (the option suggested for new users). I also checked the file sharing box when prompted.  If you wish to share files on a network, do the same for it is this option that installs Samba and file sharing.

In short, get your image, boot from it and install. The net install is pretty straight forward.  If you have ever installed Windows, you should have no real problem installing Linux.  Also, a FYI, if you are stumped as to how to pop the CD drive open, hold down the mouse button as your G5 is powering up. While the install is pretty simple, I know with my machine it is not going to be that simple. The issue will be getting the Nvidia to properly buffer. Once it is installed reboot.

The “Ugly” Screen – Getting Nvidia to Play Nice

Power Mac G5
Power Mac G5 (Photo credit: Wikipedia)

My machine has a Nividia GeForce 5200 Ultra graphics card.  While it is a nice card, having it installed will result in a dead screen on rebooting.  Unless you plan on remote connecting or can type perfectly while blind, it is a problem.  I used a slightly modified approach to the one described in this forum post.  It is not a tough problem to fix:

  1. Boot the G5 and at the prompt type “Linux nomodeset”
  2. The machine will boot into a messed up display. Once it does, at the same time hit CTRL + ALT +F1
  3. You will drop to a terminal, log in… welcome to the world of CLI (Command Line Interface).  Don’t be afraid, you won’t be here for long.
  4. If you set up a root account, you will need to add yourself to the sudo list.  If you did not set up a root account on install, go to step 5. First type “su” and, when prompted type your password.  It is important to note that you are now logged in as root.  Be careful what you type for you can mess up your system. To add yourself to the sudo list type “adduser username sudo” where username is your username. You must end your session for changes to take effect so the easiest thing to do is type “reboot” and repeat steps 1-3.
  5. To modify the yaboot.conf file type “sudo nano /etc/yaboot.conf” and, when asked, enter your password. And then:
    1. Look for the section that begins with “image=/boot/vmlinux”
    2. While the exact text will vary, you need to add an append line to set the graphics card straight.  (Look over the forum post above for details and experiment.) in my case I had to add append=”nouveau.modeset=1 video=”nvidiafb=1024×768@60 video=DVI-I-1:d video=TV-1:d”  The bold text basically tells the system to use the VGA output at 1024×768, disable the DVI output and disable the TV output.  If your monitor is a different resolution and refresh rate, change the line accordingly.
    3. Hit CTRL + O and then return to save the file.  Then CTRL + X to exit nano.
    4. type “sudo ybin -v” to update the system.  Read the output to be certain that it actually made the changes.
  6. Now is a good time to make sure that you have the latest of everything installed.  Type “sudo aptitude update” and, when done, type “sudo aptitude safe-upgrade”
  7. Now type “sudo reboot” to reboot your machine.

What the Heck? No XFCE!

When I rebooted, I was unable to get to any desktop environment other Gnome.  It seems that the install only adds the “desktop=xfce” to yaboot and does not install xfce.  If you wish to stick with the Gnome desktop, that is up to you.  However, I have read that it is buggy on the Mac G5 and I know it is more resource intense than XFCE.  Personally, I always use XFCE. I strongly suggest you do the same, especially on older machines. To install xfce:

  1. Open a terminal and type “sudo apt-get install task-xfce-desktop xfce4-goodies”
  2. You can now type “exit” to close out the terminal
  3. When prompted, enter your password
  4. You should now be able to log out and log back in choosing the xfce desktop

Installing Synergy – Using Synaptic

Synaptic-package-manager-es
Synaptic-package-manager-es (Photo credit: Wikipedia)

I am one who likes to use Synergy.  It is software that allows me to use one keyboard and one mouse across several machines.  It also allows me to copy and paste text between the machines. I usually run four machines and four monitors.  It is very nice in terms of screen estate and a track ball is a great way to whip the cursor from monitor to monitor. Whether you wish to install this particular program or not, this section will still show you how to use the synaptic package manager.  It is really very straight forward.

  1. Go to Applications Menu/System/Synaptic Package Manager and open it
  2. Look for the icon which is a magnifying glass over a piece of text written paper located just to the right of the “Quick filter” in the middle top area of the window.
  3. Now simply type what you are looking for, in my case “synergy”
  4. Find your package in the list, then mark it for install.
  5. Repeat this for each additional package you want.  In my case, that would be audacity and easytag.
  6. Once you are done selecting packages, hit apply.

Enable the Non-Free Repositories

By default, Debian only installs the free software repositories.  To enable the non-free ones simply go to settings/repositories while you have the synaptic package manager open.  All you need to do is check the boxes to enable the additional repos.  While there are other repos one could add, keep in mind you we are discussing a very unique PC architecture.  I strongly suggest you only stick with the check box method I just mentioned.  I learned the hard way on a previous install that playing with the list repo file can give you some real ugly results.

Getting Synergy to Start on Login

Since I don’t want to leave my one keyboard, I don’t want to have to start synergy each time I login.  Fortunately, Debian makes it very easy.  All you need to do is go to the applications menu, then settings/session and start up.  Then click the Application Autostart tab.  When there, add an entry, I titled mine Synergy, with the command line “synergyc -f nameofhosemachine” where nameofhostmachine is the name of your hosting machine.

So, now that I have done all of the above, I should be able to reboot my machine and have it automatically connect to my other machines.  If you did as instructed above, you should be able to as well.  Furthermore, if there are programs you always want to launch when you log in, you can add them in a similar manner.

I must also note that Debian will also save a session on log out for you.  This means that what you had open on log out, should  open again on your next log in.  However, it has been my personal experience that it does not always work perfectly.  My personal preference is to close everything before I log out and add to autostart what I want to launch on every log in.

Automatically Logging In

At present, I have been unable to succeed in having my machine automatically log me in.  I found a few Debian lists that indicated the feature is no longer supported for this version of Debian.  While I have read a few work arounds, I have been unable to make any of them work.  If you are reading this and know how to solve my problem, please leave instructions in the comment section below.

Uh Oh – No Sound!

Speaker
Speaker (Photo credit: Wikipedia)

After I did all of the above, I transferred all of my audio projects in need of editing to the G5.   As I mentioned earlier, it is the main function of this machine.  I must admit that I was pretty unhappy when I opened Audacity and discovered, regardless of my settings, I could get no audio.  After some examination, I realized that, as far as Debian was concerned, I had no soundcard.  This would be a problem.

Unfortunately for me, I did not have this problem with the previous version of Debian nor any other Linux flavor I had installed on the G5 in the past.  In short, I had absolutely no knowledge on how to fix this issue.  I am not going to share with you the three plus hours of trial and error but only what fixed the issue for me.

I discovered the solution via this Debian list.  The issue is an incorrect black list and some missing entries in the modules file.  The first step was to go to /etc/modprobe.d and open blacklist.local.conf.  You will need to open the file with a sudo command or use su to become root.  Once you open it, place “#” at the beginning of the lines as below:

# blacklist snd-aoa-codec-tas
# blacklist snd-aoa-fabric-layout
# blacklist snd-aoa-i2sbus
# blacklist snd-aoa-soundbus
# blacklist snd-aoa

The “#” makes each of those lines a comment.  This means that the machine will ignore those lines when it boots and loads the OS.  In short, those items are no longer blacklisted.  However, this does not completely solve the problem.  While you told your machine it is allowed to load them, there is nothing telling the machine to actually load them.  To do that, you need to again go to nano as root and open up the file “modules” which is located in the /etc folder.  To that file, add the following:

# load AOA drivers
snd-aoa-codec-onyx
snd-aoa
snd-aoa-fabric-layout
snd-aoa-soundbus
snd-aoa-i2sbus

Again save the file and exit nano.  I also went into the synaptic to install the PulseAudio Volume Control.  I did so because I like to use a GUI interface when possible.  However,  that should not be a required step to get the audio working but just a convenience for adjusting the volume.  In fact, in previous installs, I would completely remove Pulse and use only ALSA.  Making the changes to the files above did restore audio when I rebooted my machine.

Ejecting and Closing the CD/DVD Tray

One of the things you will notice is that the Apple keyboard which accompanies the G5 is not exactly mapped out correctly.  Since I am almost always using another keyboard via Synergy it is not much of an issue for me persoanally.  It has never been an issue of enough importance for me to try and resolve.  If you have knowledge of how to map the keyboard properly, please feel free to share in the comments section below.

However, there is one missing keyboard button that I want  There is no easy way to eject/close the CD/DVD tray.  Add to it, the G5 case is not very “finger friendly” if you try and use the button on the drive. However, it is pretty easy to fix.  Simply assign a function key to do so.  In my case I use F9 to open it and F10 to close it.

  1. Go to the Applications Menu/Settings/Keyboard
  2. When the keyboard menu opens, click on the Application Shortcuts tab
  3. Click the Add button
  4. When the pop-up opens type “eject” in the command blank and hit return
  5. Now hit the F9 key
  6. Hit Add again, this time type “eject -t” in the command line and hit return
  7. Now hit the F10 key

You could, if you so desire, assign other keys.  You can also set keys to automatically launch programs and such.

Final Thoughts and Comments

Well, I have rambled on a good long bit about this.  If you are a G5 user attempting to use Linux, I hope it was of some assistance.  Feel free to leave comments and/or ask questions in the comment section below.

I also wish to note that the install is not 100% bug free.  Nvidia is known to be somewhat buggy with this install and I did notice that the lower portion of my screen, about 1/4 to 1/3 does not always display, especially in gedit.  However, scrolling over the area, the text immediately appears.  Since my main use of the machine is to edit audio and Audacity displays fine, I don’t have much of an issue with the bugginess of the display.

Finally, if you have any questions about Linux, feel free to leave me a comment and let us start a conversation on it.  I have been using the OS and many, many flavors of it for almost two decades now.  I think it is a great way to really tweak you machine and about the only way to securely gain extra life out of older hardware.  I would love to hear from other Linux geeks and “newbs” our there.