gitmyhub

macos

Shell ★ 21k updated 13h ago

MacOS inside a Docker container.

Run a full macOS desktop inside a Docker container on Linux, accessible via web browser or VNC. Configure CPU, RAM, and disk through environment variables.

DockerDocker ComposeKVMShellVNCsetup: hardcomplexity 4/5

This project lets you run macOS inside a Docker container on a Linux host. Docker is a tool for running isolated software environments called containers; normally containers run Linux software. This project uses KVM (Kernel-based Virtual Machine), a hardware virtualization feature built into Linux, to run macOS as a virtual machine inside a container. The result is a fully functional macOS desktop that you access through a web browser on port 8006 or via VNC.

Setup is done through Docker Compose or a Docker CLI command — you specify which macOS version you want (Sequoia 15, Sonoma 14, Ventura 13, Monterey 12, or Big Sur 11), and the container automatically downloads the installer and walks you through the installation steps in your browser. Disk size, CPU cores, and RAM are all configurable through environment variables. The default is 64 GB of disk space, one CPU core, and 4 GB of RAM; these can be increased to suit your needs.

More advanced configurations are covered in the FAQ: giving the container its own IP address using Docker's macvlan networking, passing physical USB devices or hard drives through to macOS, sharing files between the container and the host filesystem, and enabling DHCP so macOS appears on your local network like any other device.

This is useful for developers on Linux who need to test software against macOS, automate macOS-specific tasks in a CI pipeline, or run macOS software without owning Apple hardware. KVM support is required, meaning it works on Linux hosts with compatible CPUs but not on macOS or most Windows systems. The project is written in Shell.

Where it fits