Member-only story
How To Run macOS Inside a Virtual Machine on Linux
Get started with virtual machines by installing macOS in Linux
Virtual machines provide you with the opportunity to run and test other operating systems without the need for extra hardware.
This guide will show you how to install macOS on Ubuntu Linux so that you can test and run your macOS native apps. If you’re using another Linux distro, I have provided a link on how to install QEMU/KVM at the bottom of this article.
Installing a Virtual Machine Manager
This guide uses the QEMU/KVM, a lightweight emulator, and virtualizer for running virtual machines. You can install it using the command below. In addition, you will install some Python tools.
sudo apt-get install qemu-system qemu-utils python3 python3-pip
Downloading the macOS Base Image and Scripts
To easily get started, this guide will use the macOS-Simple-KVM open-source project on GitHub to ease the management of the virtual machine.
Cd to your /Downloads folder to make it your current working directory.
cd ~/Downloads
Use the wget utility to download the macOS base image and other required tools.
wget https://github.com/foxlet/macOS-Simple-KVM/archive/refs/heads/master.zip
Extract the downloaded package using the unzip command-line utility as follows.
unzip master.zip
The newly unzipped folder will have the name macOS-Simple-KVM-master.
Creating a Folder for Your Virtual Machines
To ease the management of virtual machines, you can create a folder in your home directory, which will house all virtual disks or other related content for your virtual machines.
mkdir ~/KVM
You can now move the extracted folder from your Downloads folder, and rename it to macOS to have a shorter name to work with.
mv ~/Downloads/macOS-Simple-KVM-master/ ~/KVM/macOS