Packer: vsphere-iso builder: add support for secure boot

Created on 11 Mar 2020  ยท  9Comments  ยท  Source: hashicorp/packer

By default EFI and secure boot is enabled when creating a Windows 10 VM manually in later versions of vsphere, but I can't find a way to enable secure boot with vsphere-iso. This prevents me from even starting the ISO-installer for Windows 10 1909 in EFI mode.

buildevsphere enhancement

Most helpful comment

@SwampDragons I finally got to test it. It took a bit longer because the client I used for packer was a Raspberry Pi 4, so I couldn't use the provided binaries. I finally got it installed in a amd64 compatible VM and it sets EFI secure as intended.

All 9 comments

In the API, this gets added by setting the EfiSecureBootEnabled boot option. We can update the SetBootOptions() function to add this.
govc example: https://github.com/vmware/govmomi/blob/master/govc/device/boot.go#L54

I see two possible options on how to configure it in config:

Since secure boot implies using EFI, second variant looks cleaner. What do you think?

@SwampDragons up to you to decide how to implement that. See choice above :)

ah, thanks -- I think the second option looks good, too, and I like your linked diff. I'd merge that if you open a PR.

Great, will open PR.
Does it makes sense to add same option to vsphere-clone builder to be able to enable/disable secure boot or change loader type?

Probably does.

Build of linked Pr can be found here: https://circleci.com/gh/hashicorp/packer/43856#artifacts/containers/0.

@hkbakke if you have the time, it would be helpful to have you try that binary out to make sure it solves your issue.

@SwampDragons I finally got to test it. It took a bit longer because the client I used for packer was a Raspberry Pi 4, so I couldn't use the provided binaries. I finally got it installed in a amd64 compatible VM and it sets EFI secure as intended.

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.

Was this page helpful?
0 / 5 - 0 ratings