1
votes

I want to debug an application running on machine2 from a Visual Studio 2017 running on machine1. I can only connect to machine2 via ssh. The ssh connection from machine1 to machine2 works fine.

On machine2, I run Visual Studio 2017 Remote Debugger, port number 4022, "No authentication" and "Allow any user to debug".

Port number might be 4023, since machine2 is a 64 bit windows running a 32 bit application: https://docs.microsoft.com/en-us/visualstudio/debugger/remote-debugger-port-assignments?view=vs-2017 But I'm not sure because I don't know how to check if the remote debugger is 32 or 64.

I created an ssh tunnel by running this command on machine1:

ssh -L 4022:localhost:4022 machine2user@machine2IP

(How to create more than one tunnel? is the tunnel both ways?)

On machine1 Visual Studio project settings I set remote debugger to "Remote (no authentication)" and target to localhost:4022.

settings

I can see that in machine2 remote debugger, the machine1user connects. In machine1 visual studio I can see the processes running on machine2.

But when I try to attach to my exe process, I get:

error message

Firewall rules on machine1 allow any ssh traffic and 4022,4023 traffic. Firewall rules on machine2 were automatically set by remote debugger installation.

How can I make Visual Studio on machine1 listen to remote debugger traffic coming from machine2? (I'm guessing that might be the problem).

I already checked similar questions here and none were of help.

1

1 Answers

0
votes

I solved it by creating the tunnel with port 4023:

ssh -L 4023:localhost:4023 machine2user@machine2IP