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

echeadle, I too have struggled to find the right boot command with Ubuntu22.04/subiquity. I’m glad you got one that worked, but your syntax is failing for me. Can you please repost your boot command? Thanks

For some reason I cannot sign into the hashicorp site. It tells me my name has been taken, it has, by me.
boot_cmd = [
" “,
" ”,
" “,
" ”,
" “,
“c”,
“”,
“set gfxpayload=keep”,
“”,
“linux /casper/vmlinuz quiet”,
" autoinstall”,
" ds=nocloud-net“,
“\;s=http://”,
“{{.HTTPIP}}”,
“:{{.HTTPPort}}/”,
" —”,
“”,
“initrd /casper/initrd”,
“”,
“boot”]

Is the boot command I am using now. I have a repo on github. echeadle/packer-tpls if you want to see everything I have done.

It has been a long time since I posted the original message, so i don’t remember why it is different than the one you first saw.

I don’t have time at the moment to look at the code or figure out why I can’t sign into hashicorp. If the code works, feel free to post it. I have not played much with the code, since I got it working. I am retired and am working on learning docker-compose at the moment.

Good luck. The bento repository is a great repository to for these kinds of issues.

Thank you so much for getting back!! I will check out your github repo

I see you have many boot strings in packer-tpls/bootcmds.txt , so unsure which to use. I think I’ve tried most of those combinations anyway.