Factory OS errors when using BuildWSKImage
I'm trying to create a Factory OS image, for a VM, using this guide: https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/factoryos/?view=windows-11
I've got as far as the step which asks you to run BuildWSKImage, but get several errors, including:
imageapp INFO ThreadId11384 [00:01:49] Entered IUSubphase WimCommit imageapp INFO ThreadId27384 [00:01:51] Staging progress: 55% imageapp INFO ThreadId27384 [00:01:53] Staging progress: 56% imageapp : ERROR : ThreadId11384 [00:01:54] WIL Origination: onecore\base\cbs\mobile\iucommon\iuutils.cpp(1935)\UpdateDLL.dll!694A6A4B: (caller: 694A6C7E) ReturnHr(4) tid(2c78) 80070005 Access is denied.
imageapp : ERROR : ThreadId11384 [00:01:54] WIL Origination: onecore\base\cbs\mobile\iucommon\iuutils.cpp(1984)\UpdateDLL.dll!694A6C97: (caller: 6944C655) ReturnHr(5) tid(2c78) 80070005 Access is denied.
imageapp : ERROR : ThreadId11384 [00:01:54] WIL Origination: onecore\base\cbs\mobile\iucore\iustore.cpp(2232)\UpdateDLL.dll!6944C66E: (caller: 69474270) ReturnHr(6) tid(2c78) 80070005 Access is denied.
Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at Microsoft.WindowsPhone.Imaging.UpdateDll.PrepareUpdate(IntPtr UpdateContext, UInt32 Flags) at Microsoft.WindowsPhone.Imaging.UpdateDll.PrepareUpdate(List`1 deviceLayoutPaths, String driveLetterConfigPath) at Microsoft.WindowsPhone.Imaging.Imaging.StageImage() at Microsoft.WindowsPhone.Imaging.Imaging.CommitStagedImage() at Microsoft.WindowsPhone.Imaging.Imaging.CreateFullImage(Boolean randomizeGptIds) at Microsoft.WindowsPhone.Imaging.Imaging.ProcessImage(Boolean randomizeGptIds) at Microsoft.WindowsPhone.Imaging.Imaging.BuildNewImage(String outputFile, String oemInputXML, String msPackageRoot, Boolean randomizeGptIds, Boolean recovery) at Microsoft.WindowsPhone.ImageUpdate.ImageApp.BeginImaging(Imaging imaging) at Microsoft.WindowsPhone.ImageUpdate.ImageApp.Main() "ImageApp "C:\Workspace\VM-Factory-3.Output\FactoryOS_Manufacturing_AMD64_UEFI_SpacesGPT_VM.vhdx" "C:\Workspace\VM-Factory-3\FactoryOS_Manufacturing_AMD64_UEFI_SpacesGPT_VM.xml" "E:\Program Files\Windows Kits\10\MSPackages" +StrictSettingPolicies /CPUType:AMD64 " failed with error -1073741819 Imggen returned -1073741819 Logs copied to "C:\Workspace\VM-Factory-3.Logs\20250217_121809"
BuildWSKImage.ps1: New-WSKImage exiting with status -1073741819 BuildWSKImage.cmd exiting with status -1073741819
I can't find any detailed guidance, or support on this topic, so I'd appreciated being pointed in the right direction!