Fail to mount image files in windows server 2012

I try to mount a .iso and get the following eror on windows Server 2012

"sorry, there was a problem mounting the file."

Anyone ?

It seems like it works fine if I mount it not through mapping drive.


Solution 1:

The error message is not very clear so here are some tips on debugging the issue. Open up a Powershell command prompt and type the following (from here) :

function Resolve-Error ($ErrorRecord=$Error[0])
{
   $ErrorRecord | Format-List * -Force
   $ErrorRecord.InvocationInfo |Format-List *
   $Exception = $ErrorRecord.Exception
   for ($i = 0; $Exception; $i++, ($Exception = $Exception.InnerException))
   {   "$i" * 80
       $Exception |Format-List * -Force
   }
}

Next type the following command to mount your image. Change the "ImagePath" parameter with the path to your ISO:

Mount-DiskImage -Verbose -StorageType "ISO"  -ImagePath "C:\Downloads\Core-current.iso"

The "-verbose" flag should give you some info but type the following command immediately after executing the above might give you more debug info:

Resolve-Error

Paste the error message back here if it gets you nowhere and see if someone can help :)

Solution 2:

If you downloaded the iso from Microsoft using their Akamai NetSession client then this is actually a bug in the downloader.

When you right click and try to mount, you will get this error:

enter image description here

The problem is that their required download manager is setting the download file to be a sparse file as can be seen by the "P" attribute in the screenshot below.

enter image description here

The easiest way to fix this is to copy the file so that the sparse attribute is gone. Normally if you copy using Windows Explorer the sparse attribute will be removed.

Credit for this info goes to : Bug of the Day: Couldn't Mount File in Windows 8.1

Solution 3:

This is caused, because the file is marked as sparse (For more information here: https://msdn.microsoft.com/en-us/library/windows/desktop/aa365564%28v=vs.85%29.aspx ) I had the same problem and I found two solutions.

Solution 1:
If the file or image (as mountable file) is less than 10 GB in size, just copy the file.

Solution 2:
If the file or image (as mountable file) is greater than 10 GB in size or/and you don't have space on your HDD. Try this:

1. Check if the file is Read-Only from the Properties panel. If it is, remove the check in the checkbox and Apply;
2. Check if the file is Blocked from the Properties panel right below the permissions for read, hide. If it is click the button 'Unblock' to unblock it;
3. Run PowerShell or Command Prompt as administrator;
4. Navigate to the directory in which the file is located;
5. Execute the following command:
fsutil sparse setflag "<file_name>.iso" 0
6. Mount the file

NOTE: Use quotes in the file name of the file if the file name contains white spaces.

Solution 4:

I had a similar problem with a different solution, the ISO was housed on a network share and the drive was not mounted under the local server administrator credentials. I mounted the same drive letter and path as the explorer session I was using under an elevated command prompt and the explorer mount worked..