Packer / how to enable VTPM setting ?
-
I've been using ddelnano's excellent module to build templates using Packer and I'm nearly at a useful point. But the one thing that's missing, and I can't find an answer to, is how to enable VTPM so I can build Windows 11 templates.
Is there a way to do this in the plugin? How are other people automating the build of their Windows 11 templates right now?
Thanks.
-
question for @gduperrey
-
Hello,
Having never used Packer or Terraform, I can't answer quickly. From my research, I haven't found anything yet related to vTPM.
I've just asked our DevOps team about this so they can bring us more information on it or record it as a future evolution.
You can enable vTPM from Xen Orchestra or directly from the command line via
xe
, in XCP-ng 8.3:xe vtpm-create vm-uuid=<vm_uuid>
Several commands are also available for vTPM management:
vtpm-create - Create a VTPM associated with a VM vtpm-param-clear - Clears the specified parameter (param-name can be allowed operations) vtpm-destroy - Destroy a VTPM vtpm-param-get - Gets the specified parameter of the object vtpm-list - Lists all the vtpms, filtering on the optional arguments vtpm-param-list - Lists all the parameters of the object specified by the uuid
If you use a script to create your VMs, you should be able to enable vTPM immediately after creating them, before starting their installation.
-
@gduperrey We went 8.2 because we wanted to test XOSTOR. It sounds like our options are limited. Windows 10 mainstream support goes EOL in October which is what's driving this for us.
-
@davx8342 vTPM is not available in 8.2. You will not be able to use this option there.
However, Xostor is coming very soon to XCP-ng 8.3, as we announced in this blog post: https://xcp-ng.org/blog/2025/03/14/the-future-of-xcp-ng-lts/
Probably within one or two months. Indeed, we are doing everything possible to offer XCP-ng 8.3 as LTS, with Xostor, as soon as possible.
-
@gduperrey Got it, thank you for your assistance, this is super helpful.