How to run macOS Catalina in VirtManager on Linux
If you need macOS on your Linux PC for development purposes, you’ll be happy to know that it is possible to set up a VM in VirtManager using the macOS-Simple-KVM tool.
Installing VirtManager
You’ll need to install VirtManager on your Linux PC to use macOS on your Linux PC. To install the software, open up a terminal window. You can open a terminal window by pressing Ctrl + Alt + T on the keyboard. Or, search for “Terminal” in the app menu.
With the terminal window open, the installation can begin. Follow the installation instructions below to install VirtManager on your Linux PC.
Ubuntu
To install VirtManager on Ubuntu, use the following apt install command below.
sudo apt install virt-manager
Debian
To get VirtManager on your Debian system, install the software using the apt-get install command.
sudo apt-get install virt-manager
Arch Linux
To install VirtManager on Arch Linux, use the pacman -S command.
sudo pacman -S virt-manager
Fedora
To get VirtManager working on Fedora, use the following dnf install command.
sudo dnf install virt-manager
OpenSUSE
To set up VirtManager on OpenSUSE Linux, you can run the following zypper install command.
sudo zypper install virt-manager
Downloading macOS Simple KVM
Just downloading macOS to your Linux PC and inserting it into VirtManager isn’t going to work. Apple’s OS is highly specialized, and as a result, it must be customized beforehand. Thankfully, the macOS Simple KVM project makes it easy.
To start, you’ll have to install various dependencies required to use macOS Simple KVM. Then, follow the instructions below to get everything working.
Ubuntu
sudo apt install libvirt-daemon qemu-system qemu-utils python3 python3-pip git
Debian
sudo apt-get install libvirt-daemon qemu-system qemu-utils python3 python3-pip git
Arch Linux
sudo pacman -S qemu python python-pip python-wheel git sudo systemctl enable libvirtd sudo systemctl start libvirtd
Fedora
sudo dnf install libvirt-daemon qemu qemu-img python3 python3-pip git sudo systemctl enable libvirtd sudo systemctl start libvirtd
OpenSUSE
sudo zypper in libvirt-daemon qemu-tools qemu-kvm qemu-x86 qemu-audio-pa python3-pip git sudo systemctl enable libvirtd sudo systemctl start libvirtd
After setting up the dependencies, use the git clone command to grab the macOS Simple KVM project files from GitHub.
git clone https://github.com/foxlet/macOS-Simple-KVM.git
Move into the “macOS-Simple-KVM” folder using the cd command.
cd macOS-Simple-KVM/
Next, run the jumpstart.sh, command to download the macOS installation software.
./jumpstart.sh --catalina
Once the jumpstart script finishes executing, move on to the next section of the guide.
Generating a macOS hard drive
You must generate an HDD for the macOS KVM virtual machine. To do that, use the qemu-img command below. In this guide, we’ll create a drive that is 100 GB in size (but not allocated all at once). If you wish for the drive to be bigger (or smaller), edit the “100G” portion of the command.
qemu-img create -f qcow2 macos.qcow2 100G
Enabling macOS in VirtManager
To enable macOS in VirtManager, you’ll need to run a unique script. This script takes makes the macOS configuration and imports it. Then, in the terminal, run the make.sh command.
sudo ./make.sh --add
After running the command below, the make.sh
script will generate an XML configuration and import the VM to VirtManager. Right-click on it, and select the “Open” option to access the VM. However, do not start up the VM yet.
Select the information button next to the monitor icon to access the macOS VM configuration. Select either “SATA Disk 1” or “SATA Disk 2,” Then, click on the “Add Hardware” button with the mouse.
Browse for the “macOS-Simple-KVM” folder on your computer, and click on the “Select or create custom store” checkbox. Then, the “Manage” button.
After clicking the “Manage” button, you’ll see a “Locate or create storage volume” pop-up window. Click on the “+” sign. When you click on this button, a window that says “Create storage pool.” Find “Target Path” and click on it with the mouse.
After clicking on “Target Path,” enter the following path. However, be sure to change “USERNAME ” to your Linux PC’s username.
/home/USERNAME/macOS-Simple-KVM
Click “Finish” to add the storage pool. Then, look through the new storage pool for “macos.qcow2” and select “Choose Volume.” Then, select the “Finish” button to add the latest hardware to the VM.
Once the new hard drive is added, click the “PLAY” button to start the VM.
Installing macOS
Once the VM is booted up, you’ll see the Clover boot manager. First, find the option “Boot macOS Install from macOS Base System” and select it with the keyboard arrows. Then, press Enter to boot up the installer.
You’ll see the “macOS Utilities” window with the installer booted up. Select “Disk Utility” to load up the Apple partition tool. In disk utility, find the “QEMU HARDDISK” with 107.37 GB space.
Once you’ve located the hard drive, select the “Erase” button. Then, name the drive “HDD.” Next, select the “Erase” button to format the drive. When done, click “Disk Utility” in the top bar, and select “Quit Disk Utility” to return to the macOS installation tool.
Select “Reinstall macOS,” and install macOS as a VM. Keep in mind that VMs can be slow. You may need to let the installation sit for an hour or so.
After the lengthy installation, you’ll be ready to use MacOS on your Linux PC as a VM.