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\Set-VMFirmware fails for hyperv-vmcx #11399

Closed
Kmdkca opened this issue Nov 16, 2021 · 2 comments
Closed

Hyper-V\Set-VMFirmware fails for hyperv-vmcx #11399

Kmdkca opened this issue Nov 16, 2021 · 2 comments

Comments

@Kmdkca
Copy link

Kmdkca commented Nov 16, 2021

Packer version 1.7.8 on WS2019

When using hyperv-vmcx to create a gen2 vm with secureboot it fails to set secureboot.

Cloning virtual machine... ==> hyperv-vmcx: Error setting secure boot: PowerShell error: Hyper-V\Set-VMFirmware : 'Win11US' failed to modify settings. ==> hyperv-vmcx: Cannot modify the secure boot template ID property. ==> hyperv-vmcx: 'Win11US' failed to modify settings. (Virtual machine ID DD4F3DCE-083F-4F7B-B2C7-53E45B2B67EC) ==> hyperv-vmcx: Cannot modify the secure boot template ID property after the virtual TPM is initialized. ==> hyperv-vmcx: At C:\Users\PackerAdmin\AppData\Local\Temp\2\powershell1563918022.ps1:6 char:2 ==> hyperv-vmcx: + Hyper-V\Set-VMFirmware -VMName $vmName -EnableSecureBoot $enableS ... ==> hyperv-vmcx: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ==> hyperv-vmcx: + CategoryInfo : NotSpecified: (:) [Set-VMFirmware], VirtualizationException ==> hyperv-vmcx: + FullyQualifiedErrorId : OperationFailed,Microsoft.HyperV.PowerShell.Commands.SetVMFirmware

I can manually run the command "set-vmfirmware Win11US -EnableSecureBoot on" without issues.
Also using the hyperv-iso is able to set it.

So how do i prevent this error?

@github-actions
Copy link

This issue has been migrated to hashicorp/packer-plugin-hyperv#49 due to the Packer Plugin split.

Please follow the new issue for updates.

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 17, 2021
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

2 participants