darling
Run macOS software on Linux
TLDR
Run a builtin command
Run a specific program in the current path with arguments
Open a macOS shell
Shutdown the service
SYNOPSIS
darling [subcommand] [arguments...]
or
darling <path_to_macOS_application_bundle>
or
darling <path_to_macOS_executable_file>
PARAMETERS
<path_to_macOS_application_bundle>
Directly launches a macOS application bundle (e.g., MyApp.app).
<path_to_macOS_executable_file>
Directly launches a standalone macOS executable.
shell
Enters a macOS-like shell environment within Darling, useful for interacting with the emulated macOS filesystem.
launch [options] <executable>
Explicitly launches a specific macOS executable with additional options.
mount <path_to_dmg>
Mounts a macOS Disk Image (DMG) file, making its contents accessible within the Darling environment.
unmount <mount_point>
Unmounts a previously mounted DMG file.
install-xcode-toolchain
Installs the Xcode command-line tools within the Darling environment for development purposes.
xcode-select [--install] [--switch <path>]
Manages the active Xcode developer directory within Darling, similar to its macOS counterpart.
--version
Displays the Darling version information.
--help
Displays usage information and available subcommands.
DESCRIPTION
Darling is a free and open-source compatibility layer that enables macOS applications and their frameworks to run natively on Linux. Inspired by Wine (which facilitates Windows applications on Linux), Darling aims to provide a similar environment for Apple's operating system. It achieves this by implementing a user-space translation layer for macOS frameworks and APIs, coupled with a kernel module that intercepts and translates macOS system calls into their Linux equivalents.
The project's goal is to allow users to execute proprietary macOS software directly on a Linux system without requiring full virtualization, which typically consumes more resources. While still under active development and not yet fully compatible with all macOS applications, Darling represents a significant effort to bridge the gap between macOS's Mach-O binary format and Linux's ELF, offering a unique solution for cross-platform application compatibility.
CAVEATS
Darling is an ambitious and complex project, and as such, it comes with several caveats and limitations:
- Experimental and Incomplete: Many macOS frameworks and APIs are still under development or not yet implemented, meaning not all macOS applications will run correctly or at all.
- Kernel Module Requirement: It relies on a custom kernel module to handle system call translation, which necessitates root privileges for installation and might require specific kernel versions or configurations.
- Performance Overhead: While not full virtualization, the translation layer introduces a performance impact, especially for graphics-intensive applications. Full graphics acceleration support is an ongoing challenge.
- Compatibility: Primarily designed for x86_64 architecture, supporting older 32-bit macOS applications is dependent on the underlying Linux system's capabilities.
- Security: Running macOS applications in a compatibility layer may introduce unforeseen security implications, though Darling aims to be as secure as possible.
ARCHITECTURE
Darling's architecture involves two primary components: a user-space environment and a kernel module. The user-space component provides implementations of macOS libraries (like `libc++`, `libdispatch`, etc.) and frameworks (like `CoreFoundation`, `AppKit`). When a macOS application makes a system call, the Darling kernel module intercepts it, translates it into an equivalent Linux system call, and then passes it to the Linux kernel. This approach allows macOS binaries (Mach-O format) to run directly on a Linux kernel (ELF format) by transparently handling the differences in system call interfaces and library expectations.
INSTALLATION
As Darling is not a standard package in most mainstream Linux distributions, installation typically involves either adding a custom package repository (e.g., via `apt` or `dnf`) or building the project from source. Building from source requires specific development tools, kernel headers, and dependencies. Due to its nature as a kernel module, installation and setup often require administrative privileges and careful attention to kernel versions to ensure compatibility and stability.
HISTORY
Development on Darling began around 2013, initiated by Luboš Doležel. Its inception was driven by the desire to create a compatibility layer for macOS, mirroring the success of Wine for Windows applications. The project has steadily evolved, relying on reverse-engineering macOS APIs and open-source implementations of its core frameworks. Due to the closed-source and complex nature of macOS, progress has been challenging but persistent. Over the years, Darling has attracted a community of contributors and continues to be an active project, striving to offer a unique solution for macOS application compatibility on Linux, filling a niche that traditional virtualization doesn't fully address for native-like performance.
SEE ALSO
wine(1), qemu(1), kvm(7), virtualbox(1)