OS X Lion Keeps its Yummy UNIX Flavor

| Analysis

There’s been some healthy discussion, to put it mildly, about how Apple is using some ideas from iOS to make OS X Lion easier to use. That doesn’t mean, however, that Apple has meddled with the firm UNIX foundation of OS X, called Darwin.* Here are some notes for the UNIX geeks, but even non-UNIX techies will find some interesting tidbits.

1. The Terminal. The terminal.app is, of course, sacred in OS X, and nothing much has changed there. Apple has even improved the terminal in Lion and showcased it as a major app and added new features such as the full-screen terminal window, new appearance and status controls, and drag-and-drop proxy icons

Terminal

2. X11. The X Window System, commonly called X11, is a GUI and network system developed in the 1980s that allows UNIX users to connect to other systems and run apps via xterm. There is a rich set of libraries and APIs to build those GUI apps. While the system is very outdated and has been supplanted by many other development systems, it is also a staple at many universities and research organizations. For that matter, UNIX was developed much earlier, and it remains viable — though drastically improved. So just being an older technology doesn’t mean it must automatically be eliminated from Lion. Customers still want and use X11.

X11

Despite that, there have been recent rumors that Apple would drop support for X11 in Lion, but apparently cooler heads prevailed, and X11 remains fully supported and even called out in Apple’s list of major Lion apps.

What good does it be to be a fully certified UNIX system and then drop technologies that are core to UNIX specialists?

3. NFS. The Network File System (NFS) is a UNIX-born system that allows users to mount file systems on remote computers as if they were local drives. Up through Snow Leopard, Apple used NFS v3, and while it worked for some, it was often unsatisfactory for very advanced users. One of the biggest complaints of my own customers when I was with Apple was from researchers having trouble with Apple’s implementation of NFS.

In Lion, Apple has implemented NFS v4 and touts that on its page of new features for OS X Lion (under the Networking heading.) Things should go better now with NFS experts using OS X Lion and a full implementation of v4.

Hexley
Hexley, the Darwin mascot

4. Samba. I have read, but not yet verified, that Apple was forced to remove the formerly bundled Samba software because Samna has moved to the more strict GPLv3 license, and so Apple cannot use it commercially. Apple is now supplying its own tools, and it’ll be interesting to see how that goes.

5. Enable Root User. In Snow Leopard, Apple moved the Directory Utilities from /Applications/Utilities to /System/Library/CoreServices. I tried following the Snow Leopard protocol for enabling and disabling the root user, but had no success doing that. It may be that Apple forgot to attend to that detail with changes in Lion, or, more likely, changed how it’s implemented. Here’s a reminder & reference on how to do it in Snow Leopard.

6. Web Server. Nothing seems to have changed with the Apache Web server, at version 2.2.19. You turn it on in System Preferences -> Sharing -> Web Sharing and all the configuration files are still in /etc/apache2.

Apache

7. Perl. Perl has gone from 5.10.0 in Snow Leopard to 5.12.3 in Lion. Perl 5.14 was released in May, but Apple is always conservative there. Because backward compatibility of Perl 6 with Perl 5 code is not a stated goal, it’s probably better to ship Lion with Perl 5 and let advanced users work with Perl 6 on an experimental basis. More details would cast us into a virtual religious discussion, but I welcome reader feedback.

8. ASLR Security. The implementation of Address Space Layout Randomization (ASLR) was considered technically incomplete and thus theoretically vulnerable in Snow Leopard. Apple hired a former National Security Agency vulnerability expert, David Rice, perhaps to oversee these kinds of details, and, according to an independent OS X security expert Charlie Miller, the Lion implementation appears to be much more robust. Vista was actually ahead of OS X in this regard.

In Lion, Safari adds sandboxing, something that Google’s Chrome browser has had for some time.

9. UNIX Shells. Nothing has changed here, and the default shell is still Bash. Here are the shells that are available in Lion.

UNIX shells

In Snow Leopard’s GUI, you had to know the secret incantation to see, for example the UNIX user ID, UNIX Group, and default login shell: System Preferences -> Accounts -> Select User -> Right Click -> Advanced Options. That’s because changing some of those values without expertise could lock you out of your account. It’s the same in Lion.

10. Text Editors. Nothing to see here. UNIX nutcases will be find that the standard UNIX editors, pico->nano, emacs, and vi->vim are still in place. Although the best UNIX X11 editor (IMO) is Nedit, it isn’t included and never has been. Too bad.

{End}

As you can see from the above, a casual perusal of the UNIX underpinnings suggests that not a whole lot has changed in Lion. It’s still the UNIX we’ve come to know and love. Of course, this brief summary isn’t meant to be a detailed change log of every UNIX feature, going from Snow Leopard to Lion. Rather, it’s to suggest that a little digging into Lion shows that we need not worry too much about Apple fundamentally changing the UNIX-y goodness of OS X Lion. No matter what Apple does on the topmost levels of the GUI to make it easier and more fun to use, like iOS, OS X Lion remains viable for the technical UNIX expert.

And that’s how it should remain.

_______________________

* Darwin’s mascot is Hexley. Darwin is, these days, primarily FreeBSD.

Sign Up for the Newsletter

Join the TMO Express Daily Newsletter to get the latest Mac headlines in your e-mail every weekday.

Comments

mlvezie

MMMMmmmm… UNIXy goodness!

JonGl

Did the NeXTStep environment run under X11? If so, it’s a shame they don’t release it as the default X11 on the Mac. wink The open source versions aren’t anywhere near complete.

-Jon

pohl

No, the NeXT operating system was not based on X11.  It used Display Postscript as a display server instead.  This was spiritually carried forward into the modern display-PDF style display server that is quartz.

me

Did the NeXTStep environment run under X11?

Nope.

http://en.wikipedia.org/wiki/Display_PostScript

gstrock

I don’t have an Apple computer, so I can’t look for myself, but I heard that Apple tossed out the traditional Unix directory structure (/bin, /etc, /usr ...) and replaced it with something else.  is there any truth to this?

John Martellaro

gstrock.  No truth at all! Apple did NOT do that.  However, some directories and files have been moved for the sake of sanity.  The result is minor differences between OS X/Darwin and Linux.

For example, the config files for Apache, in Fedora 12, are in /etc/httpd. On the Mac, they’re in /etc/apache2.

Other items, as I recall, have been completely moved, but once you know about it, you just live with it

So there are just minor differences that we get used to. Darwin remains 100% UNIX-y. In fact, it’s primarily FreeBSD.

Luis Freitas

Correction: firm foundations called BSD. Apple marketing shitters.

JonGl

No, the NeXT operating system was not based on X11.? It used Display Postscript as a display server instead.? This was spiritually carried forward into the modern display-PDF style display server that is quartz.

Oh, yes. Of course. I once knew that… I believe Display PDF was also supposed to be the basis of OSX, but was modified, as you said.  (was Display PDF also behind BeOS?) NeXTStep just _looked_ X11-ish. wink

-Jon

John Martellaro

JonGL: As I recall, Apple couldn’t use Display Postscript in OS X for two reasons. 1) Adobe license fees and 2) QuickDraw from Mac OS 9 couldn’t be embedded in DPS.  That’s why, in Rhapsody, you had two different screens for Classic and Rhapsody, the OS X precursor.

Once Apple developed a (license free) graphics system called Quartz, they could embed QuickDraw on the same screen.  That’s how Classic apps could run on the same display as OS X apps back in the Classic/PowerPC/Blue Box days.

As for X11, it’s not a native graphics system, so to say that NextStep runs *on* X11 is incorrect.  X11 runs on TOP of any UNIX system, including NeXT.

http://www.nextcomputers.org/NeXTfiles/Articles/NeXTWORLD/92.2/92.2.Summer.MiniRev5.html

vpndev

Easy way to get a shell running as root is “sudo -s” and give your login password.

Once you’re at a root shell, just “passwd” should set the root password for you.

There are good reasons for using sudo and sometimes “sudo -s” but occasionally having an actual root login is necessary. It’s best to avoid it if you can and use the sudo approach.

graxspoo

Something I’d like to see Apple do is have a standard way of getting distributions from Unix ports, ala Fink or MacPorts. It’s great that these projects exist, but they don’t co-exist well, and can litter the root of your hard drive with directories. There’s also no system level management of what you’ve installed or for updates. It’s pretty much of a mess, which is too bad, because things being in this state seriously diminishes the usefulness of fact that OS X has Unix as its underpinnings. I’d be a lot more excited about Apple having a standard way of porting and installing stuff from other Unixes than about “Launch Pad”...but that’s just me.

exAppl088

John:
this appears to be a mis-statement.
“5. Enable Root User. In Snow Leopard, Apple moved the Directory Utilities from /Applications/Utilities to /System/Library/CoreServices.”

I think you meant “In Lion, Apple moved…”

I use Terminal daily in my development work on SL 10.6.8
and Utilities is clearly still just a directory in /Applications
and not a link to elsewhere.

John Martellaro

exAppl088: Nope.  I meant what I said, but worded it poorly.

The application called “Directory Utility.app” was moved from /Applications/Utilities to /System/Library/CoreServices.

That move occurred in the transition from Leopard to Snow Leopard.

Ricardo Carvalho

You’re wrong about Samba, Apple still can use it just like before, but the company just have a problem with GPL3 (I do not know what type of problem, maybe it has something to do with iOS), people used to say that the company bought CUPS just because of the fear of the software being licensed under the GPL3.

I’m still waiting before upgrading to Lion

Log-in to comment