For Fun's Sake, I Installed macOS on Linux in a VM

Installing macOS as a virtual machine in a Linux system? Well, let's do it for the sake of some 'virtual fun'
Warp Terminal

Getting macOS to work on a non-Apple machine requires very selective hardware and countless hours configuring EFI, disks, and more. Using virtual machines can help overcome hardware nitpicking and focus on the experience.

If enough system resources are allocated for the VM, you might get a smooth experience out of macOS.

With the Quickemu project, virtualising macOS in Linux has never been easier. It uses Qemu/KVM under the hood to run virtual machines. MacOS versions from Mojave to Sonoma are supported.

🚧
As a few readers have advised, using macOS on a non-Apple device may violate Apple's policies. What we did here was for educational purposes only.

Hardware Requirements

To virtualise macOS in your system, your system must satisfy the minimum configuration required:

  • Processor: Intel Core i5/AMD Ryzen 5 or above with 4 cores minimum (with virtualisation support)
  • RAM: 8 GB or more (macOS needs at least 4 gigs of memory)
  • Disk Space: at least 40 GB of free space
πŸ“‹
Right from macOS Catalina, a fresh usable installation takes up 30+ GB of disk space and needs 8 GB of memory.

Quickemu installation

I am utilising the Quickemu project to install macOS. Based on qemu and KVM, it manages the downloading and execution of virtual machines within the command line.

You can find installation instructions on their GitHub repo. I am sharing the steps for Ubuntu, the distro I used in this tutorial.

Installing via PPA

The PPA method can be used for Ubuntu versions, including and above 22.04. Run the following commands in the terminal:

sudo apt-add-repository ppa:flexiondotorg/quickemu
sudo apt update
sudo apt install quickemu

Manual Installation from the repository

To install quickemu manually, obtain the dependencies (Debian-based distribution):

sudo apt install git qemu jq mesa-utils pciutils procps python3 genisoimage usbutils util-linux sed socat spice-client-gtk libtss2-tcti-swtpm0 xdg-user-dirs zsync unzip

You could get a specific version of the project from the releases page, or obtain the latest one by cloning the official repository:

git clone https://github.com/quickemu-project/quickemu/

Installing macOS

Within this project, a tool called quickget is used to download installation disc files from the official sources, which will be used to obtain a bootable configuration of macOS.

I am installing the BigSur version to demonstrate. Here are the steps:

Get the installation files via quickget

Change the directory to the repository, and run the following command:

cd quickemu

./quickget macos big-sur
Downloading macOS BigSur via Quickget
Downloading macOS BigSur via Quickget

Launch the virtual machine

Now the virtual machine can be spun up, where the following will be the boot screen:

./quickemu --vm macos-big-sur.conf

Command to launch the virtual machine

efi screen of macos installation disc
First boot - EFI Screen

Select 'macOS Base system' to get into the installation medium.

πŸ“‹
If the allocation of system resources has to be modified, check how to edit the quickemu config.

Create a partition from Disk Utility

The disk has to be partitioned in order to start with the installation. Hence, start with opening the Disk Utility from the menus:

Choosing disk utility from recovery menu
Choosing disk utility from the recovery menu

Format the drive "VirtIO Block Media" by selecting and erasing it. Enter a preferred name for your filesystem (for which I conveniently chose "macOS" πŸ˜›)

Erasing the virtual hard disk in disk utlity
Erasing the virtual hard disk

and choose the filesystem as APFS.

Choose filesystem name and Erase
Enter a filesystem name and erase disk

Start the installer

Quit the disk utility and get to the second option: Reinstall macOS BigSur

Select "Reinstall macOS Big Sur" from recovery screen
Select "Reinstall macOS Big Sur"
Installation Welcome screen
Installation Welcome screen

Agree to the license terms and proceed further.

License Agreement page
License Agreement page

After the license agreement, select the disk that you had already formatted. If you don't see the disk, quit the installer and check with the disk utility.

Selecting the disk for installation

And so the installation begins!

progress screen during installation
Progress of Installation

This page took around half an hour to complete (do not get confused by the ETA here). After a reboot, the installation continued for yet another half an hour:

Second installation progress screen
Second installation progress screen

Once the installation is complete, you will be greeted with a welcome page. You can start configuring your system from there.

Setting up your macOS instance

The setup screen greets you after a successful installation. Here is what I followed throughout the setup, which you can follow too:

Choose the country

Selecting the country of residence when the VM boots up:

select country in setup
Select country

License agreement

Apart from the setup, the license has to be agreed to even in the setup.

License agreement
License agreement

User account creation

Create a user account by specifying a username and password.

An Apple ID is required to use Apple services such as the store. Apple can suspend your ID for running macOS on non-recognised hardware, so beware.

Setting up an Apple ID
Setting up an Apple ID

Timezone

Choose the appropriate timezone for the system by entering your nearest city of residence.

Choosing the timezone
Choosing the timezone

Appearance

Here, choose either a constant light/dark mode or let the system choose for you:

Appearance - light/dark mode
Appearance - light/dark mode

And voila! You just successfully installed a fresh copy of macOS in your Linux system.

First boot of macOS
First boot of macOS

Tips for a seamless experience

Now that you have macOS installed in a VM, let me share a few tips and tweaks to enhance your experience.

Keyboard tweaks

If you are already used to macOS keyboard shortcuts, this is a tip to remap the command key near the spacebar:

Navigate to System Preferences ➑️ Keyboard ➑️ Modifier Keys, and swap the mapping of command and option keys.

Swap Option and Command Keys to emulate macOS keybindings
Swap Option and Command Keys

This helps to emulate the macOS-like keybindings since the alt key now functions as the command key.

Editing the quickemu configuration

Quickemu supports a default conf file to accommodate configuration changes (the same file used for launching).

For instance, to change the amount of RAM allocated, add the following line to macos-big-sur.conf:

ram="4G"

Here's a demonstration of how the configuration is changed:

0:00
/0:38

Change memory of macOS VM

Quickemu supports more such tweaks. You may check their official documentation for more such tweaks.

Change display resolution

For macOS Catalina, the resolution set at boot will be taken as the default. It is done by passing width and height tags to the command. Here's a sample:

quickemu --vm macos-catalina.conf --width 1920 --height 1080

For BigSur and above, you need tools like SwitchResX (freemium application) to set a resolution manually.

Create a desktop shortcut

Creating the desktop shortcut might be the best option if you won't actively work in the terminal debugging the virtual machine. Here's the template that I used for the shortcut:

[Desktop Entry]
Name=macOS BigSur # change name according to the version
Exec=/home/username/quickemu/macos-big-sur.conf # change your config path
Type=Application
Terminal=false # to open only the VM window
Comment="Shortcut to run a macOS VM by Quickemu"
StartupNotify=true
Icon=

Save this as macos-big-sur.desktop in your desktop folder. Double-clicking it should automatically launch the VM.

0:00
/0:14

Desktop shortcut to launch virtual machine

Alternatively, you can create an application icon in your app drawer with the --shortcut tag, like:

./quickemu --vm ./macos-big-sur.conf --shortcut

Conclusion

After a journey with multiple tools to get an instance of macOS running, this method is comparatively easier since it provides an out-of-the-box experience without having to meddle with configurations.

The macOS installation itself takes almost an hour, which is another reminder of how blessed we are with Linux that gets installed in under ten minutes.

Why would you install macOS in your system as a virtual machine? Let me know in the comments below.

About the author
Pranav Krishna

Pranav Krishna

A Computer Science student who happens to love Linux distributions. Loves programming and stands with spending 3 hours trying to automate things instead of doing it by hand.

Become a Better Linux User

With the FOSS Weekly Newsletter, you learn useful Linux tips, discover applications, explore new distros and stay updated with the latest from Linux world

itsfoss happy penguin

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.