Changing Guest OS type in Packer-built template

Can someone give explicit advice on how exactly they set the guest OS id/type on a template after being built? I do not see how to do this manually in the vSphere/vCenter UI.

I need to change the type to “Other 64 bit” to enable Guest OS customization, as discussed here.

My template is created by Packer, using the vsphere-iso builder, and the guest_os_type parameter, which I’ve set to “OtherGuest64”.

During the packer build, I can see the machine’s “Guest OS” initially showing up in vSphere as “Other 64 bit”, but after the OS is installed (pre-seeded install from Debian 10 64 bit iso), the “Guest OS” changes to “Debian GNU/Linux 10 (64-bit)”.

Subsequent attempts to change the Guest OS type during cloning of this template, using the guest_id parameter of the vsphere_virtual_machine resource in the Terraform vsphere provider, result in errors essentially saying “can’t do that”:

Error: invalid guest ID “Other 64 bibt” for clone. Please set it to “debian10_64Guest”

So, back to my original question, how can I change the “Guest OS” in a vSphere template?? Manually or through Packer/Terraform/Ansible… Thanks!

OK, I see now that you cannot edit Guest OS type of a template directly (by design?), but I was able to:

  • convert the template to VM,
  • edit settings,
  • VM Options,
  • change Guest OS type to “Other Linux 64bit”, then
  • convert back to template.

and my subsequent Terraform plan which clones the template, and provides a customization, and was then successful, hostname changed and everything.

I’m still interested in how to do this with Packer or Terraform… Perhaps I have to post-process the built template?