My git repository is https://github.com/echeadle/packer-tpls.git In it is a folder that has server 2004. I has the preseed file and the user-data file. The folder started as a clone from geerlingguy/packer-boxes, but my goal is to change to the HCL2 packer templates. So it is a mix of the hcl2 files and the new way Ubuntu is doing things. You might check the boot_command. I have tried many others, but this one works. The 21.10 Ubuntu Server folder does not have a preseed file, because they are moving forward to using subiquity.
If you have a git repo maybe I could take a look. I can't promise anything, I am new to packer, and I have not studied the startup files of servers for several years, so I am just beginning investigating how grub and systemd start up a server. The biggest problem I am having is the boot_command. THere is no documetnation and no one ever explains the process they go through to build the boot_command. I get a lot of examples that don't work. But if you want to see ones that do work, the Bento github repository is a place that builds a lot of vagrant boxes automaticaly and it is where I found the boot_command that worked with 21.10. On Friday, February 4, 2022 at 1:33:13 AM UTC-7 [email protected] wrote: > Hi! > T tried to add early-commands and late-commands as you recommended but it > did no change behavior, it still freeze into 'Waiting for SSH to become > available...' My #cloud-config is created from manual install and yes I > have encrypted password. I have connected to build host with ssh and I > don't have X, so I need txt not graphical install and right now I don't see > anything that would be related to connection to install iso? > > Br, Jouni > > > tiistai 1. helmikuuta 2022 klo 2.06.25 UTC+2 [email protected] kirjoitti: > >> In your user-data file, do you have the early and late commands: >> #cloud config >> autoinstall: >> version: 1 >> early-commands: >> - sudo systemctl stop ssh >> >> >> At the bottom: >> >> late--commands: >> - sudo systemctl start ssh >> >> >> Also is the password encrypted? I use $mkpasswd --method=SHA-512 >> --rounds=4096 >> >> These are things I had to do in order to make the ssh connection. >> On Tuesday, January 25, 2022 at 3:20:33 AM UTC-7 [email protected] >> wrote: >> >>> Hi, I'm, trying this ubuntu.json >>> >>> { >>> "variables": { >>> "serial": "" >>> }, >>> >>> "builders": [ >>> { >>> "accelerator": "kvm", >>> "boot_command": [ >>> "", >>> "append console=ttyS0,115200n8 autoinstall >>> ds=no-cloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/user-data", >>> "initrd=casper/initrd ", >>> "kernel=casper/vmlinuz ", >>> "" >>> ], >>> "boot_wait": "10s", >>> "disk_interface": "virtio", >>> "disk_size": "50G", >>> "disk_cache": "none", >>> "disk_compression": true, >>> "headless": "true", >>> "use_default_display": false, >>> "format": "qcow2", >>> "http_directory": "./http", >>> "iso_checksum": >>> "sha256:f8e3086f3cea0fb3fefb29937ab5ed9d19e767079633960ccb50e76153effc98", >>> "iso_urls": [ >>> "/Scripts/ubuntu-20.04.3-live-server-amd64.iso" >>> ], >>> "name": "ubuntu-packer1", >>> "net_device": "virtio-net", >>> "output_directory": "output/ubuntu", >>> "shutdown_command": "shutdown -P now", >>> "ssh_handshake_attempts": "20", >>> "ssh_password": "ubuntu", >>> "ssh_timeout": "20m", >>> "ssh_username": "ubuntu", >>> "type": "qemu", >>> "cpus": "1", >>> "memory": "1024" >>> } >>> ], >>> "provisioners": [ >>> { >>> "inline": [ >>> "ls /" >>> ], >>> "type": "shell" >>> } >>> ] >>> } >>> >>> I'm connected to build host trough ssh without X, so no graphics. I get >>> this into packer.log: >>> 2022/01/25 11:28:02 packer-builder-qemu plugin: [INFO] Attempting SSH >>> connection to 127.0.0.1:3299... >>> 2022/01/25 11:28:02 packer-builder-qemu plugin: [DEBUG] reconnecting to >>> TCP connection for SSH >>> 2022/01/25 11:28:02 packer-builder-qemu plugin: [DEBUG] handshaking with >>> SSH >>> >>> But there's no ssh available, ssh does not respond from cmd line to >>> 127.0.0.1 -p 3299 either. Kickstart file was generated from manual install >>> I did earlier. I'm newbie with Packer so what I doing wrong here? >>> >>> Br, Jouni >>> >> -- 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/e1af1f2d-23ec-4954-9d3c-6582f50b8e67n%40googlegroups.com.
