One downside of moving to Linux is that you miss some programs from your previous operating system. You sometimes wish they would run on your *nix box.
This is not much of a problem for Windows apps anymore, but what about Mac apps? Can you run them on Linux, and how easy is that?
The answer is: Yes, you can. There are two methods of running Mac apps in Linux and they are:
A. By using the Darling emulator
B. By using a virtual machine
Using the Darling Emulator
The Darling emulator aims to make using Mac apps on Linux as easy as Wine made using Windows apps. Darling is currently in the early stages of development though, so there is still a long way to go.
Its major limitation is that you can only use it to run command-line programs at the moment. So, if you are planning on running a GUI (Graphic User Interface) app, then you must either wait for when and if, Darling supports GUI apps or use option 2 of this guide, which is guaranteed to work.
There are two parts of the Darling package and you need to download and install both to make it work. One is the emulator itself, while the other is the kernel module.
Following is a step by step guide for installing Darling on Ubuntu 18.04. It uses the gdebi command, which automatically satisfies and installs all the package dependencies for you.
Step 1: Download both the darling and darling-dkms files from https://github.com/darlinghq/darling/releases
Step 2: Hit Ctrl + T to open a terminal
Step 3: cd to your downloads directory and enter the following command to install the kernel module. Answer yes to its prompt by typing ‘y’
sudo gdebi darling-dkms_0.1.20200331.testing_amd64.deb
Step 4: Then install darling using the following command:
sudo gdebi darling_0.1.20200331.testing_amd64.deb
Step 5: Once the installation is complete, you can now start the emulator with the following command:
You can then check to confirm that it is not a Bash shell by typing the uname command, to which it should print ‘Darwin’ and not ‘Linux’.
How to run Mac Apps on Linux using a Virtual Machine
You can also run Mac apps on a virtual machine such as Virtualbox, Vmware, or KVM. The caveat, however, is that you need to install the Mac operating system first, before installing the app on it. Apple also frowns on installing its Mac operating system on hardware that is not Apple Mac.
This means that you cannot download Mac OS without having a Mac computer. And although you could decide to download it from the internet, you cannot be sure of the integrity of the file you are downloading. Some people make a living from uploading malware-infected software and you could fall victim.
On the other hand, Macos-virtualbox is a promising Bash script, which downloads the files directly from Apple servers and creates a virtual machine for you. This guarantees you are using only genuine Apple software.
Another route is to borrow a Mac from a friend and use it to download an updated Mac version, which you can then turn into an ISO installation file.
Here is how to go about all 3 methods:
Method 1: Use Macos-virtualbox
Head over to GitHub and download the package. Also try and read the documentation to get a better understanding of how it works.
Open a terminal, then unzip and run the script using the following commands:
It will take you through the entire process of downloading the software and creating the virtual machine. All you need is to sit patiently and hit the “Enter” button when prompted.
But if for some reason it does not work, then you can try out these other methods.
Method 2: Download from the internet
Step 1: You will have to find your own file from the web because Apple frowns on the distribution of Mac OS on devices other than the Mac computer. The next steps assume that you downloaded a virtual machine (vmdk) file.
Step 2: Install VirtualBox or any other virtualization software of choice. For VirtualBox, use the command below to install the package with all its extra additions at a go:
sudo apt install virtualbox virtualbox-dkms virtualbox-ext-pack virtualbox-guest-additions-iso virtualbox-guest-utils virtualbox-qt
Step 3: Start VirtualBox and create a new virtual machine, using the vmdk file you downloaded.
Step 4: Give it about 4G of RAM or more, 128 MB of graphics, and 2 CPU cores. Avoid spaces in your virtual machine name. You can give it something like “MyMacOS”.
Step 5: This is important. Quit VirtualBox first. Then download this shell script
Step 6: cd (Change Directory) to the directory you downloaded the script into and execute it, like this:
./setup.sh -v “MyMacOS” -r 1920×1080
Where MyMacOS is the name you gave your virtual machine and 1920×1080 is your full-screen resolution or the resolution you want to give the virtual machine.
Step 7: Launch VirtualBox again and start your new Mac OS virtual machine.
Method 3: Download from a borrowed Mac
If you have access to a real Mac computer that’s older than the Mac High Sierra, then you can use the steps below to also create a Mac virtual machine on your Linux box:
Step 1: Gain physical access to a Mac computer. It could be yours or you can borrow it from a friend. Just make sure it has internet access and you are good to go.
Step 2: Head for the Mac Store and search for High Sierra. Click Download.
Step 3: When it finishes and tries to start the installation, hit Ctrl + Q to exit.
Step 4: Open a terminal from Applications > Utilities and enter the following commands:
hdiutil create -o /tmp/HighSierra.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/HighSierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
asr restore -source /Applications/Install\ macOS\ High\ Sierra.app/Contents/SharedSupport/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
hdiutil detach /Volumes/OS\ X\ Base\ System
hdiutil convert /tmp/HighSierra.cdr.dmg -format UDTO -o /tmp/HighSierra.iso
mv /tmp/HighSierra.iso.cdr ~/Desktop/HighSierra.iso
That’s it. You now have a bootable ISO file on the desktop that you can install on your Virtual machine. Copy it into a thumb drive and move over to your Linux box to begin the installation.
You have seen the different methods out there to run Mac apps on Linux, despite Apple’s efforts to the contrary.
The Darling Emulator is best for little shell programs. Else, if you need to run a more serious GUI program use a Virtual machine.