Published on

Cross Domain Visual Studio 2010 Remote Debugging

Authors
  • avatar
    Name
    Jac Timms
    Twitter

Some software I wrote a while ago had a feature break on a single machine, so I needed to remotely debug it today. I have VPN access but my development VM isn't a member of their domain, which causes an authentication error when you try to connect to the remote machine. To remedy this you need to complete a few steps.

Prepare The Remote Computer

If you haven't done already, download and install the Microsoft Visual Studio 2010 Remote Debugger on the remote machine.

You'll also need an account with administrator permissions on the remote machine, so if you don't have a domain admin account, you'll need to make your domain user an administrator on the remote machine (which you can do in Control Panel > Users > Add).

Log onto the remote machine as your user and make sure the Visual Studio 10 Remote Debugger service is started in services.msc, then fire up the Visual Studio Remote Debugging Monitor (on Windows XP this is at C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\Remote Debugger\x86\msvsmon.exe) and it should say something like "Msvsmon started a new server named 'my-domain\user@computer', note down the last part.

Setting Up Your Development Computer

My dev VM is Windows 7, so that is what I'll detail here. Firstly, if you can't ping the remote machine name because it won't resolve you'll need to add an entry with it's IP to your hosts file (C:\windows\System32\drivers\etc\hosts).

Go to the Control Panel > User Accounts and Family Safety > Credential Manager. This can also be accessed via the Run dialog from the start menu and entering "Control Userpasswords2". Select the Advanced tab and select Manage Passwords.

Click Add a Windows credential and enter the name of the remote computer that you took from Msvsmon. Enter your username including the domain, such as 'my-domain\user' and your password.

An easy way to test if this works is to browse the remote computer in Windows Explorer. If you're not prompted for a username and password the saved credentials are working.

You can now connect to the remote machine in Visual Studio by entering it's name in the Attach To Process dialog.

That should be it and now you should be able to attach to any process on the remote machine. I hope that helps.