Remote Debugger over internet (Remote IP machine)

Viewed 11087

My setup: Local PC: x86 vista & visual studio Client server: x64 server ( static ip ).

Currently I connect with it using Remote desktop. Remote Debugger is running as service and there is a user name with login as service privilege.

Can I configure remote debugger to this setup?

Guides, experiences will make my life little less of a hell. Thanks.

4 Answers

For me it just worked over a public ip address. Ensure Visual Studio remote tools will open firewall ports for all relevant networks when installing. Also ensure the connection target public IP address is written with the TCP port (the default for VS2019 is 4024) when listing processes.

enter image description here

No 3rd party apps needed!

(I advise to follow this tutorial, especially the bottom part titled "Set up the remote debugger"). However, to say shortly, after installing Remote Debugging Tools on remote machine, run it with administrator privilegges and then:

  • Open up Windows Firewall settings page

  • Click Advanced Settings and there will show up such window: enter image description here

  • Click Inbound Rules->New Rule and choose on the following pages:
    - [Rule Type] Custom
    - [Program] Specific program (and choose : C:\Program Files\Visual Studio\Common7\IDE\Remote Debugger\x64\msvsmon.exe or whatever is your correct path, also note x86/x64 your desired route)
    - [Protocol and Ports] Skip that page by clicking Next (or for maximum security, you can actually choose the exact port that Remote Debugger window is showing)
    - [Scope] Choose in the second field (where it says Which REMOTE IP..) your current IP address
    - [Action] Allow connection
    - [Profile] Next
    - [Name] whatever slug you want to identify, i.e. My rule for VS

  • The last step what you might need, is to set the Junction (hardlink) for folder on remote machine to correctly resolve the application files:
    * When connecting with Remote-Desktop, share drive from Local Resources > More > Drives > C
    * After you connect, on remote "My PC" there will appear your "mapped drive" and copy it's location (i.e. \\RobertoPC\). Then open CMD with admin privilegges and execute:

    mklink /D C:\my_folder \\RobertoPC\C\my_folder

  • On your local PC C: drive create a folder my_folder and put the project into that folder, and run the project with remote debugging option:

enter image description here

Related