TCP connection to SSH ip/port failed: connection refused

1,342 views
Skip to first unread message

Jimmy Cuadra

unread,
Jul 12, 2013, 1:45:06 PM7/12/13
to packe...@googlegroups.com
Hello,

I'm trying out Packer for the first time by building an Ubuntu VMware image. Packer seems to get stuck trying to SSH into the machine. I'm not sure what I'm doing wrong. Here is a Gist that shows the template I'm using and the output of building it with the log on: https://gist.github.com/jimmycuadra/5986294 Any ideas would be appreciated. Thanks!

Jimmy

Mitchell Hashimoto

unread,
Jul 12, 2013, 7:26:21 PM7/12/13
to packe...@googlegroups.com
Jimmy,

As you watch the installation, does it install properly? Is your
preseed.cfg configured to install SSH and configure it with the
settings you specified in your template? Have you tried SSHing
manually to verify it works? etc.

Best,
Mitchell
> --
> 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.
>
>

Jimmy Cuadra

unread,
Jul 13, 2013, 5:31:04 AM7/13/13
to packe...@googlegroups.com
I tried it without headless mode on, and it eventually got stuck on this:


Looks like my preseed will not work. I took it from the code block shown at the bottom of http://www.packer.io/docs/builders/vmware.html. Are the boot commands shown there incorrect somehow? Thanks for your help.

Jack Pearkes

unread,
Jul 13, 2013, 5:54:56 AM7/13/13
to packe...@googlegroups.com
Jimmy,

What is the value of your "http_directory" configuration? Make sure your preseed.cfg is inside of that directory. 

For example, in your packer template:

"http_directory": "http",

And the directory:

$ ls
packer-template.json http/
$ ls http/
preseed.cfg

See the explanation of "http_directory" here: http://www.packer.io/docs/builders/vmware.html

Best,

Jack

Jimmy Cuadra

unread,
Jul 15, 2013, 10:29:10 PM7/15/13
to packe...@googlegroups.com
I don't actually have a preseed.cfg file, which I guess is the problem. I thought the "boot_command" was used as the kickstart script itself, but now I'm seeing this on the Packer docs:

    This example is not functional. It will start the OS installer but then fail because we don't provide the preseed file for Ubuntu to self-install.

Where's the best place to get a kickstart script for this purpose? I guess I could use one from veewee.

Josiah Truasheim

unread,
Jul 15, 2013, 10:42:15 PM7/15/13
to packe...@googlegroups.com
Hi Jimmy,

I just finished building my own preseed.cfg for Ubuntu 13.04, but there's a few for other Debian OSes.


It will setup a Ubuntu 13.04 VM appropriately for vagrant.

-- Josiah

Jimmy Cuadra

unread,
Jul 18, 2013, 5:06:56 AM7/18/13
to packe...@googlegroups.com
Thanks for sharing! I'm trying to build Ubuntu 12.04. I've tried with both the kickstart script from veewee and with yours and get stuck in different places on each. My Linux knowledge is not good enough to really figure this out, I'm afraid. I think I'm gonna wait until a collection of full working examples is released to build from.

J

Dan Lovell

unread,
Sep 14, 2013, 9:18:59 PM9/14/13
to packe...@googlegroups.com
This gist contains a config that works for me (as of 2013-09-14) and utilizes Josiah's preseed.cfg gist

For those trying to figure out what was wrong: (as of 2013-09-14) the information in http://www.packer.io/docs/builders/vmware.html is not sufficient to create a working vmware config.  In particular
  • iso_url doesn't exist
  • the default preseed file does not exist
  • the shutdown command will not work: requires sudo or possibly an appropriate preseed file
  • ssh_password is left blank: requires setting or possibly an appropriate preseed file

Mitchell Hashimoto

unread,
Sep 15, 2013, 1:14:04 PM9/15/13
to packe...@googlegroups.com
The example on that page clearly states: "This example is not functional." :) 

Dan Lovell

unread,
Sep 15, 2013, 1:31:35 PM9/15/13
to packe...@googlegroups.com

I saw that at the top it says

This example is not functional. It will start the OS installer but then fail because we don't provide the preseed file for Ubuntu to self-install

But then at the bottom it says

Example boot command. This is actually a working boot command used to start an Ubuntu 12.04 installer:

Which I interpreted as meaning that by adding the boot_command, it would work.

Ethan S.

unread,
Mar 19, 2015, 3:29:17 PM3/19/15
to packe...@googlegroups.com
Dan, the bottom example would be working but there is a pull request in place to correct the key presses, they should be surrounded by < > not &lt; and &gt;. The bottom example will work assuming that the parser used to generate the packer/vagrant sites isn't malfunctioning and still spitting out the wrong info.
Reply all
Reply to author
Forward
0 new messages