Linux Gains Ground on Macs
Volume Number: 15 (1999)
Issue Number: 7
Column Tag: Network Administration
Linux Gains Ground on Macs
by Todd Stauffer
Mac Admins Have Linux Choices Similar to Their PC Counterparts
Apple and Mac users have always had a love-hate relationship with Unix. It makes sense -- Apple has always appealed to universities and scientific installations, where Unix and it's variants have experienced similar receptiveness. Consider A/UX and Apple's X-Server packages, for instance, both of which I remember getting Macs on scientists' Macintosh desktops in the late 1980s.
And there's that little issue of huge server loads thanks to the Mac's creative tasks. AppleShare may be gaining some speed and caching capabilities, but creative houses have often turned to other outlets -- most recently Windows NT -- to handle the file, print and even Web serving needs of the typical creative office. Mac OS X server may stem some of that hegemony, but Linux can do something to help, too.
Long considered too risky for real work, Linux -- a freeware variant of Unix creative by Linus Torvalds of the University of Helsinki in Finland -- has been steadily gaining professional acceptance over the past few years. Seen as a Windows NT or commercial Unix killer in some circles, Linux also promises to give the Mac OS a boost in the right direction and might even give Mac OS X Server a run for its money among Apple shops.
The 'Why' of Linux
Why should Linux appeal to Mac administrators? In some cases, it definitely won't. Linux is not nearly the friendly environment that the Mac OS is, although it does offer unique graphical environments and reasonably easy-to-use applications. At its heart, though, Linux is a command-line operating system with text-based applications and configuration files that can be extremely powerful in the right hands -- and extremely frustrating to the rest of us.
Linux... can be extremely powerful in the right hands -- and extremely frustrating
to the rest of us.
"It's definitely not for everyday users right now," said Jason Haas, marketing director for LinuxPPC, Inc. "It's way too complicated to get set up and running. That's something that will change in 1999."
In the meantime, intermediate users who "live on the Internet" can get started with Linux right now. Haas claims that 60% of Windows NT administrators use Linux at home. Likewise, Mac OS X is still an unknown quantity, Haas said, making Linux that much more attractive for Mac OS and cross-platform system administrators and Webmasters.
What it doesn't have in friendliness, though, Linux more than makes up for in performance. Compared to the overhead required for Open Transport, the Mac OS APIs and so on, Linux for Macintosh versions run considerably faster, with the LinuxPPC version (which doesn't rely on the Mach kernel that's found in Apple's MkLinux and other advanced OSes) is said to run 20% faster than MkLinux and Rhapsody DR3 (Mac OS X Server).
Linux also offers a much more buzzword-compliant OS than is currently available from Apple in the form of the Mac OS, including preemptive multitasking, protected memory and multiprocessing. All this can take place in a text-based or a mix of a text and graphical environment, allowing for efficient programs to be written with a minimum of interface elements, thus taking up less RAM and processor cycles.
That leads to an incredible efficiency that means nearly any PowerPC-based machine is a viable Linux box -- 604e and G3 based machines are screamers. But nearly any of them will do, and they don't even need the specifications required to run the basics of the Mac OS -- a LinuxPPC box can get away with 16 MB of RAM, 1.2 GB of hard drive space and a 603e or better processor.
Finally, Linux is a very network- and Internet-savvy OS, offering the benefits of a Unix-style client/server environment. That means you can literally log into a Linux machine from across the Internet and run applications on that machine while viewing the interface on whatever you're using to connect. Access your e-mail applications, file directories and
What it doesn't have in friendliness, though, Linux more than makes up for in performance
administrative tools from anywhere you can find an Internet connection. Users of Timbuktu (which allows you to screen-share and control a Mac or PC from a Mac workstation), will appreciate the fact that Linux can even be used over a modem connection, since the application itself is run on the remote computer. That means Linux is much faster than a Timbuktu session, especially over slower connections.
Combine all of this with the Unix-standard Apache Web server (available as freeware), commercial Applixware productivity tools, AppleTalk support, Netscape Navigator, tons of X-Windows and programming tools and you've got a powerful argument for switching OSes on your PowerPC-based equipment -- especially if you're in the market for a cheap, fast server. Remember -- Linux is freeware.
The Linux Experience
There are two different distributions of Linux for the Macintosh -- MkLinux, a joint venture supported by Apple and The Open Group to port Linux to the Mach microkernel, the same underpinnings being used for Mac OS X and Mac OS X Server. The project has issued "developer release 3" (DR3) of the software, a stable and useful iteration of Linux. Installation is based on RedHat 5.0, a common PC version with a friendly approach to installation. The MkLinux distribution can be downloaded from Apple's MkLinux site or it can be bought on CD-ROM from Prime Time Freeware, which has also publisher a book called "MkLinux." The book includes the distribution on CD-ROM.
MkLinux is slightly slower than its rival, LinuxPPC, basically because it is based on the Mach microkernel. It can also be slightly more difficult to recompile the MkLinux kernel because of the extra steps to placate the Mach microkernel. MkLinux can run on a larger spread of PowerPC hardware from Apple, however, including the original NuBus-based Power Macs (6100, 7100, 8100) and the first and second generations of PCI-based Power Macs (7200, 7300, 7500, 7600, 8500, 8600, 9500, 9600). The distribution works in limited form on the original Power Macintosh G3 series.
The other distribution of Linux for Macintosh is called LinuxPPC, ported and supported by the LinuxPPC organization. This distribution is also based on the RedHat installer, offers similar friendliness and can be either downloaded or bought on CD-ROM from LinuxPPC, Inc., the organization's commercial arm. LinuxPPC runs faster than MkLinux, offers binary compatibility with MkLinux but runs only on PCI-based Power Macintosh machines (as well as some PowerPC-based machines from Be, Inc., and IBM). It's also been successfully installed on iMac and other modern G3-based machines. Version 5.0 was released early this summer.
Both versions ship with various X-Windows configurations, servers and windows managers, with LinuxPPC defaulting to the Gnome environment. You can switch to the KDE environment (a Windows 95-like desktop workspace) or work in XWindows using various windows managers, including AfterStep, an OpenStep clone.
While Linux can run on a range of systems and using varying amounts of drive space, full installations tend to require between 600 and 1 GB of free drive space that can be formatting for Linux. That means you'll either need another hard drive, an external drive (often removable media will work) or you'll need to oversee a significant shuffle of your existing partitions, opening up that much space on your internal drive to allow Linux to install. That means a solid afternoon of backing up your data, reformatting and partitioning.
For this task, you can use either Mac OS tools that support the A/UX -- A/UX Apple_UNIX_SVR2 -- format (more recent versions of Drive Setup don't include Unix partitioning) or just format enough partitions using HFS. You can then use Linux's formatting/partitioning tools to rework existing HFS partitions once you get to the installation phase. (You should avoid HFS+ when dealing with Linux, since it currently can't reliably mount or work with HFS+ in certain situations.)
In most cases you'll need at least three partitions -- 50 MB or more for swap space, 150 MB or so for a root (/) partition and between 350-750 MB for user (/usr) and home (/home) partitions. These last two can be the same partition, although their generally broken up into a 500 MB of /usr space and at least 150 MB of /home space.
Other requirements are pretty basic. NuBus Macs use MkLinux, otherwise, PCI Macs can usually run both versions. You'll need a modem that doesn't require any sort of software control panel if you plan to use a modem for PPP access -- that rules out geoport adapters, for instance. You'll be best off with a PostScript printer if you need to print and everything else in your Mac -- SCSI cards, Ethernet, serial ports -- should be as standard as possible. The more exciting, new-fangled or proprietary your whiz-bang PCI card, the less likely it is to work with Linux. Barebones Apple Macintosh systems work the best.
Installation of MkLinux or LinuxPPC is either smooth as silk or very, very rough. Rarely is there anything in between. Both distributions can be downloaded from the Internet, although you'll need a fast connection if you plan to install this week -- both original installations number in the hundreds of megabytes. LinuxPPC offers a "LinuxPPC Lite" version designed to install from CD-ROMs (it's aimed at the MacAddict and Mac Home CDs, for instance) and run from removable media like a Zip disk, if desired.
The best way to install these OSes is from an existing CD-ROM. Experience shows that the installers tend to be somewhat crude but are advancing rapidly -- from early toying with the Open Firmware settings, things have progressed so that both MkLinux and LinuxPPC offer a control panel-based bootstrap system. With LinuxPPC, that system is BootX. Once installed, BootX allows you to choose between the Mac OS and LinuxPPC (or MkLinux if you've installed the OS otherwise) soon after your Mac starts up.
In most cases, the routine is this -- you take a Linux kernel and a Linux disk image (or RAM disk image) and place them in your System Folder. Reboot and choose to launch Linux. Now, a basic version of the OS boots and allows you to make some early decisions, including the drive path to use for installing the rest of the OS.
If your hardware makes sense to the installer and you've correctly FTP downloaded binary files as binary and text files as text (assuming you downloaded the installation) then you're probably in for smooth sailing. Run into any sort of glitch, though -- like the Adaptec Fast/Wide SCSI card in a PowerCenter Pro, for instance -- and you're off to the user-driven tech support races. If you're lucky, someone has recompiled a Linux kernel with the drivers. At this point, you can just replace your current kernel (in the System Folder) with the new, improved kernel and start the installation process over. If they haven't written one yet, then get involved in the LinuxPPC discussion groups and either convince someone to solve your problem or break out a programming textbook and start learning Linux device driver creation.
Are you glitch-free? Then you decide what drive partitions to use for what, then you format, choose the "packages" you want to install (including parts of the OS) and you begin the process. The installer should find the packages on your installation media or on the Mac OS drive partition on which you downloaded the installation files, then go to work writing out a system for you.
It's at this point that you'll really experience your first collision with Unix-y stuff that Mac OS users have never had to think about. Specifically, you're going to have to figure out the system by which Linux refers to the partitions on your hard drives, especially if you have more than one.
Figure 1. Specify devices in the user configurator.
Devices in Linux and Unix are actually accessed in two steps (figure 1). First, there's a text file that signifies a particular device and is stored in the /dev directory in the installation. From there, the kernel manages the actual communication between the OS an the specific device in question. This layer allows a new kernel to include devices drivers for a completely different type of device without the OS itself really caring one way or another. An example would be a kernel that allows you to use that aforementioned Adaptec SCSI adapter. The OS simply deals with a SCSI device, e.g. sdb4, and allows the kernel to deal with how that particular SCSI device is attached to the computer.
In Linux parlance, devices are referred to using four alphanumeric characters. SCSI devices, for instance, start with sd and end with the drive letter (in the perceived chain of SCSI devices) and a partition number. In the example sdb4, that's SCSI device B, partition four. An internal IDE drive gets the designation hd, so that hda2 is the second partition on the first internal IDE drive. Other devices are similarly named -- modems start with tty, Ethernet devices with en.
Moving Forward with Linux
If installation all goes well, you'll be presented, after a restart, with a Linux login. Enter root and a password for the root. The Root account give you "superuser" status, allowing you to change, move or delete anything. That's anything -- Linux is perfectly willing to allow you to completely screw up the system if you're in the root account. It doesn't warn you, doesn't care what you do and will be pleased as punch to not boot up the next time around because you've done something careless.
Figure 2. AfterStep window manager. Notice the NextStep/OpenStep resemblance?
The answer? Immediately create a new account and login as a regular user. From there you can install software packages (a much easier approach using the RedHat tools to adding software programs of all sorts), explore the KDE interface (if you're using LinuxPPC) or enter startx and begin an excursion into XWindows (perhaps using the familiar AfterStep window manager (figure 2) -- a knockoff of the NextStep/OpenStep interface), if it's been installed. Mac users tend to be more comfortable in such a windowing environment, even if you do end up using a number of different console windows (figure 3) to run command line tasks. If you're short on memory or processing power, you might want to do away with the graphics for the interim and focus on the command line. A Linux system can run in 16 MB of RAM, but not if it's running XWindows.
Figure 3. AfterStep Console Windows.
As mentioned earlier, Linux might well have been named iLinux if Apple's marketing department had gotten a hold of it -- using Linux is all about networking and Internetworking. One of the first things you'll want to get running is Internet access -- either Ethernet or PPP-based. Fortunately, if you're already familiar with IP and related addressing schemes, you're on your way to getting started with TCP/IP on Linux. Once you've got that stuff configured, you're able to see the real power of distributed computing as you log into your system from anywhere, run numerous processes on the same machine and generally turn nearly any Power Macintosh into a workstation-level powerhouse.
using Linux is all about networking and Internetworking
Two keys to remember. First, Linux (and all Unix derivatives) are highly dependent on text files and command-line flags. Every sort of command to configure something, start something up or just get something done will usually be made more efficient with a long, unwieldy text command. Second, there's pretty much always help for those commands. When you're stuck, try man command_name for information from the "manual" system for getting help on a particular command or program.
After IP is up and running, you're ready to do just about anything. Set up Apache Web serving (after installing its packages, if necessary), run Netscape, Telnet to another other Linux or Unix machines to run programs remotely, set up your e-mail client, e-mail server or start configuring name servers or masquerading IP addresses -- whatever you need to do with this Linux system. Want to run AppleTalk services or mount HFS drives? You can do both -- the mounting is built in; AppleTalk comes through a package called netatalk. For more, see the installation guides at LinuxPPC User's Guide and the Adventures with MkLinux Web site as well as the PPC Linux and AppleTalk Web site.
There's much more beyond networking, including a few different applications that are available for document editing, image editing and Web publishing -- even games. Many of these packages come with the Linux installations, although you'll certainly enjoy perusing the LinuxPPC and MkLinux mirrors for new binaries. Applix has ported ApplixWare to LinuxPPC, a commercial works package..
ApplixWare is an interesting animal -- like many Linux applications, it's powerful and offers a number of different features, but it's also got some odd interface conventions and a thing or two that's classic Linux -- the occasional odd font or trouble with a window management motif. It seems to have strong tools, including an HTML editor, graphics package, spreadsheet and Builder, a rapid-development enivironment that allows you to use ApplixWare components as objects, the distribute the source and, ideally, run the application on other platforms if desired.
Applix's documentation doesn't discuss the Mac OS specifically and I'm not an expert enough programmer to judge this feature from screenshots, but it looks good. Quick demos of ApplixWare at MacWorld Expo were encouraging, but I haven't been able to sit down with it myself. If you find that you're the sort of person who can accomplish a lot in ClarisWorks/AppleWorks or Microsoft Works, then you'll probably find ApplixWorks is up to snuff. You'll have to deal with some things you have had to worry about since the mid-1980s with Macs, including weird font names and conventions, some creative printing solutions and the underlying Linux file system, which means case-sensitive names, unwieldy path statements and so forth. Also, ApplixWare is likely to be your only full-service office suite in a LinuxPPC version for a while, since LinuxPPC Inc., helped entice them over with a bundling agreement.
Figure 4. Gimp is touted as a rival to Photoshop.
There are certainly other standouts in the Linux for Mac world, with most of them being freeware or shareware. Just like some great tools for Mac exist in that space--BBEdit Lite, Stuffit Expander--freeware Gimp (figure 4) package is touted as a rival to Photoshop (or, at least, GraphicConverter), as well as being a nice complement to the typical Web editing and document editing tools like VI, Emacs and Tex. Down the road, Sheepshaver is expecting to port their Mac OS emulator to Linux, giving you the opportunity to choose which is important enough to be your base OS -- Linux or Mac OS. Choose one, then the other one can be emulated.
There are other options for Unix-like environments on the Mac. If you'd like to run Unix emulated on your Mac desktop, you can choose WebTen for Apache serving or MachTen for full-features Unix emulation from Tenon Intersystems. NetBSD has recently announced that it's own Unix-like OS now ships ready to run on PowerMac systems. And if you're interested in really getting your hands dirty, you can head to Apple's Mac OS X Web site and download the open source "Darwin" portions of the OS, allowing you to work with the underpinnings of Mac OS X Server, sans cool Mac-like interface.
But if you're fixated on getting Linux, both Linux for Mac versions are utterly and completely Linux. That means Linux applications, by and large, either run directly on the OS or simply need a quick re-compile, which can be found through various archive distribution sites on the Web. The only PC-based Linux applications that won't recompile are those written to access hardware directly, which is pretty rare. LinuxPPC and mkLinux are binary-compatible meaning, in theory, an application that is compiled for one will work on the other.
The Linux installations themselves install hundreds of applications, games and utilties, most of which are distributed in RedHat packages these days. That means installation is generally a bit more uniform and can even be accomplished from the GUI -- the days of "untaring" into the wrong directory when you're trying to install applications may not be completely gone, but, if you like, they can be forgotten.
All in all, things don't work half bad. At this point, Linux is a perfectly reasonable solution for any size business that needs to take PowerPC machines and rededicate them to something useful, including mail serving, domain name service or even AppleTalk services. Linux is cheap, fast, reliable and it makes a typical Power Mac into a serious workhorse. Moving to Linux right now is certainly possible, especially considering the friendly universe you land in when you need community help -- the melding of Mac users into Linux users makes communal support a pleasure in the PPC Linux universe.
But what about day-to-day? If you're already a Unix nut, or you just like the idea of doing something that few enough of us can pull off, then use Linux as a client. With Applixware, using Linux as a workstation is conceivable, especially for Webmasters and 'net Mavens. If you "live on the Internet" you at least owe it to yourself to give Linux a try. You might be pleasantly surprised.
Prime Time Freeware
LinuxPPC Mailing Lists (and archives)
Netscape Navigator for Linux
LinuxPPC User's Guide
Adventures with MkLinux
PPC Linux and AppleTalk
Apple's Open Source Projects
Todd Stauffer(email@example.com) is online editor for NetProfessional, as well as a book author, magazine writer and Web magazine publisher. His latest books, "Mac Upgrade and Repair Bible" and "Complete Idiot's Guide to Mac OS 8.5" are available at better bookstores everywhere. Look for his upcoming title about LinuxPPC from Macmillan Computer Publishing. Reach him at http://www.mac-upgrade.com/ on the Web.