Error Code 2337 When Installing Microsoft SQL Server Into A Virtual Machine

Microsoft Dynamics GPI have installed SQL Server into Virtual Machines many times in the past but I’ve recently seen an error when trying to do it again;

The following error has occurred: The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2337.

I had a think about the error and realised that I usually installed SQL from the VM HDD and not, as I was in this case, by attaching the iso image to the VM as external media. I uncompressed the iso onto the VM HDD and ran the installer again from this source and it installed without problem.