Okay, apparently I'll answer my own question: it turns out, Packer does not provide any way to detect GUI changes at all. Instead the workflow is having inside the array of keypresses a special keypress that looks like `<waitXX>`, where XX means seconds to wait (and it also allows prefixes like wait77ms, there are docs on that).
So yeah, it is a pretty brittle workflow, having to rely on timeouts that may change for one reason or another… But apparently there's no other way. Some docs on waitXX and friends can be found here https://developer.hashicorp.com/packer/integrations/hashicorp/virtualbox/latest/components/builder/iso#boot-configuration and other examples both in JSON and HCL2 formats may be found in this Ubuntu thread https://discuss.hashicorp.com/t/packer-ubuntu-20-04-autoinstall-via-cd-drive/18999/10 On Wednesday, 8 November 2023 at 12:31:41 UTC+3 Constantine K wrote: > I have an installation `.iso` for a custom system and I want to use Packer > to install it over to a VM. From what I read this is done by writing a > "builder" component, but at that point I'm stuck. I can't find any complete > examples of creating a builder that manually clicks all the installation > buttons and does not use JSON (which is obsolete in Packer). > > Actually: how does Packer even determine when the menu it expects appeared > so it's ready to "click"? Are there any description on that one? This > question is the reason I can't transform JSON examples to HCL2. I see > people write a bunch of keypresses inside JSON config, but how does Packer > not flush everything in the first second as the VM starts booting? > > Any links, to docs or blog posts that would explain that are really > appreciated. I don't care what hypervisor it's for: whether it's for > VirtualBox or QEMU or VMWare or Parallels or ESXi or Proxmox… Doesn't > matter. > -- This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list. GitHub Issues: https://github.com/hashicorp/packer/issues IRC: #packer-tool on Freenode --- You received this message because you are subscribed to the Google Groups "Packer" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/c60df060-4270-496f-8860-21690e3feeb7n%40googlegroups.com.
