user4266661
user4266661

Reputation:

Remote Debugging on a Virtual Windows Machine

I am trying to debug an app, using Visual Studio 2017, that I will run on a virtual machine I've set up on my development system. The virtual machine runs Windows 10 (as does my development system).

I've installed the latest VS 2017 Remote Tools package on the virtual machine, and configured it. It is happily running on the virtual machine...but I can't connect to it from the desktop system.

When I do an attach to process, and a Find to find the system, the virtual machine is found.

However, after selecting the virtual machine, I am prompted for credentials. I've tried using the same login credentials I use to log onto the virtual machine, but that doesn't work. And there's no information shown as to what might be the problem.

The virtual machine is running under Hyper-V.

How do I go about setting up a remote debugging connection to virtual machine running on the same system where I am running VS 2017?

Upvotes: 5

Views: 3370

Answers (1)

Joe Schrag
Joe Schrag

Reputation: 865

I ran into the same issue and managed to get it working, after much effort.

First, try switching the debugger authentication mode to "No Authentication" (Tools -> Options) and setting your project in Visual Studio to match (see the language-specific links in the MS docs link below). That will help you determine if it is a credential issue or something else.

The microsoft docs say, "You can run the remote debugger under a user account that differs from the user account you are using on the Visual Studio computer, but you must add the different user account to the remote debugger's permissions."

In my case, I ran the same account on both machines AND added my account to the debugger's permissions, and it still didn't work. We use Azure AD, and I was using a domain account. My VS computer was on the domain, and the VM was not (even though I could sign in with a domain account). After adding the VM to the domain, I could connect with "Windows Authentication" enabled in the debugger settings.

Upvotes: 0

Related Questions