If I start packer and don't touch the VirtualBox window that opens (let GRUB timeout), then the timing ends up being off for the boot commands.
The first boot command (shown below), ends up not being run and only the .packer_http bit is executed, which then causes the third boot command to fail and SSH bombs out:
If i intervene during boot and hit enter at the GRUB screen (before 10 second timeout) the build goes perfectly. This seems less than ideal if the goal is to automate this, but then again this could just be my machine being slow.
Could you bump the boot_wait attribute up by an extra 10 seconds?
Full build logs below:
+$ packer build nixos-x86_64.json
virtualbox-iso output will be in this color.
==> virtualbox-iso: Downloading or copying ISO
virtualbox-iso: Downloading or copying: https://d3g5gsiof5omrk.cloudfront.net/nixos/17.09/nixos-17.09.1462.07ca7b64d2/nixos-minimal-17.09.1462.07ca7b64d2-x86_64-linux.iso
==> virtualbox-iso: Starting HTTP server on port 8180
==> virtualbox-iso: Creating virtual machine...
==> virtualbox-iso: Creating hard drive...
==> virtualbox-iso: Creating forwarded port mapping for communicator (SSH, WinRM, etc) (host port 3387)
==> virtualbox-iso: Executing custom VBoxManage commands...
virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1516842047 --memory 1024
==> virtualbox-iso: Starting the virtual machine...
==> virtualbox-iso: Waiting 30s for boot...
==> virtualbox-iso: Typing the boot command...
==> virtualbox-iso: Waiting for SSH to become available...
==> virtualbox-iso: Error waiting for SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [publickey none password keyboard-interactive], no supported methods remain
==> virtualbox-iso: Unregistering and deleting virtual machine...
==> virtualbox-iso: Deleting output directory...
Build 'virtualbox-iso' errored: ssh: handshake failed: ssh: unable to authenticate, attempted methods [publickey none password keyboard-interactive], no supported methods remain
==> Some builds didn't complete successfully and had errors:
--> virtualbox-iso: ssh: handshake failed: ssh: unable to authenticate, attempted methods [publickey none password keyboard-interactive], no supported methods remain
==> Builds finished but no artifacts were created.
+$
If I start packer and don't touch the VirtualBox window that opens (let GRUB timeout), then the timing ends up being off for the boot commands.
The first boot command (shown below), ends up not being run and only the
.packer_http
bit is executed, which then causes the third boot command to fail and SSH bombs out:echo http://{{ .HTTPIP }}:{{ .HTTPPort}} > .packer_http
If i intervene during boot and hit enter at the GRUB screen (before 10 second timeout) the build goes perfectly. This seems less than ideal if the goal is to automate this, but then again this could just be my machine being slow.
Could you bump the boot_wait attribute up by an extra 10 seconds?
Full build logs below: