Packer does not work on Ubuntu 21.10

I have packer working on with Ubuntu 20.04. But on Ubuntu 21.10, the text installer runs after cloud-init runs, no matter what I try. Does anyone know what runs the text installer? I looked at grub, and at Systemd. I understand that the installer is a snap, but I don’t see what kicks it during the first boot of the CD.

I have tried talking to ubuntu forums, the subiquity IRC, but no one seems to know what kicks off the text installer.

Does anyone know how to stop the installer from running?

I believe if you omit autoinstall from the boot command, you can disable the cloud-init/subiquity installation.

Can you describe in a bit more detail what you do want to happen? What is the desired workflow for you?

Sorry I am new to packer, so I probably did not explain very well.
I took Jeff Geerling’s repo geerlingguy/packer-boxes and wanted to replicate what I found to build my own vagrant boxes.

There are three challenges. Packer is moving to HCL and Ubuntu on servers is moving to Subiquity instead of using the pressed debian installer method. And finally I can’t find a process for creating and troubleshooting the boot_command

Using information I found on packer website and the converter I was able to create HCL templates that worked on Ubuntu server 20.04. I was next able to convert to using subiquity to run cloud-init.

The boot_command I used was:

boot_cmd = [" ",
“autoinstall ds=nocloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/”,
“”]

This built images I could upload to the vagrant web site.

Watching the VM boot while it was building I noticed that the vm would boot, run through cloud-init and then reboot.

On Server 21.10, the difference is that it always boots into the Ubuntu installer and then fails.

Looking through grub and systemd, (Both are a lot more complex these days than when I was playing around with them) I cannot find where the installer is kicked off or how cloud-init stopped the installer from running on 20.04.

My other frustrations is that everyone and their brother has a boot_command that is completely different, yet many work. I can’t find out from people the process of creating the boot_command, or anyway of trouble shooting it. I just know many different boot commands work but I don’t know why the work.

So what I am looking for is a way to run autoinstall without invoking the Ubuntu installer. I think it may be started by systemd, but I have yet to find out how or where or what causes it to only run on the first installation.

I am trying to run the autoinstall command instead of the Ubuntu installer. On 20.04 Autoinstall works and somehow bypasses the Ubuntu installer.

On 21.10 I use the same code, but no matter what I try the installer pops up, hangs the auto installation until packer halts and removes any artifacts created.

So I am trying to figure out what calls the Ubuntu installer.

With the boot command found in bento’s repository on github and the packer hcl2_upgrade command, packer can create boxes from Ubuntu 21.10

Here is the boot command:
boot_command = [
" ",
" ",
" “,
" “,
" “,
“c”,
“”,
“set gfxpayload=keep”,
“”,
“linux /casper/vmlinuz quiet”,
" autoinstall”,
" ds=nocloud-net”,
“\;s=http://”,
“{{.HTTPIP}}”,
“:{{.HTTPPort}}/”,
" —”,
“”,
“initrd /casper/initrd”,
“”,
“boot”
]

1 Like