opened
cc12258
username_0
I'm hoping you can help me troubleshoot this issue, I've been stuck at this same point and can't see how to fix it. When bringing up the VM I am getting stuck at the ssh forwarding. I see the port setup and listening on the target node. However when trying to ssh to the port it times out. It appears that it may be having trouble with the port forward. 

Here are some logs:

2017-10-24T14:22:02.622-0600 [DEBUG] plugin.terraform-provider-proxmox: 2017/10/24 14:22:02 handshake error: ssh: handshake failed: read tcp xxxxx:52843-> xxxxx:22115: read: connection reset by peer
2017-10-24T14:22:04.626-0600 [DEBUG] plugin.terraform-provider-proxmox: 2017/10/24 14:22:04 opening new ssh session
2017-10-24T14:22:04.626-0600 [DEBUG] plugin.terraform-provider-proxmox: 2017/10/24 14:22:04 ssh session open error: 'client not available', attempting reconnect
2017-10-24T14:22:04.626-0600 [DEBUG] plugin.terraform-provider-proxmox: 2017/10/24 14:22:04 connecting to TCP connection for SSH
2017-10-24T14:22:04.657-0600 [DEBUG] plugin.terraform-provider-proxmox: 2017/10/24 14:22:04 handshaking with SSH

That repeats and then eventually times out. I'm not sure how to troubleshoot this, is there a command in proxmox to see how the usernet is configured? I see this command in the API code:

netdev_add user,id=net1,hostfwd=tcp::"+sshPort+"-:22

So assuming that is forwarding to the host somehow, but I'd like to see that forward config so I can further troubleshoot. It seems to be forwarding to the wrong place potentially.
Struggling with SSHForward
issue
created
ggongaware
username_1
The ssh port selected is always 22000 + the vmID number, in your case it was vm ID 115 made an sshPort forward at 22115.

Perhaps there's iptables or something blocking these ports?
comment
created
cc12258
username_0
I checked iptables and no it's allowing everything both on the guest and the target node.

Is there some way to see how that port forward is configured? I see that the target node is listening on port 22115. I just don't know where that port forward is actually going.
comment
created
ggongaware
username_1
When I run sometime like: 
```bash
netstat -lnp | grep 22115
```

I see that the port is tied to the qemu process that runs the vm. 

If you open a VNC console to that VM, you should see that eth1 has an IP address that routes through the mini qemu NAT network.
comment
created
cc12258
username_0
When I check eth1 on the VM it shows that it's down. Do I need to preseed that interface config for DHCP in the template?
comment
created
ggongaware
username_1
Yes, that temporary little qemu network on eth1 works well as dhcp.
comment
created
cc12258
username_0
Looks like adding this to /etc/network/interfaces in the template fixed it:

``
comment
closed
cc12258
username_0
issue