How to Create a macOS Virtual Machine Using Docker

Apple’s macOS is an aesthetic wonder, offering out-of-the-box good looks, great tools, and integration across the entire Apple ecosystem.

If you don’t want to buy Apple’s hardware, a Hackintosh or Virtual Machine is usually the way to go. But if you want to run macOS, and you’re in a hurry, there’s no better choice than Docker-OSX, which allows you to quickly build any macOS virtual machine on Linux.

Why not set up a virtual machine to run macOS?

A virtual machine is the digital equivalent of a real computer, and on which you can run any software that you would be able to run on a physical computer. You can run Windows within Linux, Linux within macOS, and any combination of these.

VMs are great for testing new operating systems or distros, for providing tutorial screenshots, and for using OS-specific tools that don’t work well through emulation or compatibility layers.

Examples of this type of software include Adobe’s Creative Suite, which was originally designed to run on the Apple Macintosh and was later ported to Windows. Running Photoshop on Linux is difficult and usually requires you to use a virtual machine.

But setting up a dedicated virtual macOS machine in VirtualBox or VMware Workstation Player is a time-consuming operation, involving multiple steps and a great deal of configuration. You also need to download the operating system and go through the entire installation process.

Instead of spending hours fiddling with VM settings, you can edit videos, create cool artwork or mix new music.

Docker-OSX makes it easy to quickly create a macOS VM

Docker-OSX is a tool that allows you to spin up a macOS image almost instantly and provides near-native performance. With a single command, you can run macOS Catalina on your desktop, or create a fresh installation of macOS Big Sur, Monterey, or Ventura. If you have a hankering for older systems, you can also try High Sierra and Mojave.

If you’re concerned about missing some Apple functionality, Docker-OSX supports iPhone USB passthrough, and allows you to share directories, files, and folders with the host system.

Getting started with Docker-OSX on Linux

Before you can use Docker-OSX to quickly build a macOS VM on your Linux system, you need to install Docker.

With this, you are ready to start pulling macOS Docker images.

The most straightforward option is to go with the ready-to-run macOS Catalina image. Although the OS was only released in 2019, Apple officially stopped supporting it on November 30, 2022. Nonetheless, it’s still a relatively modern and very capable desktop that you can use to get work done.

While you make a cup of tea or list your groceries, Docker will pull the relevant image, and you’ll see a macOS Catalina login screen when you return. The image is configured so that you can log in directly with the username “user” and the password “alpine”.

That’s it. A single line in your terminal, and you’re running macOS with a 20GB virtual hard drive!

While it’s certainly quick, you might want to install macOS from scratch and set up your own username and password. Docker-osx provides several images that can help you do this. Just open a terminal and enter the appropriate command from below.

Running macOS on Linux has never been easier!

Now you can build macOS machines on demand with minimal fuss, there’s no limit to your creative options, and you can install macOS-specific apps without problems. The macOS software ecosystem is very different from what you’re used to with Linux and there isn’t nearly as much open-source software.

Take a closer look at Apple’s operating system and get acquainted with the most essential features to make your life easier.