Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hyper-V ISO builder fails with message: "The boot loader failed - Time out" inside the virtual machine #6208

Closed
janegilring opened this issue Apr 27, 2018 · 5 comments

Comments

@janegilring
Copy link

janegilring commented Apr 27, 2018

  • Packer version: 1.2.3
  • Host platform: Windows Server 2016 with April 2018 Cumulative Update

I am building images for Windows Server 2012 R2, 2016 and 2019 Insider Preview.
During the last few months the build has been failing a lot with the error message "The boot loader failed - Time out".

Everything works as normal for the build process in Packer.
==> hyperv-iso: Creating temporary directory...
==> hyperv-iso: Downloading or copying ISO
hyperv-iso: Downloading or copying: file:///C:/Packer/iso/SW_DVD9_Win_Svr_STD_Core_and_DataCtr_Core_2016_64Bit_English_-3_MLF_X21-30350.ISO
==> hyperv-iso: Creating switch 'Hyper-V Logical SET Switch' if required...
==> hyperv-iso: switch 'Hyper-V Logical SET Switch' already exists. Will not delete on cleanup...
==> hyperv-iso: Creating virtual machine...
==> hyperv-iso: Enabling Integration Service...
==> hyperv-iso: Setting boot drive to os dvd drive C:/Packer/iso/SW_DVD9_Win_Svr_STD_Core_and_DataCtr_Core_2016_64Bit_English_-3_MLF_X21-30350.ISO ...
==> hyperv-iso: Mounting os dvd drive C:/Packer/iso/SW_DVD9_Win_Svr_STD_Core_and_DataCtr_Core_2016_64Bit_English_-3_MLF_X21-30350.ISO ...
==> hyperv-iso: Skipping mounting Integration Services Setup Disk...
==> hyperv-iso: Mounting secondary DVD images...
==> hyperv-iso: Mounting secondary dvd drive ./answer_files/win2016VL/Autounattend.iso ...
==> hyperv-iso: Configuring vlan...
==> hyperv-iso: Starting the virtual machine...
==> hyperv-iso: Host IP for the HyperV machine: False
==> hyperv-iso: Typing the boot command...
==> hyperv-iso: Waiting for WinRM to become available...

The issue occurs inside the virtual machines. A screenshot is available here.

The Packer build template file is available in this Gist.

If I manually press Ctrl+Alt+Del, the VM boots into the OS ISO and all of the remaining process works as it should. The issue is the initial boot from ISO.

Any idea what might cause this?

Update: It seems like this is a timing issue. After changing boot_wait from 0 to 2 seconds it seems to be working more stable. I'll leave the issue open until next week when the automated builds has run again to verify the whole pipeline is working stable.

@janegilring
Copy link
Author

I was just setting up the same Packer build configuration in a different environment (lab - slower hardware).
The issue in that environment seems to be the opposite: While Packer is in the "Starting the virtual machine..." state, the VM has already started and the "Press any key to start installation" screen is gone when Packer gets to the waiting state. Even when setting the boot wait to 0 seconds, Packer is too slow to type the boot commands.
However, I suppose that`s another issue so I'll create one after some more testing.

@marcinbojko
Copy link
Contributor

I've also found this issue, but in my case I can confirm it comes from different ISO versions. For example 2 different revisions of MS2016 Partner ISO gave me different results:

The config that works for them both is (in my case) :

 "boot_wait": "0s",
      "boot_command": [
        "a<enter><wait>"
      ],

@janegilring
Copy link
Author

janegilring commented May 4, 2018

I experienced the same thing: 2012 R2 VL ISO worked fine, but 2016 VL ISO failed with the same settings.

I ended up using the following which seems to work for both:
"boot_wait": "0s", "boot_command": [ "a<wait>a<wait>a<wait>a<wait>a<wait>a<wait>a" ]

@SwampDragons
Copy link
Contributor

It looks like you managed to dial in the right wait; I'm going to close this but if I'm wrong in thinking the issue is resolved, let me know.

@ghost
Copy link

ghost commented Apr 1, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants