StefanScherer / packer-windows

Windows Templates for Packer: Windows 11, Windows 10, Windows Server 2022, 2019, 2016, also with Docker
MIT License
1.29k stars 434 forks source link

SynchronousCommand hangs with local Windows 10 iso #334

Closed pwige closed 7 months ago

pwige commented 7 months ago

I am attempting to build a box targeting virtualbox-iso with a local consumer edition Windows ISO and legitimate product key. Unfortunately, the process gets stuck on the second of the FirstLogonCommands:

<SynchronousCommand wcm:action="add">
  <CommandLine>C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy
    -ExecutionPolicy RemoteSigned -Force"</CommandLine>
  <Description>Set Execution Policy 32 Bit</Description>
  <Order>2</Order>
  <RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>

It is asking the user to manually enter the desired execution policy, despite it being included in the command contained in the above XML.

My build command is as follows:

packer build --force --only=virtualbox-iso --var headless=true ./windows_10.json

I have attached a screenshot from the guest that the point the issue occurs: 1301

My Autounattended.xml file may be seen here. Please let me know if there is another, more preferable, way for me to provide this. Thanks.

pwige commented 7 months ago

You know what. It was a whitespace issue stemming from my editor's XML formatter splitting lines longer than 100 characters. "Problem" solved.