After finally achieving the setup of a VM on Windows for a MacOS Mojave 10.14 based machine, i went through an issue that made me impossible to install XCode on the MacOS due to the limitation of the AppStore, that doesn't allow to download applications without an Apple ID. That by itself is not the problem, as you can easily create (and need) an apple account through a simple form and that's it, however you won't be able to login to the account in the AppStore of the machine.
Fortunately, the issue can be bypassed easily following the steps that we will mention on this article.
1. Delete CLR Cache
As first step you will need to delete the CLR cache of the system. To do this, open the directory that contains these files, you can easily go to the directory pressing Shift + CTRL + G: or go the Go menu and click on Go to Folder...:
In the window that appears, you will need to type the following path:
In the dialog that appears once you access the Go to folder option:
Inside the directory that will appear, delete all the files that appear inside:
2. Open Keychain access
As next, you need to access the Keychain access. You can search it through the spotlight search pressing on your KeyBoard ⌘ (CTRL) + SPACE and searching for Keychain Access:
Search for the Developer ID Certification Authority certificate on the list and open it (double click on it):
Inside this certificate, expand the Trust tab and set the Secure Sockets Layer (SSL) option to Always Trust:
When you quit, you will be prompted for the password of the administrator to save changes. Once you do this, restart your Mac and try to login once again to the AppStore, it should work now and you will be able to do whatever you need to do in your virtual machine, like installing xcode from the AppStore.