The answer is simple if you're a cross-platform developer wanting to test your software on a mac without buying one or just want a hackintosh without all the hassle then this might be for you.
We are going to install a snap package on a computer running a linux distrbution and then with the help of that snap package install macOS on the computer in a virtual machine.
We are going to install a snap package called sosumi which is based on macos-simple-kvm project that creates a macOS virtual machine easily for us to use.
- A computer running a modern linux distrbution of linux that supports snap packages.
Open your terminal and type
Snapto check if snap is installed.
If not then type
sudo apt/dnf/pacman install snapd.
Now snap should be installed on your system.
Now install sosumi by typing
sudo snap install sosumi.
A new application will be installed on your computer called sosumi.
Now the last thing to do is to run the sosumi app and install macOS from the macOS recovery screen. But before you do that you need to know that it will use minimum system resources at first you can configure it to your liking for that just go into your home directory and then you need to go to
/snap/sosumi/common and then edit the
launch file present in the folder. The file is set to use 2gb of ram and 2 cores of your processor, you can easily set that your preference.
There is also a file called macos.qcow2 which is the virtual harddisk of the virtual machine you can resize it to your liking by typing
qemu-img resize macos.qcow2+"your required size" and then launch the sosumi app and it will show you the macOS recovery screen from there you can install macOS.
If you just want to run only macOS I recommend you use a arch host for better performance.