windows-vagrant icon indicating copy to clipboard operation
windows-vagrant copied to clipboard

WinSxS folder cleanup fails on Windows-2022

Open itsyaboyrooba opened this issue 3 years ago • 2 comments

Hello!

The Winsxs cleanup in optimize.ps1 fails on win2022 with:

Console:

    qemu.windows-2022-amd64: Error: 0x800f0806
    qemu.windows-2022-amd64:
    qemu.windows-2022-amd64: The operation could not be completed due to pending operations.

Dism.log: dism.log

I ensured the TrustedInstaller, wuauserv and BITS services are all stopped.

I tried debugging myself but couldn't solve it, any help would be appreciated!

itsyaboyrooba avatar Jan 11 '23 07:01 itsyaboyrooba

Never seen that before. It seems to be a temporary state; can you modify the code to retry the operation? e.g.:

while ($true) {
  Write-Host 'Cleaning up the WinSxS folder...'
  dism.exe /Online /Quiet /Cleanup-Image /StartComponentCleanup /ResetBase
  if ($LASTEXITCODE) {
    Start-Sleep -Seconds 15
  } else {
    break
  }
}

rgl avatar Jan 11 '23 08:01 rgl

I've just come across this as well, though with Win11 23H2 (full ISO downloaded from Volume Licensing - didn't see any issues with the eval ISO)

No information in any logs about what was going on, but I seem to have found a workaround by splitting optimize.ps1 and inserting a reboot inbetween the initial commands and the subsequent dism commands

LordAro avatar Mar 01 '24 17:03 LordAro