6

Anyone have already this issue with packer build ?

Waiting for SSH to become available...
[INFO] Attempting SSH connection...
reconnecting to TCP connection for SSH
handshaking with SSH
handshake error: ssh: handshake failed: read tcp 127.0.0.1:49663->127.0.0.1:3278: wsarecv: Une connexion existante a dû être fermée par l’hôte distant.
[DEBUG] SSH handshake err: ssh: handshake failed: read tcp 127.0.0.1:49663->127.0.0.1:3278: wsarecv: Une connexion existante a dû être fermée par l’hôte distant.

My packer build run correctly but the step to connect with ssh is very long (10min).

Have you a idea for resolve this ?

PS : the "space" character in log is not my fault, this is just the result of -debug packer build. Perhaps open another stackoverflow issue for resolve this.

miltone
  • 4,416
  • 11
  • 42
  • 76
  • Which Packer builder are you using? Is it VirtualBox? – Patrick Lee Dec 31 '15 at 17:51
  • Ok, `virtualbox-iso` or `virtualbox-ovf`? And what is the guest OS you're installing? – Patrick Lee Jan 05 '16 at 14:49
  • virtualbox-iso and OS Host : windows 7 pro OS Guest : Ubuntu 14.04 LTS VM technology : VirtualBox 5.0.10 + Vagrant 1.7.4 VM tools builder : Packer 0.8.6 – miltone Jan 05 '16 at 14:53
  • Ok, so Vagrant is your post-processor, right? I've used Packer's virtualbox-iso builder with Ubuntu 14.04 to make Vagrant base boxes and worked through all sorts of little problems, so I'm sure we can get your build working. Could you edit your question to include the OS, builder, and post-processor info? I also recommend adding `virtualbox`, `vagrant`, and `ubuntu-14.04` tags. – Patrick Lee Jan 05 '16 at 15:34
  • So the Packer build is working, but SSH times out on a provisioner? Could you include your Packer file in the question? – Patrick Lee Jan 05 '16 at 15:36

1 Answers1

0

I have a similar setup (Ubuntu, Windows 7, virtualbox-iso). My scripts include a file below that's called in the provisioners block. Lacking these may be a cause of the slowness

#!/bin/sh -x

echo "UseDNS no" >> /etc/ssh/sshd_config;
echo "GSSAPIAuthentication no" >> /etc/ssh/sshd_config;

It's also possible that the 10 minute wait is just other stuff happening in the background that you can't see. If you can post a link to your scripts and/or tell me how long the entire build process takes that might provide additional context

Jay Dorsey
  • 3,563
  • 2
  • 18
  • 24