You can download the Mojave installer from Apple's support page (it comes as an application, not a disk image, so it can be used directly to create the Mojave VM). If you don't have access to a suitable older Mac model, the workaround is to create a temporary VM for a later macOS which your Mac is able to run, e.g. If your iMac is a 2017 or later model, then it is too new to run El Capitan, so the installer package inside the disk image will refuse to proceed. The catch is that you can only do this on a Mac which is able to boot El Capitan. That application is the file you need to create an El Capitan VM. dmg in macOS and run the installer package inside it, which will create an 'Install OS X El Capitan' application in your Applications folder. The key detail is that you can't use that InstallMacOSX.dmg file to create a VM. This problem has come up before and I gave a more detailed answer at the time.