rgl/windows-vagrant

WinSxS folder cleanup fails on Windows-2022

itsyaboyrooba opened this issue · 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!

rgl commented

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
  }
}

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