This is a simple task, and it is only simple because of foxlet (@FoxletFox on twitter) (And later kholia)
Anyway, let us get to setting it up, to begin with, you don’t need to download MacOS, when using foxlet’s macOS-Simple-KVM OSX-KVM, https://github.com/kholia/OSX-KVM this system downloads MacOS on it’s own… or you can download it and install it offline (https://mrmacintosh.com/)
WARNING: Starting with Mojave, you need AVX2 support on your CPU, so your 4th gen I7 won’t do the trick
==== offline install start ========
FOR OFFLINE INSTALLATION: this section is for offline installation, unless you want to do offline installation
Offline_1- Go to https://mrmacintosh.com/ and download the version of MacOS you want, you should end up with a PKG file
Download (or use git) to get the OSX-KVM package
Offline_2- Create an ISO file from the PKG file with the following command
mkisofs -allow-limited-size -l -J -r -iso-level 3 -V InstallAssistant -o InstallAssistant.iso path/to/InstallAssistant.pkg scripts/run_offline.sh
==== offline install end ========
Step 1: Make sure you have KVM ! and the relevant tools
apt-get install qemu-kvm libvirt-daemon qemu-system qemu-utils python3 python3-pip bridge-utils virtinst libvirt-daemon-system virt-manager
You know, the usual kvm setup ;), I am hoping you already have KVM, if not, see this post and install KVM first
Now that you have kvm, you need to insure that vhost_net is installed, loaded and enabled
modprobe vhost_net
lsmod | grep vhost
You will also need git to download macOS-Simple-KVM (Has not been updated in 5 years.)
git clone https://github.com/foxlet/macOS-Simple-KVM.git
You will also need git to download
https://github.com/kholia/OSX-KVM?tab=readme-ov-file
Now, download MacOS base image that will download the rest of the operating system (catalina is the latest ?) options in that script are –high-sierra, –mojave, or –catalina.
./jumpstart.sh --catalina