DISM Not finding source

Joseph Rapoport 11 Reputation points
2021-02-11T13:11:18.063+00:00

I am having some difficulty with DISM, and it appears that nothing that I do will resolve the issue.
I confirmed that the server in question and the image that I am using for the WIM repair are of the same build - 14393.4169 however every time I run DISM it fails with an error indicating that it cannot find the source.

The source is mounted as E: and is the Windows Server 2016 Standard x64 ISO evaluation downloaded directly from Microsoft.

C:\Windows\system32>dism.exe /online /cleanup-image /restorehealth /Source:E:\Sources\install.wim:1

Deployment Image Servicing and Management tool
Version: 10.0.14393.4169

Image Version: 10.0.14393.4169

[==========================100.0%==========================]
Error: 0x800f081f

The source files could not be found.
Use the "Source" option to specify the location of the files that are required to restore the feature. For more information on specifying a source location, see http://go.microsoft.com/fwlink/?LinkId=243077.

The DISM log file can be found at C:\Windows\Logs\DISM\dism.log

C:\Windows\system32>dism.exe /online /cleanup-image /restorehealth /Source:E:\Sources\install.wim:1 /LimitAccess

Deployment Image Servicing and Management tool
Version: 10.0.14393.4169

Image Version: 10.0.14393.4169

[==========================100.0%==========================]
Error: 0x800f081f

The source files could not be found.
Use the "Source" option to specify the location of the files that are required to restore the feature. For more information on specifying a source location, see http://go.microsoft.com/fwlink/?LinkId=243077.

The DISM log file can be found at C:\Windows\Logs\DISM\dism.log

C:\Windows\system32>dism.exe /online /cleanup-image /restorehealth /Source:E:\Sources\install.wim /LimitAccess

Deployment Image Servicing and Management tool
Version: 10.0.14393.4169

Image Version: 10.0.14393.4169

[==========================100.0%==========================]
Error: 0x800f081f

The source files could not be found.
Use the "Source" option to specify the location of the files that are required to restore the feature. For more information on specifying a source location, see http://go.microsoft.com/fwlink/?LinkId=243077.

The DISM log file can be found at C:\Windows\Logs\DISM\dism.log

The DISM log is showing the same error.
2021-02-11 07:50:00, Error DISM DISM Package Manager: PID=5520 TID=9676 Failed finalizing changes. - CDISMPackageManager::Internal_Finalize(hr:0x800f081f)
2021-02-11 07:50:00, Error DISM DISM Package Manager: PID=5520 TID=9676 The source files could not be found; their location must be specified using the /source option to restore the feature. - GetCbsErrorMsg
2021-02-11 07:50:00, Error DISM DISM Package Manager: PID=5520 TID=9676 Failed processing package changes with session option CbsSessionOptionRepairStoreCorruption - CDISMPackageManager::RestoreHealth(hr:0x800f081f)
2021-02-11 07:50:00, Error DISM DISM Package Manager: PID=5520 TID=9676 The source files could not be found; their location must be specified using the /source option to restore the feature. - GetCbsErrorMsg
2021-02-11 07:50:00, Error DISM DISM Package Manager: PID=5520 TID=9676 Failed to restore the image health. - CPackageManagerCLIHandler::ProcessCmdLine_CleanupImage(hr:0x800f081f)
2021-02-11 07:50:00, Error DISM DISM Package Manager: PID=5520 TID=9676 Failed while processing command cleanup-image. - CPackageManagerCLIHandler::ExecuteCmdLine(hr:0x800f081f)

If you look up above at the syntax of my DISM, I am using the /source option. What the heck, Microsoft?
Anyone else run into this?
I could use some assistance.

Thanks,
Joseph

Windows Server 2016
Windows Server 2016
A Microsoft server operating system that supports enterprise-level management updated to data storage.
2,528 questions
0 comments No comments
{count} votes

12 answers

Sort by: Most helpful
  1. Dale Kudusi 3,236 Reputation points
    2021-02-12T06:40:04.397+00:00

    Hi,
    You could try the following methods:
    Method 1

    1. Type Dism.exe /online /Cleanup-Image /StartComponentCleanup and press Enter in elevated command prompt.
    2. Then you can retry running Dism /Online /Cleanup-Image /RestoreHealth command.

    Method 2

    1. Locate Windows OS ISO file in File Explorer and right click, select Mount.
    2. Type following commands one-by -one and press Enter key after each:
      diskpart
      list volume
      exit
    3. After executing these commands, you have to identify correct drive letter on which Windows ISO file is mounted. Then run this final command:
      4.Then run this final command: DISM /Online /Cleanup-Image /RestoreHealth /source:WIM:X:\Sources\Install.wim:1 /LimitAccess
    4. You’ve now redirected DISM to mounted Windows ISO file. Hence, you can now run DISM command i.e. Dism /Online /Cleanup-Image /RestoreHealth and it should work.

    Best regards.

    **
    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    4 people found this answer helpful.

  2. MotoX80 34,516 Reputation points
    2021-02-11T23:58:23.21+00:00

    I've had some "fun" with DISM on Win10 recently so maybe this will help you....

    I downloaded Windows Server 2016 Standard x64.ISO and ran this:

    dism /Get-WimInfo /WimFile:D:\sources\install.wim

    It shows:

    Details for image : D:\sources\install.wim
    Index : 1
    Name : Windows Server 2016 Standard Evaluation
    Description : This option (recommended) reduces management and servicing by installing only what is needed to run most server roles and applications. It does not include a GUI, but you can fully manage the server locally or remotely with Windows PowerShell or other tools. For more details see "Windows Server Installation Options."
    Size : 9,235,873,810 bytes
    Index : 2
    Name : Windows Server 2016 Standard Evaluation (Desktop Experience)
    Description : This option is useful when a GUI is required—for example, to provide backward compatibility for an application that cannot be run on a Server Core installation. All server roles and features are supported. For more details see "Windows Server Installation Options."
    Size : 15,305,218,110 bytes
    Index : 3
    Name : Windows Server 2016 Datacenter Evaluation
    Description : This option (recommended) reduces management and servicing by installing only what is needed to run most server roles and applications. It does not include a GUI, but you can fully manage the server locally or remotely with Windows PowerShell or other tools. For more details see "Windows Server Installation Options."
    Size : 9,234,074,002 bytes
    Index : 4
    Name : Windows Server 2016 Datacenter Evaluation (Desktop Experience)
    Description : This option is useful when a GUI is required—for example, to provide backward compatibility for an application that cannot be run on a Server Core installation. All server roles and features are supported. For more details see "Windows Server Installation Options."
    Size : 15,316,399,667 bytes

    The (Desktop Experience) caught my attention. It looks to me that "install.wim:1" is server core. Have you tried using "/Source:E:\Sources\install.wim:2"?

    I had a Win10 Pro VM that I play with and somehow got mangled up. I eventually got /RestoreHealth to not error out (I think it worked!) by sharing out C:\Windows from my laptop which was the same patch level and using "/source:\MyLaptop\windows". If you have another server, you could try that.

    2 people found this answer helpful.

  3. Erik Metzler 11 Reputation points
    2021-06-30T15:43:20.73+00:00

    I have not been able to fully automate, but the MotoX solution is as best I can tell the way to go. It may still fail, but it gets you most of the way there. Then, go into the CBS log and determine the items it cannot repair. For me it's always just link files. especially for DNS manager snapin. Only 1-2 items in total. Then if you have another good server of the same version, get the link from them and replace. This has gotten my 2016 servers to stop complaining on SFC scans.

    Also, some powershell to make life easier.

    # Obtain ISO from Microsoft at https://www.microsoft.com/en-us/evalcenter/evaluate-windows-server-2016/
    # https://software-download.microsoft.com/download/pr/Windows_Server_2016_Datacenter_EVAL_en-us_14393_refresh.ISO
    # https://software-download.microsoft.com/download/pr/17763.737.190906-2324.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us_1.iso
    
    #Determine 2016 or 2019 and set the download path
    $VersionData = (Get-WMIObject win32_operatingsystem).name 
    Write-Host "OS is $VersionData"
    #Set the download Path
    if ($VersionData -like "*2019*")
    {
        #2019 Disk
        Write-Host "Download for Server 2019"
        $DownloadPath = "https://software-download.microsoft.com/download/pr/17763.737.190906-2324.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us_1.iso"
    
    } elseif ($VersionData -like "*2016*")
    {
       #2016 Disk
       Write-Host "Download for Server 2016"
       $DownloadPath = "https://software-download.microsoft.com/download/pr/Windows_Server_2016_Datacenter_EVAL_en-us_14393_refresh.ISO"
    
    } else 
    {
        Write-Error ("The OS $VersionData is not supported by this script.")
        exit
    }
    
    #create the folder as needed
    if (!(Test-Path c:\temp)) {
        Write-Host "Creating c:\temp"
        New-Item c:\temp -ItemType directory
    }
    
    #Download the file if needed.
    $isoPath="C:\Temp\Server.iso"
    if (!(Test-Path $isoPath -PathType Leaf))
    {
        Write-Host "Downloading from $DownloadPath"
        #I prefer BITS, but we'll live with this for now. I've had BITS broken on systems that need repair.
        try {
        #    Start-BitsTransfer $DownloadPath $isoPath
    
            $wc = New-Object net.webclient;
            $wc.Downloadfile($DownloadPath, $isoPath)
    
        } catch {
            Write-Error "Unable to download file from $DownloadPath"
            exit
        }
    } else {
        Write-Host "ISO is present from previous runs."
    }
    # Perform Windows Repair using Windows ISO as the source (works better):
    
    # Specify ISO Path
    
    try {
        $isoMount=Mount-DiskImage $isoPath -PassThru
        $driveLetter=($isoMount | get-volume).DriveLetter
        $wimPath="$driveLetter`:\sources\install.wim:2"
        Write-Host "wimPath: $wimPath"
        #$logPath="C:\Temp\dism-repair-windows.log"
    } catch {
        Write-Error "Unable to mount image."
        exit
    }
    
    if ($VersionData -like "*2016*")
    {
        if (!(Test-Path C:\temp\offline)){
            md C:\temp\offline
        }
    
        DISM.exe /Mount-Wim /WimFile:"$driveletter`:\sources\install.wim" /index:2 /MountDir:C:\temp\offline /ReadOnly
        Dism.exe /Online /Cleanup-Image /restoreHealth /source:C:\temp\offline /loglevel:4
        DISM.exe /Unmount-Wim /MountDir:C:\temp\offline /discard
    } else
    {
        # Restore Windows Health using provided ISO:
        dism /online /cleanup-image /restorehealth /source:WIM:$wimPath /limitaccess # non-native PowerShell command
        # Repair-WindowsImage -Online -RestoreHealth -Source $wimPath -LimitAccess -LogPath $logPath
    }
    
    
    # Dismount ISO when done
    try {
        Dismount-DiskImage -ImagePath $isoPath
        } catch {
        Write-Error "Unable to unmount image."
        exit
    }
    
    <#
    #delete the ISO (Uncomment to clean up instead)
    try {
        Remove-Item $isoPath
        } catch {
        Write-Error "Unable to delete the image"
        exit
        }
    
    #>
    
    2 people found this answer helpful.

  4. Dave Nottingham 46 Reputation points
    2023-03-20T15:57:28.93+00:00

    This is an old thread, but I just had the same problem - it appears that adding the WIM parameter within source as well as the correct index (2 in my case, for standard with desktop experience) works - the way I did it was...

    DISM /online /Cleanup-Image /CheckHealth

    If the returns it is repairable then

    DISM /online /Cleanup-Image /ScanHealth

    If that also returns it is repairable then

    DISM /Online /Cleanup-Image /RestoreHealth /source:WIM:G:Sources\Install.wim:2 /LimitAccess

    Where 'G' is the mounted latest version of the ISO

    It should run without returning the source error.

    Then run

    SFC /ScanNow

    Until it returns no errors

    2 people found this answer helpful.

  5. Marty Ferguson 25 Reputation points
    2023-05-03T19:36:56.1266667+00:00

    I ran into this recently and figured out a solution that worked for me.

    In my case we have Win 10 systems in an environment with WSUS. It seems that WSUS becomes the default source for DISM when choosing "Online". I found some steps to turn that off temporarily run the restorehealth and then turn it back on. Part of the reason this failed is we dont keep old versions of OS/Patches in our WSUS and clean it regularly.

    #Changes Windows Update to not use local server

    reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU /f /v UseWUServer

    REG_DWORD /d 0

    Start-Sleep -s 3

    #Restarts Windows Update service for change to take affect

    restart-service wuauserv

    Start-Sleep -s 3

    #Run Dism commands to pull from Online = MS

    dism /online /cleanup-image /restorehealth

    #Changes Windows Update to use local WSUS server
    reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU /f /v UseWUServer /t REG_DWORD /d 1

    Start-Sleep -s 3

    #Restarts Windows Update service for change to take affect

    restart-service wuauserv

    2 people found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.