Posted
by
kdawson
on Monday July 30, 2007 @08:36AM
from the must-be-a-layer-somewhere dept.

I have the urge to commit my 24" Core 2 Duo iMac to a single Linux operating system, thus giving up the goodness of my beloved Mac OS X. I am not a stranger to Linux, but I am a stranger to running Mac apps on Linux. On my PowerPC I can use SheepShaver to run Classic apps. The Mac-on-Linux project can run OS X apps, but it requires a PowerPC, not an x86. Virtualizing and emulating are inefficient, especially given the wonderful results the WINE project has had in getting Windows apps to run on Linux. What I would like is an equivalent: a software compatibility layer that will allow Linux to run Mac OS X apps at native performance. I believe there is some additional complexity in accomplishing this. Mac OS X apps aren't just Mac OS X apps. They are Carbon. They are Cocoa. They are universal binaries. They are PPC code with Altivec. Does such a project exist yet? If not, why not?

I will never understand why someone would buy a $2000 iMac and negate the entire reason for purchasing from Apple -- to run Mac OS X. You can run Linux for a lot less money, you know.

Honestly though, Mac OS X really isn't that bad -- in fact, I think it's pretty nice, especially if you come from a Linux background. You do realize that you can run pretty much any Linux app (as long as it doesn't do any funky OS-specific things) natively on Mac OS X, right? You could even run a full-fledged Linux installation via Parallels if you so desire.... Or is the main issue that you're one of those people who gets the "heebie-jeebies" at the thought of running software that isn't open source? In that case, my advice is to get a life -- it's just software! The world won't end if you run a piece of non-free code!

Then be certain you're only running systems with SSE3 or above, since all the intel binaries are optimized for that.

Whoops- also gotta build a compatible CoreAudio system.

Oh no, looks like you're now Apple.

If you're using Mac OS X, you're already using a NeXT compatibility layer on top of a streamlined X and a really high end specialized desktop unix. The question is- why are you trying to run linux? You're using a much higher end unix system that supports X11 and has a full BSD layer, with package managers available. Why don't you just run linux apps in OS X?

Making an OS X "compatibility layer" would essentially just require you to create a shoddy set of OS X libraries- something Apple's already done better.

Take advantage of your resources.

Let me repeat this - OS X is a "mac compatibility layer" running on top of a unix kernel already- it's a totally insane waste of time to re-implement it. If you're that interested in making OS X, you should work for Apple.

I just want to know why you would want to replace OS X with Linux? I understand the FOSS ideals, but you could always run linux in a virtual machine.

Evidently, you don't really understand the FOSS ideals. The FOSS ideal is not "I want to run some neat free software on top of my proprietary OS"... it is "I want to replace as much of my proprietary software with free software equivalents." In which case, replacing the OS with a free equivalent is a big step in that direction.

Of course, that's assuming this guy is switching to Linux-only on ideological grounds--but if he were, presumably he would be motivated to give up on his previous closed-source OSX-only apps, and switch to using free software equivalents. So, in fact, his motivations may be more pragmatic. Though OS X has lots of UNIX-goodness, there are some things that are just easier to get done in Linux. (Some examples of things that I find easier in Linux than OS X are programming, designing websites, and running websites (both in terms of deploying sites and as a server).)

That probably could have been stated better! I believe the question is what is each good for? If free is a goal, then why not run Linux as an OS? But, why on Apple hardware, not that the cost is bad nowadays compared with the "general" hardware quality and design if that's your thing.

If you need OS X applications, why not run Linux through Parallels or some VM? If Linux is your primary OS, use BootCamp to allow access to OS X. These approaches make sense depending upon your needs. Want access to everything at the same time -- Parallels. Want to run everything within Linux, and only need to access OS X once in a while -- BootCamp. Want to run open applications -- us X11. This doesn't seem any more complicated than using Windows and OS X applications. But if performance is an issue, why are you using a consumer machine?

Aside from workflow and high performance issues, it has never been so easy to work across platforms, and frankly I feel that Apple has done a pretty decent job of developing the right resources.

Wine implements the Windows API. Wine does not use any software from Microsoft. Windows programs are just run with the Wine implementation instead of the Microsoft implementation.

The Cocoa API is based on the OpenStep API, which has a full open specification [gnustep.org]. We've had a FOSS implementation of the OpenStep API for years: GNUstep. GNUstep has even implemented some of the Cocoa additions. Producing a Cocoa compatibility layer should be much easier than producing a Windows compatibility layer.

VMWare Fusion... download it... it's really good on OS X. I have 3 Linux images I regularly use with almost no perceptible performance hit. It has a really slick full screen mode. Also, there's nothing stopping you from imaging your machine with Linux and installing OS X in a VMWare VM, it's a bit flaky on the redraws, but you'll have access to iTunes since you DO have a valid OS X license after all. The downside to that is you won't have access to firmware updates from Stevie.

That's a good question. For me, my move from OS X to Linux is motivated by several reasons.

1. Portability
OSX runs on Apple Hardware. It can be hacked, sure, to run on some non-Apple systems, but widescale hardware compatibility is lacking (just look at the difficulties in getting a GeForce 8x00 series card running). With Linux, I have a much wider choice of hardware vendors.

2. Flexibility
Linux gives me a lot more control over my OS. While this is pointless for 90% of users, for me, it is very nice to be able to custom compile a kernel with the options I need, recompile any given app for the characteristics I need, and so on. I can enable, disable, theme, customize, and otherwise hack my environment to suit my needs much more easily than in OS X.

3. Security
OSX is pretty good, but I'm a little worried at Apple's highly negative response to security concerns (anyone remember the wireless driver exploit fiasco?). Also Linux offers some features that OSX doesn't currently offer, such as MAC. 10.5 is supposed to have MAC, but I can't find any info on it. While both systems are good, I perceive the Linux market as responding more credibly to security issues.

4. Software Ecosystem
OSX software is great. However, Linux offers me a great deal more choice, and that choice tends to be much more configurable to my needs. While I love the Cocoa API and what it allows apps to do, Linux is catching on fast, and I find that good GNOME or KDE apps perform most, if not all, the functionality I care about in OSX, while being beer free, and offering me more choices (i.e. Anjuta, Geany, Eclipse, KDevelop vs XCode, Eclipse). There's also a lot of software I like to use that aren't available on OSX yet. I'm starting to learn CUDA, for example, and that is not yet offered for OSX. Also, VMWare workstation offers some nice features targeted at developers (such as host-to-VM project deployment & debugging) which I haven't seen offered yet on OSX.

5. Usability
I know a lot of people disagree with this, but I find a lot of OSX's UI broken, at least for how I use my system. I find the window management to be frustrating, the Dock to be very limited, and the lack of decent app launching & management to be very frustrating (although QS does manage to solve app launching in a pretty nice way). GNOME's clean usability and massive customization have allowed me to create a Linux system that I actually find to be more usable for me than OSX.

I guess I could summarize all of that by one word: choice. For my needs and uses, I find the flexibility of Linux far more convenient.

If OSX's behaviors work well for you, and you are happy with Apple's hardware offerings, then you have the choice of OS X instead!

>>>>> I realize your request is for "intel" MacBooks... but for those of you with PPCs or Developers...

I'm pretty sure Mac On Linux (MOL) won't work for intel machines, but if it did it would more or less do what you want. A short search shows it probably doesn't work, maybe someone should look at porting it to intel hardware (if its doable).

I think for now the VMWare (answer already given by other posters below) is as good as its going to get. That is simply the problem with closed source stuff.

For those of you reading this post looking for solutions for PPCs though, MOL is probably the way to go.

Mac On Linux supports all of the PPC architectures well, and I've got linux and Mac OS X co-existing nicelyby booting into Ubuntu linux (6.10) and then running Mac On Linux with my OS X install.

Effectively I have Mac OS X in a window on my second workbench and can switch from one OS to the other easily.I use both linux and mac apps depending which one I like better.

Having a 12" PPC with NVidia closed source crap, I cant run the os in a separate screen yet but with SDL drivers and a screen sized window I get pretty close.

The only thing that doesn't work well in Mac OS X for me right now is sound, (but the MOL team is working on it).Network etc. is all available (with some configuration, through a TUN device), and a Samba drive lets me access my linux drives from inside MAC OS X (running in MOL).

The only reason I don't boot only into linux is that Sleep, and Video out don't work courtesy of NVIDIA closed source crap... (Admittedly they make nice graphics cards, but I will be choosing my set of hardware based on how well they support open source, which likely means it likely won't be an NVIDIA card, given my current experiences, grumble, grumble;) ).

Mac OS X has a subsystem based on BSD, and it uses it for some system tasks and to present a POSIX runtime environment. It's only a very small part of the system and rather a second citizen. Let's not even talk about their X11 support, which is pretty unpleasant to use for anything but the basics.

Only a Mac zealot is likely to tell you it's just a "better unix than unix". Real unix users tend to cry when trying to use it, especially since half the man pages are outdated and completely wrong because Apple changed how everything works but didn't document it.

Between MacPorts and Fink, i could potentially run any Linux app I would use under x and be fine. I can run Kde or Xfce and have them running in quartz wm / Xfree86 or X.org right next to aqua. Now that they've fixed some of the HFS issues with the command line apps, the whole thing runns smoothly. You're millage may vary.

Producing a Cocoa compatibility layer should be much easier than producing a Windows compatibility layer.

There are a few more things required than just GNUstep. GNUstep gives source compatibility and is now fairly good at reading nib files. In order to run OS X pure-Cocoa applications you would also need a Mach-O binary loader. Linux uses ELF as the format for binaries, and so the loader can not start and link OS X applications. Next you would need to compile the Apple (NeXT) Objective-C runtime library on Linux. This is pretty easy (the code is ASPL), but currently GNUstep has problems running with the NeXT libobjc (it uses the GNU one by default).

If you did this, you could run applications that just used Cocoa. Unfortunately, a lot of OS X applications also use Carbon. There is no open source version of Carbon, although a few people have written GNUstep wrappers for the parts of Carbon which are toll-free bridged with Cocoa. You would also not be able to run anything that depends on WebKit (unless you use GNUstep's SimpleWebKit as a stop-gap), QuickTime, or any of a number of other frameworks that have not yet been added to GNUstep.

WINE has had a lot of time and effort put into it because there are a huge number of proprietary Windows-only applications that would be useful on other platforms already deployed. There are far fewer essential applications for the Mac (90%+ of computer users don't use any OS X apps, after all), and so no one has bothered. For the few apps that would be worth supporting, it is probably easier to re-write them from scratch than it is to write a general purpose compatibility layer.

Carbon is a sort of bizarre chimera library, which was intended to provide a compatible set of APIs between classic Mac OS and Mac OS X. So that once OS X was on the way, you could carbonize an app under Classic and have it just work on OS X. Brilliant idea, but it means Carbon isn't a close relative of anything. It's a huge library and framework (since it spanned multiple operating systems), and would basically have to be engineered from scratch.

In contrast, Cocoa is what used to be OPENSTEP; it's just been renamed. GnuStep thus provides the same stuff Cocoa does, but tends to be several years behind. (Also, GnuStep provides source-level compatibility with a given revision of Cocoa, not binary-level.)

It sounds like 6 can't access the itunes store anymore; but this is certainly a partial solution. And is priobably the avenue to watch -- unlike iTunes (OSX), lots of people are actively working on getting iTunes (Windows) running.

Apple has released some of Core Foundation as open source [apple.com] (APSL probably).

Cocoa is written in Objective C (and the libraries are well documented). The C-based CoreFoundation is a rewrite of some of the stuff in C. Some of the data structures can be used in a cocoa app as a native Objective C object, but most cocoa apps don't depend on CF.