OK Simon, here are details of what I did to get MegaCoreX working on my VM, it may be of interest to you or others.
In VM "Board Manager" I could not see an option to link a git page, the only method I could see was "install new hardware from zip" at the bottom window. I had already installed the MegaCoreX package this way before, but it didnt work.
So I deleted the package from the "Arduino/hardware" folder where the above method had placed it and repeated the process to no avail.
I still get the same errors, and the package is again installed in "E:\James\Documents\Arduino\hardware"
I deleted it again and went to the "
Arduino IDE".
From"
https://github.com/MCUdude/MegaCoreX/tree/master" I clicked the green "Code" button and copied the link and placed that in "Preferences" but this had "
https://github.com/MCUdude/MegaCoreX.git" and it only inserted the package back into the "E:\James\Documents\Arduino\hardware" and this didnt work in Arduino IDE .
Then I went to the section
Install on the Git page and copied the link which is: "
https://mcudude.github.io/MegaCoreX/package_MCUdude_MegaCoreX_index.jsont" and placed this in the "Preferences" having removed the previous .
This placed the package in "C:\Users\james\AppData\Local\Arduino15\packages".
I was then able to install to the Arduino IDE from the Board Manager" and build and install blink in the Arduino IDE.
I then closed the Arduino IDE and started VM and was now able to select ATmega4809 and build and install Blink OK.
Jim