virtualbox-iso - can not ssh into installed VM (packer version 1.1.2) on Debian 8.0

88 views
Skip to first unread message

ravi...@gmail.com

unread,
Dec 16, 2017, 7:29:51 AM12/16/17
to Packer
Hi,

I'm using packer 1.1.2 and i'm trying to export VM as 'OVA' using 'virtualbox-iso' on debian 8.0. VM comes up with static IP but communicator as 'ssh' can not access and it gives out the 'SSH Timed out'
If set IP of the installed ISO to dhcp then system generates the 'OVA' successfully.

I've also made sure that host machine can access the the subnet in which VM having the static IP comes up. On the network, i can ping the hosts which have the same subnet as installed VM has, but it is not somehow possible to access the installed VM even manually after packer installed it and wait for it for SSH communication and ultimately fails.

Does somebody knows what is wrong?

Thank you in advance
Regards
Ravi

Alvaro Miranda Aguilera

unread,
Dec 16, 2017, 7:42:38 AM12/16/17
to packe...@googlegroups.com
hello

packer + vmware usually will do the nat network for os installation. this network need to have dhcp enabled to work

if you are using a different network, can you share your packer template?

can you share an screenshot of the network settings when the VM is on ?

Thanks
Alvaro.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/833c561d-902c-4bd9-8926-cba90a6050d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Message has been deleted

Rickard von Essen

unread,
Dec 16, 2017, 8:31:36 AM12/16/17
to packe...@googlegroups.com
You probably just have to set the IP in ssh_host, see https://www.packer.io/docs/templates/communicator.html#ssh_host

On Dec 16, 2017 14:29, <ravi...@gmail.com> wrote:
Hi Alvaro, 

Thanks for quick response, I've attached the 'myproduct.json'. VM comes up with IP 172.15.0.40 (private IP) and I can ping other hosts in this network in this subnet from the host where packer is running. Strange thing is if make the ISO with dhcp enabled IP then OVA is exported successfully.

Regards
Ravi

On Saturday, December 16, 2017 at 6:12:38 PM UTC+5:30, Alvaro Miranda Aguilera wrote:
hello

packer + vmware usually will do the nat network for os installation. this network need to have dhcp enabled to work

if you are using a different network, can you share your packer template?

can you share an screenshot of the network settings when the VM is on ?

Thanks
Alvaro.
On Sat, Dec 16, 2017 at 1:29 PM, <ravi...@gmail.com> wrote:
Hi,

I'm using packer 1.1.2 and i'm trying to export VM as 'OVA' using 'virtualbox-iso' on debian 8.0. VM comes up with static IP but communicator as 'ssh' can not access and it gives out the 'SSH Timed out'
If set IP of the installed ISO to dhcp then system generates the 'OVA' successfully.

I've also made sure that host machine can access the the subnet in which VM having the static IP comes up. On the network, i can ping the hosts which have the same subnet as installed VM has, but it is not somehow possible to access the installed VM even manually after packer installed it and wait for it for SSH communication and ultimately fails.

Does somebody knows what is wrong?

Thank you in advance
Regards
Ravi

--
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.



--
Alvaro

--
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+unsubscribe@googlegroups.com.

ravi...@gmail.com

unread,
Dec 16, 2017, 8:35:27 AM12/16/17
to Packer
Hi Alvaro,

Thanks for quick response, i've attached the JSON template. VM comes up with IP 172.15.0.40 (static IP), and host running the packer can access the machines in this subnet but packer can not access this running VM. Strange thing is if I build the ISO with dhcp enabled then packer exports the OVA successfully.

Regards
Ravi.


On Saturday, December 16, 2017 at 6:12:38 PM UTC+5:30, Alvaro Miranda Aguilera wrote:
hello

packer + vmware usually will do the nat network for os installation. this network need to have dhcp enabled to work

if you are using a different network, can you share your packer template?

can you share an screenshot of the network settings when the VM is on ?

Thanks
Alvaro.
On Sat, Dec 16, 2017 at 1:29 PM, <ravi...@gmail.com> wrote:
Hi,

I'm using packer 1.1.2 and i'm trying to export VM as 'OVA' using 'virtualbox-iso' on debian 8.0. VM comes up with static IP but communicator as 'ssh' can not access and it gives out the 'SSH Timed out'
If set IP of the installed ISO to dhcp then system generates the 'OVA' successfully.

I've also made sure that host machine can access the the subnet in which VM having the static IP comes up. On the network, i can ping the hosts which have the same subnet as installed VM has, but it is not somehow possible to access the installed VM even manually after packer installed it and wait for it for SSH communication and ultimately fails.

Does somebody knows what is wrong?

Thank you in advance
Regards
Ravi

--
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.



--
Alvaro

myproduct.json

ravi...@gmail.com

unread,
Dec 16, 2017, 8:40:10 AM12/16/17
to Packer
Hi Rickard

I've tried to set ssh_host with IP but unfortunately it does not work. thank you

Regards

Gabo Kete

unread,
Dec 16, 2017, 2:15:34 PM12/16/17
to Packer
Have you checked whether you do not have a firewall between your host and your VMware VM? Most of the time if you can reach the VM is either

- Firewall
- Not valid route from the host to the VMware IP address

ravi...@gmail.com

unread,
Dec 18, 2017, 5:10:29 AM12/18/17
to Packer
Hi Gabo

There is a firewall on VM side when it is up, but after VM is started, i disable it at runtime but even after disabling the firewall it does not connect to Virtual Box VM.

Regards
Ravi

Gabo Kete

unread,
Dec 18, 2017, 5:59:49 AM12/18/17
to Packer
As Alvaro stated you might need to provide more information around your settings.. also share the packer logs, but with Debug Mode ON.... 

ravi...@gmail.com

unread,
Dec 19, 2017, 12:48:41 AM12/19/17
to Packer
Thanks Gabo, sure I will provide the logs as well network settings information which i've missed thank you.

ravi...@gmail.com

unread,
Dec 20, 2017, 5:45:22 AM12/20/17
to Packer
Hi Gabo,

After adding one more NIC card and putting it on DCHP, now bi-directional ping (gest to host and host to guest) is possible, but still i'm surprised it is not able to ssh into guest VM. i'm getting the following message 

2017/12/20 14:54:35 packer: 2017/12/20 14:54:35 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 172.15.0.40:3521: getsockopt: connection refused
2017/12/20 14:54:40 packer: 2017/12/20 14:54:40 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 172.15.0.40:3521: getsockopt: connection refused
2017/12/20 14:54:45 packer: 2017/12/20 14:54:45 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 172.15.0.40:3521: getsockopt: connection refused
2017/12/20 14:54:50 packer: 2017/12/20 14:54:50 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 172.15.0.40:3521: getsockopt: connection refused
2017/12/20 14:54:55 packer: 2017/12/20 14:54:55 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 172.15.0.40:3521: getsockopt: connection refused
2017/12/20 14:55:00 packer: 2017/12/20 14:55:00 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 172.15.0.40:3521: getsockopt: connection refused
2017/12/20 14:55:05 packer: 2017/12/20 14:55:05 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 172.15.0.40:3521: getsockopt: connection refused
2017/12/20 14:55:10 packer: 2017/12/20 14:55:10 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 172.15.0.40:3521: getsockopt: connection refused
2017/12/20 14:55:15 packer: 2017/12/20 14:55:15 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 172.15.0.40:3521: getsockopt: connection refused
2017/12/20 14:55:20 packer: 2017/12/20 14:55:20 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 172.15.0.40:3521: getsockopt: connection refused
2017/12/20 14:55:25 packer: 2017/12/20 14:55:25 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 172.15.0.40:3521: getsockopt: connection refused
2017/12/20 14:55:30 packer: 2017/12/20 14:55:30 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 172.15.0.40:3521: getsockopt: connection refused

Do you know why it is giving connection refused?

Thank you!
Regards
Ravi.

Gabo Kete

unread,
Dec 20, 2017, 6:12:24 PM12/20/17
to Packer
The way you are describing the issue sound like something is blocking the ssh connection... Most likely a firewall, is the port on the ssh server listening on the default port?... try to telnet the ssh port and check the ssh configuration.. But mainly check in the guest of you have a firewall configured and running...
Reply all
Reply to author
Forward
0 new messages