VMware Workstation - Timeout waiting for SSH even though I can ssh in using Putty

402 views
Skip to first unread message

kryptoof...@gmail.com

unread,
Jul 17, 2017, 1:26:52 PM7/17/17
to Packer
Hi, 

I am on a windows 7 laptop, and I am trying to build a Ubuntu 16.04 image using the vmware-vmx builder. I have VMware workstation installed on my laptop. Whenever I run packer build command, it copies the vmx and spins up a VM, but it fails to build the image because it times out waiting for ssh to be available. What's really weird is that while its waiting for ssh to be available, I can use Putty to ssh into the VM. Can someone please help? 
I have openssh installed on the Ubuntu VM, and I configured to run at startup using 'sudo systemctl enable ssh
I have configured the VM for a bridged network connection. Below is my ubuntu.json file and command output

{
"builders": [
{
"type": "vmware-vmx",
"source_path": "path/to/UbuntuPackerTest.vmx",
"vm_name": "packerTest",
"ssh_username": "packeradmin",
"ssh_password": "password",
"ssh_timeout": "10m",
"shutdown_command": "shutdown -P now",
}
],
"provisioners": [
                {
                        "type": "shell",
                        "execute_command": "touch Hi.txt",
                        "scripts": [
                                "script.sh"
                        ]
                }
        ]
}
  
>packer build ubuntu.json
vmware-vmx output will be in this color.

==> vmware-vmx: Cloning source VM...
==> vmware-vmx: Starting virtual machine...
==> vmware-vmx: Waiting 10s for boot...
==> vmware-vmx: Connecting to VM via VNC
==> vmware-vmx: Typing the boot command over VNC...
==> vmware-vmx: Waiting for SSH to become available...
 

Rickard von Essen

unread,
Jul 17, 2017, 1:56:54 PM7/17/17
to packe...@googlegroups.com
If you attach the output of running PACKER_LOG=1 packer build template.json there might be some hints on what's going wrong. 

--
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/369c3df6-b653-4056-8223-e655ab35b520%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

kryptoof...@gmail.com

unread,
Jul 17, 2017, 2:46:06 PM7/17/17
to Packer
Here you go. Thanks

Lookup up IP information...
DHCP leases path: C:/ProgramData/VMware/vmnetdhcp.leases
IP lookup failed: IP not found for MAC in DHCP leases at C:/ProgramData/VMware/vmnetdhcp.leases
[DEBUG] Error getting SSH address: IP lookup failed: IP not found for MAC in DHCP leases at C:/ProgramData/VMware/vmnetdhcp.leases
]==> vmware-vmx: Timeout waiting for SSH.
Executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe [-T ws list]
[DEBUG] SSH wait cancelled. Exiting loop.

Rickard von Essen

unread,
Jul 17, 2017, 2:51:36 PM7/17/17
to packe...@googlegroups.com
How does your VM get its IP address? When you ssh with putty which IP do you access and how did you find that out? 

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

kryptoof...@gmail.com

unread,
Jul 17, 2017, 3:01:27 PM7/17/17
to Packer
I'm not sure how it gets an IP address yet, I'll have to figure that out later. RIght now, for Putty, I find the IP address by logging into the VM from workstation and running ifconfig. 

Rickard von Essen

unread,
Jul 17, 2017, 3:09:59 PM7/17/17
to packe...@googlegroups.com
If it's a static IP define it in the template with ssh_host. 

On Jul 17, 2017 21:01, <kryptoof...@gmail.com> wrote:
I'm not sure how it gets an IP address yet, I'll have to figure that out later. RIght now, for Putty, I find the IP address by logging into the VM from workstation and running ifconfig. 

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

Stuart Luscombe

unread,
Jul 18, 2017, 1:39:18 AM7/18/17
to Packer, kryptoof...@gmail.com
Similar to the issue I had with Hyper-V, do VMWare-based VMs require the guest tools to be installed for Packer to communicate?

Rickard von Essen

unread,
Jul 18, 2017, 1:43:54 AM7/18/17
to packe...@googlegroups.com, kryptoof...@gmail.com
No it doesn't. But it uses the mac address of the NIC to look it up in its internal dhcp server, so if you are not using dhcp you have to specify the IP address in ssh_host.

(I think Hyperv is the only one that requires installing guest tools)

// Rickard 

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

Dan Linder

unread,
Jul 18, 2017, 8:39:55 AM7/18/17
to Packer, kryptoof...@gmail.com
I'm shooting in the dark here too, but is it possible that the DHCP response is coming from the external router and not from VMware Workstation itself?

And I can confirm that VMware Tools aren't necessary for the initial build using Packer.

Dan


On Tuesday, July 18, 2017 at 12:43:54 AM UTC-5, Rickard von Essen wrote:
No it doesn't. But it uses the mac address of the NIC to look it up in its internal dhcp server, so if you are not using dhcp you have to specify the IP address in ssh_host.

(I think Hyperv is the only one that requires installing guest tools)

// Rickard 
On Jul 18, 2017 07:39, "Stuart Luscombe" <stuart....@gmail.com> wrote:
Similar to the issue I had with Hyper-V, do VMWare-based VMs require the guest tools to be installed for Packer to communicate?

On Monday, 17 July 2017 19:46:06 UTC+1, kryptoof...@gmail.com wrote:
Here you go. Thanks

Lookup up IP information...
DHCP leases path: C:/ProgramData/VMware/vmnetdhcp.leases
IP lookup failed: IP not found for MAC in DHCP leases at C:/ProgramData/VMware/vmnetdhcp.leases
[DEBUG] Error getting SSH address: IP lookup failed: IP not found for MAC in DHCP leases at C:/ProgramData/VMware/vmnetdhcp.leases
]==> vmware-vmx: Timeout waiting for SSH.
Executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe [-T ws list]
[DEBUG] SSH wait cancelled. Exiting loop.

--
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.
Reply all
Reply to author
Forward
0 new messages