StefanScherer / packer-windows

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

Win10 build asks for Language during install/first boot; an Update was unsuccessful #286

Closed backhausmartin closed 3 years ago

backhausmartin commented 3 years ago

Hello Stefan, thanks for providing / maintaining this repo.

I tried / run the windows_10 build using an image I downloaded and only "virtualbox-iso" packer builder. The image is called Win10_20H2_v2_EnglishInternational_x64.iso.

For testing purposes I added the Win10 key of the machine that runs it (packer, Virtualbox).

Problems I encountered:

virtualbox-iso: 2021-02-13T06:44:20 Script: A:\win-updates.ps1
    virtualbox-iso: Script User: VAGRANT-10\vagrant
    virtualbox-iso: Started: 02/13/2021 06:44:20
    virtualbox-iso: 2021-02-13T06:44:23 System.Runtime.InteropServices.COMException (0x80072F8F): Exception from HRESULT: 0x80072F8F
    virtualbox-iso:    at System.Management.Automation.ComInterop.ComRuntimeHelpers.CheckThrowException(Int32 hresult, ExcepInfo& excepInfo, ComMethodDesc method, Object[] args, UInt32 argErr)
    virtualbox-iso:    at CallSite.Target(Closure , CallSite , ComObject , String )
    virtualbox-iso:    at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
    virtualbox-iso:    at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
    virtualbox-iso:    at System.Management.Automation.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)
    virtualbox-iso:    at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
    virtualbox-iso: 2021-02-13T06:44:24 Search call to UpdateSearcher was unsuccessful. Retrying in 10s.

A bit later:

virtualbox-iso: 2021-02-13T06:49:42 There are no applicable updates
    virtualbox-iso: 2021-02-13T06:49:42 Done Installing Windows Updates
    virtualbox-iso: End of Windows Updates log file C:\Windows\Temp\win-updates.log

Then it continues with provisioning.

Maybe the above mentioned image is "retail" and not "Enterprise"? Or the Microsoft update service was just down...

But: after 1hour 5minutes it finished successfully (except this one click I had to do manually because of the language) It did boot within Vagrant, I only needed to enter username and password manually.

Do you have any recommendations / best-practices, as a Windows expert, of what to do to create a Gold image (for production use, not Vagrant)?

Thanks, Martin

backhausmartin commented 3 years ago

It's a similar issue like #43 ...

luclis commented 3 years ago

Did you try to build your Win10 with the default iso from Microsoft ?

I've got a similar issue when I was using another language and/or when the autounattended.xml wasn't in the section floppy files.

backhausmartin commented 3 years ago

I got the image from here: https://www.microsoft.com/en-us/software-download/windows10ISO It says "Windows 10 October 2020 Update". I then choose "English International" and 64 bit Download.

(Tell your browser to be a Non-Windows User Agent and a direct download option will suddenly and magically appear...)

For now I fixed it with:

boot_command = ["<tab><tab><tab><enter><wait><enter>"]

There are two enter fields, as I also needed to select "Windows 10 Pro" on a second screen (only this one option appears, because the Win 10 key might be only Pro).

Maybe this Windows Assessment and Deployment Kit has some solutions to fix it directly in the answer file... I still need to further investigate. I guess the proper way is to use Volume licenses or the evaluation image that will be activated after full machine installation...?

StefanScherer commented 3 years ago

Yes, a different ISO often requires a different Autounattend.xml. You can adjust a lot, select the Pro edition, add your license, ... but that‘s out of the scope of this repo.

backhausmartin commented 3 years ago

Ok, thanks!