Re: [packer] Error waiting for SSH: handshake failed

3,191 views
Skip to first unread message

Mitchell Hashimoto

unread,
Jul 18, 2013, 10:06:00 PM7/18/13
to packe...@googlegroups.com
Jimmy,

Did your preseed file set up SSH? Run with PACKER_LOG=1 to see what it
is doing, as well. But from the error, it just looks like your SSH
credentials didn't work.

Best,
Mitchell

On Thu, Jul 18, 2013 at 6:49 PM, Jimmy Cuadra <jimmy...@gmail.com> wrote:
> I'm working on building a VMware Fusion image with Packer, and getting stuck
> after the system has been installed. VMware Fusion shows this:
> http://cl.ly/image/1v39383t2L2V
>
> Back in the shell, Packer is sitting at this:
>
> ==> vmware: Waiting for SSH to become available...
>
> I can log in to the system with the vagrant user as defined in my
> preseed.cfg file, but Packer doesn't see the system as being ready.
> Eventually it times out with:
>
> ==> vmware: Error waiting for SSH: handshake failed: ssh: unable to
> authenticate, attempted methods [none password], no supported methods remain
>
> What should I do to make Packer see the system as installed and ready for
> SSH connections? Thanks!
>
> --
> 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 packer-tool...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Rohit Kothari

unread,
Jun 16, 2014, 12:58:49 PM6/16/14
to packe...@googlegroups.com
Hi,

I assume you must have solved this problem as of now.

I am a beginner user of packer and vagrant, and have been trying to create different images using Packer.

Currently, I am facing the exact same problem that you mentioned in this post. Can someone please help me what needs to be done?

By the way, following are the specific details you might need to know:
- Trying VMware Workstation for virtualization.
- The ks file (kickstart) for centOS 6.5 does not get retrieved somehow (not even from an HTTP location) - this is a different issue I am facing.
- Since the ks file does not get retrieved, I go through the manual steps of installing centOS.
- Installation of centOS is successful, while the 'Packer-console' is still waiting for ssh and ultimately ends up erasing the vm that it just created and configured.

This might sound a basic problem, but any help would really be appreciated.

Thanks.

Alvaro Miranda Aguilera

unread,
Jun 16, 2014, 7:07:11 PM6/16/14
to packe...@googlegroups.com
what is your packer template file
and after the install, did you reboot the centos guest?

Alvaro


For more options, visit https://groups.google.com/d/optout.

Alvaro Miranda Aguilera

unread,
Jun 16, 2014, 7:07:20 PM6/16/14
to packe...@googlegroups.com
also attack the kickstart file

Rohit Kothari

unread,
Jun 16, 2014, 7:21:51 PM6/16/14
to packe...@googlegroups.com
Yes, I rebooted the centos guest but no effect to the packer cmd which still waits for ssh. 

//This is my packer template file:-

{
  
  "builders": [
    {
      "type": "vmware-iso",
  "iso_url": "iso/CentOS-6.5-x86_64-bin-DVD1.iso",
  "iso_checksum": "83221db52687c7b857e65bfe60787838",
  "iso_checksum_type": "md5",
  "http_directory": "http",
  "http_port_min" : 9001,
  "http_port_max" : 9001,

  "ssh_username": "vagrant",
        "ssh_password": "vagrant",

"ssh_wait_timeout": "10000s",
        "shutdown_command": "echo 'vagrant'|sudo -S /sbin/halt -h -p",

        "boot_command": [
       "<tab> text ks=http://{{ .HTTPIP }}:{{ .HTTPPort}}/ks.cfg<enter>"
        ],
     
        "vm_name": "packer-centos-6.5-x86_64"
      
    }
  ],


  "post-processors": [
    {
      "output": "builds/vmware-centos65.box",
      "type": "vagrant"
    }
  ]
}

//It fails to retrieve the kickstart file from the location it calculates from {http}..line.
//This is the ks.cfg file that is located in 'http' folder, which is placed at a location where my packer template is:-

install
cdrom
lang en_US.UTF-8
keyboard us
unsupported_hardware
network --bootproto=dhcp
rootpw --iscrypted vagrant
firewall --disabled
authconfig --enableshadow --passalgo=sha512
selinux --permissive
timezone UTC
bootloader --location=mbr
text
skipx
zerombr
clearpart --all --initlabel
autopart
auth  --useshadow  --enablemd5
firstboot --disabled
reboot

%packages --ignoremissing
@Base
@Core
@Development Tools
openssl-devel
readline-devel
zlib-devel
kernel-devel

Alvaro Miranda Aguilera

unread,
Jun 16, 2014, 10:20:30 PM6/16/14
to packe...@googlegroups.com

On Tue, Jun 17, 2014 at 11:21 AM, Rohit Kothari <rohiet...@gmail.com> wrote:
"boot_command": [
       "<tab> text ks=http://{{ .HTTPIP }}:{{ .HTTPPort}}/ks.cfg<enter>"
        ],

It fail to take the kickstart file? can you try these 2 things.

1. add more ports

        "http_port_min" : 9001,
   "http_port_max" : 9003,

2.
     "boot_command" : [
            "<tab>",
            " text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks.cfg ",
            "<enter>"
        ]

If you can provide an screenshot of what error you see, that will help a lot to see what is failing.. nothing wrong at this moment..

Rohit Kothari

unread,
Jun 17, 2014, 4:55:39 PM6/17/14
to packe...@googlegroups.com


I tried this change, but it still fails to retrieve the ks file.
After I install guest OS manually, the VM gets booted up with guest OS installed, I shut down the guest OS, still the packer is waiting for ssh...and ultimately times out deleting the VM.
Here is the screenshot for ks file:

Alvaro Miranda Aguilera

unread,
Jun 18, 2014, 10:57:46 PM6/18/14
to packe...@googlegroups.com
can you open that url from your desktop? (when the vm fails to read from there)

does the nic looks connected in the vm?





Reply all
Reply to author
Forward
0 new messages