SSH connection required?

26 views
Skip to first unread message

Danny Fournier

unread,
Jan 22, 2019, 6:16:29 PM1/22/19
to Packer
Is there a requirement to have an SSH connection being looked for during the build process? I've tried to change the communicator to none, however, the build process doesn't go very far without this.

My goal is to simply produce a VM with a static IP, accessible via SSH and with a known root password. The waiting for the SSH connection is always problematic.

Megan Marsh

unread,
Jan 22, 2019, 7:12:07 PM1/22/19
to packe...@googlegroups.com
Depending on the guest OS, you could also use WinRM or another communicator, but the vast majority of Packer provisioners require that you use a true communicator rather than "none"

Danny Fournier

unread,
Jan 22, 2019, 9:02:28 PM1/22/19
to Packer
I think I figured out my issue. BTW, this is for Ubuntu 16.04.5. I'm doing a virtualbox-iso.

By default, NAT is used for during the provisioning process. I had to change my configuration to reflect a local host instead of the configured static IP. Even the IP obtained when doing ifconfig didn't work.

Ultimately, it's the fact that I'm using root to connect to the new instance. By default, root cannot log into remotely. (PermitRootLogin is set to prohibit-password). I need to figure out a way to enable root during the preseed or something.

The goal is to get a vanilla VM that has a static IP and is accessible remotely by root over SSH. This is what my current VPS provider gives me and there's no way to change the final output for the plan that I have. I have existing Ansible scripts to automate the completion.

tek....@promobitech.com

unread,
Jan 22, 2019, 11:11:24 PM1/22/19
to Packer
Hello Danny,

You can define the SSH user in your preseed.cfg file and then you can use the ansible play book to enable the root user and can set password for root user using ansible.
Please refer the attached is the preseed.cfg file.
preseed.cfg.odt

Rickard von Essen

unread,
Jan 23, 2019, 3:14:38 AM1/23/19
to packe...@googlegroups.com
My goal is to simply produce a VM with a static IP, accessible via SSH and with a known root password. The waiting for the SSH connection is always problematic.

Using the none communicator is much mor complicated and using ssh with dhcp is a much simpler solution than any other. If you can provide your template, kickstart/preseed file, and scripts we can resolve any issue.

Regards,
Rickard

PS. For anyone struggling with "waiting for SSH" there is no single solution so it's best keeping things in each own thread. There are a myriad of problems that can cause this, networking, errors in kickstart/preseed, problems with your host, credential issues, etc to name a few. Start a new thread and post all files needed to reproduce the problem and explain what steps you have taken to troubleshoot the issue. 

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/c91456c6-a373-47fe-ba25-a980acf1b157%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages