cirruslabs / packer-plugin-tart

Packer builder for Tart VMs
https://developer.hashicorp.com/packer/plugins/builders/tart
Mozilla Public License 2.0
64 stars 16 forks source link

Packer SSH shell provisioner not triggering? #73

Open HariSekhon opened 1 year ago

HariSekhon commented 1 year ago

It appears that the SSH shell provisioner isn't triggering on my Fedora build on Tart which is almost identical to my build on x86_64 VirtualBox.

You can reproduce this like so

git clone https://github.com/HariSekhon/Packer-templates pack

cd pack

make fedora-tart-http

The output is:

...
Fedora ISOs prepared
pkill -9 -if -- '.*python.* -m http.server'
cd installers && python3 -m http.server &
packer build --force fedora-38-arm64.tart.http.pkr.hcl
Serving HTTP on :: port 8000 (http://[::]:8000/) ...
fedora-38.tart-cli.fedora-38: output will be in this color.

==> fedora-38.tart-cli.fedora-38: Creating virtual machine...
==> fedora-38.tart-cli.fedora-38: Starting the virtual machine for installation...
==> fedora-38.tart-cli.fedora-38: Waiting for the VNC server credentials from Tart...
==> fedora-38.tart-cli.fedora-38: Retrieved VNC credentials, connecting...
==> fedora-38.tart-cli.fedora-38: Connected to the VNC!
==> fedora-38.tart-cli.fedora-38: Typing the commands over VNC...
==> fedora-38.tart-cli.fedora-38: Waiting for the install process to shutdown the VM...

The Fedora prompt is up but the SSH provisioner never triggers, as verified by logging in and checking that the /etc/packer-version file created by my script never materializes, and the VM never shuts down to complete the build.

Those last 2 lines of the output are what makes me think that the SSH commands are not being run as when I got to tty2 to investigate there was no /etc/packer-version created by script and I can't see a hanging bash command it in the ps output (although it doesn't help that I have | pipe symbol to be able to less through the ps output).

HariSekhon commented 1 year ago

I've found this same issue on a Debian build - the OS installs and boots up so you can see the login prompt on the console, but packer never SSH's in for the shell provisioner to finish the build and then close down to write out the ova.

make debian-tart-http