- 🍏 Как запускать приложения Mac на Linux
- Запустите виртуальную машину MacOS (все приложения)
- Использование Darling Translation Layer (только CLI)
- Сборка и установка дорогой Darling
- OS X apps run on Linux with Wine-like emulator for Mac software
- Oh! «Darling» emulator illustrates complexity of bringing Mac software to Linux.
- reader comments
- Share this story
- Unix/Linux synergy
- No reverse-engineering
- Beyond Linux Apps: Mac on Linux
- Introducing Mac on Linux
- Illicit Use of Mac on Linux
- Installing and Running Mac On Linux
- Performance Issues
- Compatibility Issues
- Conclusions
🍏 Как запускать приложения Mac на Linux
macOS и Linux имеют общее наследие.
К сожалению, это не означает, что приложения могут плавно переходить между операционными системами.
Для запуска приложений Mac в Linux вам понадобится виртуальная машина или слой перехода.
Запустите виртуальную машину MacOS (все приложения)
Самый надежный способ запуска приложений Mac в Linux – через виртуальную машину.
С помощью бесплатного гипервизора с открытым исходным кодом, такого как VirtualBox, вы можете запускать macOS на виртуальном устройстве на вашем компьютере с Linux.
Правильно установленная виртуализированная среда MacOS без проблем запустит все приложения MacOS.
Подобная виртуализация рабочего стола требует значительного объема оперативной памяти, поэтому она может работать некорректно на устройствах с ограниченными ресурсами.
Для машин с техническими характеристиками наилучшим вариантом является виртуализация операционных систем через виртуальную машину VirtualBox.
Использование Darling Translation Layer (только CLI)
Вы также можете запустить слой перехода под названием Darling.
Он работает как WINE, которая создает среду перевода с Windows на Linux, которая позволяет вам запускать некоторые приложения Windows в системах Linux.
Darling пытается достичь той же цели между macOS и Linux.
Поскольку macOS и Linux совместно используют одну и ту же базу в стиле UNIX, Darling менее ресурсоемок, чем WINE, и в большинстве случаев дает лучшие результаты.
В настоящее время Darling может работать только с очень простыми приложениями с графическим интерфейсом и несколькими приложениями командной строки.
Хотя поддержка приложений с графическим интерфейсом является целью проекта, эта функция еще не реализована.
По сути, вы можете надежно запускать оболочку macOS в Терминале и, возможно, не сможете эффективно запускать другие приложения.
Он также содержит огромное количество кода, требующего около 12 гигабайт дискового пространства после сборки.
По сути, это дублирует функциональность операционной системы MacOS.
Поэтому, если вы беспокоитесь о том, что удаленные исполняемые файлы могут повредить вашу систему, вы можете избегать пакетов такого размера.
Сборка и установка дорогой Darling
1. Следуйте инструкциям по установке, чтобы загрузить правильные зависимости для вашего дистрибутива Linux со страницы установки Darling.
В зависимости от вашего дистрибутива вам может потребоваться выполнить длинную команду.
Например, для Ubuntu выполните следующую команду терминала, чтобы загрузить зависимости Darling:
Источник
OS X apps run on Linux with Wine-like emulator for Mac software
Oh! «Darling» emulator illustrates complexity of bringing Mac software to Linux.
Jon Brodkin — Aug 6, 2013 7:10 pm UTC
reader comments
Share this story
Linux users who want to run Windows applications without switching operating systems have been able to do so for years with Wine, software that lets apps designed for Windows run on Unix-like systems.
There has been no robust equivalent allowing Mac applications to run on Linux, perhaps no surprise given that Windows is far and away the world’s most widely used desktop operating system. A developer from Prague named Luboš Doležel is trying to change that with «Darling,» an emulation layer for OS X.
«The aim is to achieve binary compatible support for Darwin/OS X applications on Linux, plus provide useful tools that will aid especially in application installation,» Doležel’s project page states. Darwin is Apple’s open source operating system, which provides some of the backend technology in OS X and iOS. The name «Darling» combines Darwin and Linux. Darling works by «pars[ing] executable files for the Darwin kernel. load[ing] them into the memory. and execut[ing] them.»
But there is a ways to go. «Darling needs to provide an ABI-compatible [application binary interface] set of libraries and frameworks as available on OS X. by either directly mapping functions to those available on Linux, wrapping native functions to bridge the ABI incompatibility, or providing a re-implementation on top of other native APIs,» the project page notes.
Doležel, who started Darling a year ago, described the project and its progress in an e-mail interview with Ars. Darling is in the early stages, able to run numerous console applications but not much else. «These are indeed the easiest ones to get working, albeit ‘easy’ is not the right word to describe the amount of work required to achieve that,» Doležel said. «Such applications include: Midnight Commander, Bash, VIM, or Apple’s GCC [GNU Compiler Collection]. I know it doesn’t sound all that great, but it proves that Darling provides a solid base for further work.»
Users must compile Darling from the source code and then «use the ‘dyld’ command to run an OS X executable,» Doležel said. One roadblock is actually getting Mac .dmg and .pkg application files working on a Linux system. Because doing so isn’t that straightforward, Doležel said, «I’ve written a FUSE module that enables users to mount .dmg files under Linux directly and without root privileges. An installer for .pkg files is underway.»
Unix/Linux synergy
The fact that OS X is a Unix operating system provides advantages in the development process. «This saved me a lot of work,» Doležel explained. «Instead of implementing all the ‘system’ APIs, it was sufficient to create simple wrappers around the ones available on Linux. I had to check every function for ABI compatibility and then test whether my wrapper works, so it wasn’t as easy as it may sound.»
Another lucky break not available to Wine developers is that Apple releases some of the low-level components of OS X as open source code, «which helped a lot with the dynamic loader and Objective-C runtime support code,» Doležel noted.
But of course, the project is an extremely difficult one. Doležel isn’t the first to try it, as Darling was initially based on a separate project called «maloader.» Doležel said he heard from another group of people «who started a similar project before but abandoned the idea due to lack of time.»
Doležel was actually a novice to OS X development when he started Darling, being more familiar with OS X from a user’s perspective than a developer’s perspective. «I have personally looked for something like Darling before, before I realized I would have to start working on it myself,» he said.
Darling relies heavily on GNUstep, an open source implementation of Apple’s Cocoa API. GNUstep provides several core frameworks to Darling, and «the answer to ‘can it run this GUI app?’ heavily depends on GNUstep,» Doležel said. Doležel is the only developer of Darling, using up all his spare time on the project.
No reverse-engineering
Doležel isn’t reverse-engineering Apple code, noting that it could be problematic in terms of licensing and also that «disassembling Apple’s frameworks wouldn’t be helpful at all because Darling and the environment it’s running in is layered differently than OS X.»
The development process is a painstaking one, done one application at a time. Doležel explains:
To improve Darling, I first take or write an application I’d like to have running. If it is someone else’s application, I first examine it with one of the tools that come with Darling to see what frameworks and APIs it requires. I look up the APIs that are missing in Apple’s documentation; then I create stub functions for them and possibly for the rest of the framework, too. (Stub functions only print a warning when they are called but don’t do any real work.)
The next step is to implement all the APIs according to the documentation and then see how the application reacts. I also add trace statements into important functions to have an insight into what’s happening. I believe this is very much like what Wine developers do.
When things go wrong, I have to use GDB [GNU Debugger] to debug the original application.
It is rather unfortunate that Apple’s documentation is often so poorly written; sometimes I have to experiment to figure out what the function really does. Many OS X applications seem to contain complete pieces of example code from Apple’s documentation, presumably because one would have to spend a lot of time getting to understand how the APIs interact. This is why I appreciate open source so much—when the documentation is sketchy, you can always look into the code.
Years of development are needed. Similar to Wine, «Having a list of applications known to be working is probably the best way to go,» Doležel said.
Darling should work on all Linux distributions, he said, with the catch that «many apps for OS X are 32-bit only, and installing 32-bit packages on a 64-bit Linux system could be tricky depending on your distribution. I personally use Gentoo Linux, so I’m gradually creating a Portage overlay that would compile Darling and all dependencies for both 32-bit and 64-bit applications.»
Doležel would like to bring Angry Birds, other games, and multimedia applications to Linux. Darling could potentially «be used to run applications compiled for iOS,» he writes on the project site. This will also be a challenge. «The intention is to support the ARM platform on the lowest levels (the dynamic loader and the Objective-C runtime),» he writes. «Rewriting the frameworks used on iOS is a whole different story, though.»
Источник
Beyond Linux Apps: Mac on Linux
Jason Walsh — 2002.05.30
We’ve all heard it: Linux has no applications. Despite the availability of many professional desktop applications for Linux, such as Star Office and Corel WordPerfect Office, the rumour of the dearth of applications for Linux persists. In fact, it does have some truth in it, at least for users of nonstandard versions of Linux such as PPC/Linux.
Last time we looked at productivity applications for your PPC machine, and before that we looked at replacing Photoshop with GIMP, but what if you really want to run Quark XPress or need access to Photoshop’s CMYK features?
What do you do if you need to use an application that doesn’t exist under Linux and has no real equivalent? Some Linux users can reboot into Windows on a separate partition or hard drive. This is an awkward, but useable solution.
However, what do you do if you’re running Linux on a PPC machine? Well, you can reboot into the Mac OS (or AIX or BeOS, depending on your machine). Fine. However, as with so many things in Mac land, there is a more elegant alternative.
Why not just run your Mac OS applications under Linux?
Introducing Mac on Linux
If you are running Mac OS X and need to run an application that has not been “carbonised” – that is, an application that has not been ported from the old Mac OS to OS X – the machine will boot the classic environment and run your application there. This means that Mac OS X emulates an older version of the Mac OS and runs the application through it.
Clever, but it’s nothing new. VMWare and WINE allow Linux users to run Windows applications on their x86 systems, SheepShaver allows BeOS users to run the Mac OS in a window, and any Power Macintosh (that is, PPC-based Mac) runs old applications for the 680×0 based machines using an invisible emulation process (incredibly, even parts of the OS were run under emulation until the release of Mac OS 8.5).
Now Mac-based Linux users have a similar application, and best of all, it’s open source.
Illicit Use of Mac on Linux
Users of non-Mac OS PPC hardware are no doubt wondering if they’ve just been given a Mac for free, or rather, can they boot Mac OS on their, for example, IBM RS/6000 using Mac on Linux? Well, there really is no easy explanation for this.
Legally, no. You must have a machine licensed to run the Mac OS, be that an actual Apple Macintosh or one of the many clones that were produced by the likes of Motorola and Umax in the mid-90s.
Technically, however, it’s a different story. Apple loves standards – or at least they love helping to create them and then subvert them.
Any tech-savvy Mac user will remember the acronym CHRP, meaning Common Hardware Reference Platform. This was a hardware standard developed by Apple and other tech companies wanting to replace the Intel x86 chipsets. Unfortunately, not much ever came of it. However, there are some of these machines about, and some based on the PReP subset, and there is no technical reason why you can’t run the Mac OS on them in conjunction with Mac On Linux. This is because the Mac OS no longer needs a hardware ROM in order to boot. Since Mac OS 8.5 there has been a file lurking in the System Folder named MAC OS ROM. This file effectively replaces the physical ROM chip found in older (pre-G3) Macs, without which the OS refused to boot.
Users of x86 systems, however, can forget about it. Mac on Linux is a Power PC native application and requires one of the following CPUs to run: PowerPC 601, 603, 603e, 604, 604e, G3, or G4.
Installing and Running Mac On Linux
Installing Mac on Linux is easy – not quite “Mac easy,” but it is simple nonetheless. It is important to remember that you must be running a distribution of Linux that uses the 2.2.10 kernel or later.
After downloading the RPMs, issue the following command:
Alternatively, those without the Red Hat Package Manager – or the brave – can download the source and compile it themselves.
Next, invoke the commands below. This copies the Mac OS ROM file from the Mac OS System CD.
The above instruction assumes that you intend to use Mac OS 8.6 or later. Should you wish to use an earlier version, you will need to grab a copy of the ROM and make it into a ROM image, using the ROM Grabber utility, which is available from the MOL downloads page. This is reason enough to use a version of Mac OS later than 8.5. The MAC OS ROM file from Mac OS 8.6 onwards will work on any PPC Mac.
Finally, invoke the boot command from the bash shell:
The Mac OS should now be booting. If it is displaying a flashing question mark instead of booting, this means that the Mac OS cannot find a suitable partition to boot from. It is looking for an HFS partition with an working System Folder. If this happens, you must configure MOL manually. Edit the /etc/molrc file and make the appropriate volume available.
Performance Issues
Running software through emulation or API layers will always cause some loss of performance. However, depending on you machine and what kind of application you want to run, it may well be worth it for the sake of convenience, especially given how long the Mac OS (and Linux) can take to boot.
Some software is not designed to be booted up for a bit of quick work. While you may want to quickly load an image editor to alter file formats or up a word processor to fire off a letter, it is difficult to see why you would ever want to run the likes of Quark XPress for a few seconds. In cases like this you would probably be better off rebooting natively into the Mac OS.
Users of Mac OS X and older versions of Photoshop, which has as yet not been Carbonised (ported to OS X native code), will know that heavy duty graphics manipulation under emulation is a pain. PPC/Linux users would be better served by rebooting to Mac OS 9 or using the Linux native GIMP, which offers most of Photoshop’s features at – wait for it – no cost.
However, the performance tests for Mac On Linux are rather revealing. The Linux Icebox section of famed Mac website ResExcellence found that Mac On Linux was only slightly slower than the OS X classic environment. I cannot compare like for like, as I currently run PPC/Linux on an iMac G3/233 and OS X on a Power Mac G4/400, but I will state this: MOL seems to be little or no slower than classic, even on this older machine.
If your Mac OS requirements are more in the AppleWorks or MYOB accounting vein, then MOL is perfect.
Compatibility Issues
Mac on Linux does have some downsides. First of all, if you’re using a Mac based on the PowerPC 603e, such as a Power Macintosh 4400 or many PowerBooks, you’ll need to apply a kernel patch. Luckily, this is included in the RPM, in the /usr/doc/mol-0.9.58/ folder along with the appropriate instructions for running it.
Users of early Power Macintosh G4 machines also have a minor issue to resolve. MOL is incompatible with the Mac OS ROM file included on the Mac OS 8.6 CD that shipped with the original G4s. However, later ROMs, such as 1.6 and 1.8.1 are available from the download page.
MOL is also incompatible with many peripherals, such as SCSI scanners, some USB scanners, USB storage, and so on. FireWire is patchy, as Linux currently has incomplete drivers.
One final sad note is that MOL is not compatible with MkLinux, the only version of Linux that runs on some oddly configured older Power Macs, such as the Performa 5320.
Conclusions
All in all, Mac on Linux can only be a good thing. The performance hit which your system suffers by using it is minimal, to say the least, and it opens up a whole world of applications to PowerPC Linux users. Though the Mac OS must still boot, not forcing you to halt Linux is a fantastic boon.
Perhaps the best thing about MOL is that it makes Linux a true alternative to Mac OS X for users of older Power Macs that simply won’t run Apple’s next generation operating system. By offering similar features to the classic environment in OS X, it allows users to have the power of Unix alongside the familiarity and legendary ease of use of the Mac. Without MOL, Linux would not compare to the functionality of OS X, but with it you can really get productive on your computer. After all, isn’t that why you bought a Mac in the first place.
However, the best news has been kept for last. Though I haven’t personally tried it, apparently MOL will boot BeOS, and Mac OS X compatibility is being worked on. Imagine that, a computer than can run Mac OS 9.1, Mac OS X, BeOS, and Linux. Now that is a workstation.
If you’re interested in running Linux or BSD on PowerPC Macs, consider joining our Linux on PowerPC Macs group on Facebook.
This article was previously published in Linux Magazine (UK).
Источник