0

I'm trying to generalize an Azure VM image. When running sysprep, the following errors get logged error log

SYSPRP WinMain:Processing 'cleanup' external provider request. 2019-01-29 10:32:52, Info [0x0f006c]

SYSPRP RunExternalDlls:Running DLLs listed in registry for phase 3 2019-01-29 10:32:52, Info [0x0f008a]

SYSPRP RunRegistryDlls:Retrieved section name for this phase as Cleanup 2019-01-29 10:32:52, Info [0x0f008b]

SYSPRP RunRegistryDlls:Found entrypoint in registry at SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\SysPrepExternal\Cleanup\4FC1DA7A-CF3F-11E8-A988-000D3A3BE068; will try to launch 'DscCore.dll,SysPrep_Cleanup' 2019-01-29 10:32:52, Info [0x0f0080]

SYSPRP LaunchDll:Found 'DscCore.dll,SysPrep_Cleanup'; executing it 2019-01-29 10:32:52, Error [0x0f0082] SYSPRP LaunchDll:Failure occurred while executing 'DscCore.dll,SysPrep_Cleanup', returned error code 0x2 2019-01-29 10:32:52, Error [0x0f0070]

SYSPRP RunExternalDlls:An error occurred while running registry sysprep DLLs, halting sysprep execution. dwRet = 0x2[gle=0x00000006] 2019-01-29 10:32:52, Error [0x0f00ae]

SYSPRP WinMain:Hit failure while processing sysprep cleanup external providers; hr = 0x80070002[gle=0x00000006]

Geekn
  • 2,650
  • 5
  • 40
  • 80
  • Did you follow all the steps prior to sysprep? https://learn.microsoft.com/en-us/azure/virtual-machines/windows/prepare-for-upload-vhd-image – micahmckittrick Feb 01 '19 at 19:08
  • The VM was created in Azure (Windows Server 2016 Data Center). Doesn't that article discuss how to get a VHD that is on-premise up into Azure? I'll try the steps though. Thank you. – Geekn Feb 01 '19 at 19:15
  • Ah okay. Then you should be fine.to just sysprep. Then in this section https://learn.microsoft.com/en-us/azure/virtual-machines/windows/prepare-for-upload-vhd-image#steps-to-generalize-a-vhd you are running these steps and where do you get the error? Can you add a screenshot maybe? – micahmckittrick Feb 01 '19 at 22:10
  • Did you ever get an answer to this question? – Scott Heath Jul 30 '20 at 17:49
  • No I didn't. I ended up starting with a fresh VM and then it worked. – Geekn Jul 31 '20 at 13:06

1 Answers1

1

Had the same issue with Windows 10 Multi-User 21H1

Solution: Added a empty reg value for AgentId

reg add "HKLM\SOFTWARE\Microsoft\DesiredStateConfiguration" /v AgentId /t REG_SZ /d "" /f 
Lin-Art
  • 4,933
  • 2
  • 26
  • 31
  • 1
    The command above did not create an empty string value but instead a string "/f". I was unable to figure out how reg add can be used to forcefully set an empty string but here is PowerShell version: `Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\DesiredStateConfiguration" -Name "AgentId" -Value ""` – Ville Salonen Aug 09 '21 at 14:00