locked
Access denied when trying to debug remotely RRS feed

  • Question

  • Hello all,

    I'm trying to remotely debug a Visual Basic .NET project on a machine on my local network but have been having problems. Here is what I have attempted to do so far:

    1 - Build the source code on my host machine.
    2 - Copy the contents of the Release folder from my source machine to a shared location on the remote machine, which will include the PDB file for the exe
    3 - Ran the Remote Debugger Configuration Wizard on the remote machine, ensuring that the debugger is run as an application and that the Windows Firewall has been setup correctly (although I actually have Kaspersky installed with the Windows Firewall disabled).
    4 - Ran the Remote Debugger on the remote machine using Windows Authentication
    5 - Ran my application on the remote machine
    5 - On Visual Studio 2008 on the host machine, selected Tools -> Attach to Process. Ensured that the Transport method is set to Default. In the Qualifier text box, I entered the server name which was displayed by the Remote Debugger on the remote machine (username@COMPUTERNAME). I then hit enter and I get the following message:

    Unable to connect to Microsoft Visual Studio Debugging Monitor named 'username@COMPUTERNAME'. Access is denied.

    I have tried the following to resolve the problem:
    1 - Disabled Kaspersky Internet Security
    2 - Ensured that both accounts on the remote and local machines are using the same username and password
    3 - I have tried to set up the debugger to use no authentication. On the host machine I have chosen the Remote Transport and entered the computer name of the remote machine in the qualifier and have successfully retrieved a list of processes running on the remote machine. However, this option doesn't give me source code debugging of the remote process. As I understand it, 'No Authentication' is only used for native processes anyway, and I am attempting to debug a Visual Basic .NET application. Incidentally, this works the same regardless of whether Kaspersky is enabled or disabled.

    I have Windows 7 Ultimate x64 installed on the host computer and Windows 7 Ultimate x86 installed on the remote computer. Both computers are part of the same network workgroup.

    Any ideas?

    Thanks,

    --Amr
    Sunday, December 27, 2009 1:48 PM

Answers

All replies

  • ____ Amr,

    Please open Remote debugger monitor and go to Tools -> Permissions and grant the user's permission to Allow Debug.

    Best regards


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!
    Monday, December 28, 2009 5:20 AM
  • Hi Roahn,

    Thanks for your reply. Unfortunately, both users in the list have their Allow Debug checkbox ticked. There is also a 'Special Permissions' entry, but that is greyed out.

    --Amr
    Monday, December 28, 2009 10:52 AM
  • Hi Amr,

    Special Permission refers to other permissions on files and folders, but here we just need the Debug permission [it is greyed out].

    Have you tried disable Kaspersky protection and maually configure Windows Firewall for remote deubgging?
    Have you grant the user on both sides the Administrator's privilege?

    I have tested with Win7 [32bit] and Windows Server 2008 [64bit] and it's OK. Here are the detailed steps (I have an account of Administrator's privilege on both machines and they have the same username and password):

     1. Build a Console application in my Win7 machine [32bit] (set the Debug mode to X86 in the configuration manager)
     2. Copy the whole X86 folder (C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x86) to my remote machine (Win Server 2008)
     3. Run the msvsmon.exe in the folder on the remote machine
     4. Copy our whole program (.exe and .pdb file) to the remote machine and run it there
     5. Click Tools -> Attach to process and enter the server name to the Qulifier box (set Transport to Default) and then click Attach button
    Would you please have a try and tell me the result?

    For a video tutorial on remote debugging, please click the following link:
    http://www.microsoft.com/uk/msdn/screencasts/screencast/313/Visual-Studio-2008-Remote-Debugging-with-MSVSMONEXE.aspx

    Best regards
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!
    Tuesday, December 29, 2009 7:57 AM
  • Hi Roahn,

    Thanks for your reply - unfortunately, still no luck. I disabled Kaspersky and enabled the Windows Firewall. I went through the Remote Debugger Configuration Wizard and allowed it to setup the Windows Firewall to allow remote debugging. I went through the process you outlined above, got some more Windows Firewall Configuration messages which I allowed and still no dice. Once again, I disabled all the firewalls on the computer but I've still had no luck.

    I've tried running the Remote Debugger and Visual Studio as Administrator and I've also enabled Remote Access to ANONYMOUS LOGIN through Component Services->My Computer->COM Security.

    Just to recap, host computer has Windows 7 Ultimate x64 and Visual Studio Professional 2008 installed. The remote computer also has Visual Studio Professional 2008 installed and Windows 7 Ultimate x86. The computers are not on a domain and are on the same workgroup. Each computer is logged on using their own individual accounts, but these accounts have the same username and password. I can connect to the debugger on the remote computer if I select the Native option, regardless of whether my firewalls are enabled or disabled, but since I want to debug a managed application, this is not useful for me.

    --Amr
    Tuesday, December 29, 2009 11:29 AM
  • Hello Amr,

    How about if we remote debug it in another machine, say, a Vista machine or a XP? Remote debugging should work in various scenarios, including:
     .Two domains without two-way trust 
     .Two computers on a workgroup
     .One computer on a workgroup, and the other on a domain
     .Running the Remote debugging monitor (msvsmon) or Visual Studio as a local account
    To isolate the issue, please try on another machine.

    Hope the following Remote Debugging Permission is helpful to you:
    http://msdn.microsoft.com/en-us/library/z3bxds0s.aspx

    Best regards
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!
    Wednesday, December 30, 2009 7:01 AM
  • Hi Roahn Luo,

    I've run the Remote Debugger on a Windows XP machine and I'm pleased to say that I was able to successfully source-debug a managed project from the Windows 7 machine. The only reason why I can't just use that machine for remote debugging is that my original remote target is a tablet PC and I am trying to develop a tablet application.

    I guess the mission now is to determine what security settings I need on my tablet to allow the main computer to connect to the debugger.

    --Amr
    Wednesday, December 30, 2009 11:50 AM
  • Hi,

    You can also try the following steps:

    1.       VS box: net user <your_alias> <your_password> /add

    2.       Target box: net user <your_alias> <your_password> /add

    3.       Target box: net localgroup administrators <computer_name>\<your_alias> /add

    4.       Target box: runas /user:<computer_name>\<your_alias> <path_to_msvsmon>

    5.       VS box: enter <your_alias>@<target_computer_name> (instead of just the target computer name)

     

    Hope that this helps,

    Alina

     

    Wednesday, December 30, 2009 10:51 PM
  • Hi Alina,

    I've tried following your steps but I am still getting the same "Access Denied" error.

    On both computers, running 'net user' brings up the following:

    User accounts for \\AMR
    
    -------------------------------------------------------------------------------
    Administrator            Amr Bekhit               Guest     
    The user 'Amr Bekhit' does have administrative privelages and both accounts have the same password on both computers. The host computer is called AMR and the remote computer is called AMRTABLET.

    I tried following your steps by adding a new user called 'debug' with the password 'debug' as follows:

    1. Host:
      net user debug debug /add
    2. Remote:
      net user debug debug /add
    3. Remote:
      net localgroup administrators AMR\debug /add
       - This failed to work. However, if I ran
      net localgroup administrators debug /add
      this works fine.
    4. Remote:
      runas /user:AMR\debug msvsmon.exe
      This started the remote debugger and created a server called debug@AMRTABLET.
    5. Host: I ran the "Attach to process" command in Visual Studio and tried connecting to "debug@AMRTABLET", but was denied access.
    --Amr
    Friday, January 1, 2010 2:39 PM
  • Any ideas on this?
    Tuesday, January 5, 2010 10:29 PM
  • Hi Amr,

    Can you double-check that both VS on the local machine and VS Remote Debugging Monitor on the remote machine are running as Administrator and are running by the same user? (If it is a local user, the username should be the same on both machines, and the passwords have to be identical as well.)

    Have you disabled Kaspersky on both machines or just on the remote machine? The firewall needs to be configured properly on both machines, it may need to be done manually. Please refer to documentation for details such as the ports that need to be open: http://msdn.microsoft.com/en-us/library/bt727f1t.aspx 

    Hope this helps.
    Dmitri.



    Dmitri Leonov. VS Debugger
    Wednesday, January 6, 2010 12:13 AM
  • Hi Dmitri,

    Thanks for your reply.

    I have tried using the "Run as Admininstrator" option for Visual Studio on the host machine and the Remote Debugger on the remote machine, but with no success. When the Remote Debugger is launched, it creates the server "Amr Bekhit@AMRTABLET". The user "Amr Bekhit" has administrative privelages on both computers and shares the same password. I don't know if this makes any difference, but I did not have a password for the user "Amr Bekhit" on the host machine before installing Visual Studio. It is only after trying and failing to remote debug and doing some research did I add a password.

    When testing, I disabled Kaspersky and the Windows firewall on BOTH machines, but without success. When testing the remote debugger with an XP machine as the remote computer, I had Kaspersky running on both machines (Windows firewall disabled) and the debug was carried out successfully. This makes me think that the issue is not blocked ports, and more a permissions issue with Windows 7. Am I correct in assuming that if the problem was due to ports being blocked then disabling the Windows firewall would have solved the problem?

    Very frustrating!

    --Amr
    Thursday, January 7, 2010 11:04 PM
  • Hello Amr,

    Do I understand correctly that you are logged on as some other user and use the runas command? In that case you do not get elevated permissions. Please log on as the local user on both machines, and run both devenv and msvsmon with elevated permissions. Also, you can configure the firewall on the VS machine (instead of disabling it completely) by running remote debugging configuration wizard.

    Hope this helps.

    Dmitri.
    Dmitri Leonov. VS Debugger
    Thursday, January 21, 2010 6:48 PM
  • Hi Dmitri,

    Thanks for your reply. Both machines have just one user (Amr Bekhit) and they are both using the same password. I have also tried removing the password on both computers. I only tried the runas command following Alina's suggestion in her earlier post. I have tried running both msvsmon and devenv as administrator, but this has not solved the problem. I have also tried running the configuration wizard on both computers without success.

    I have a question. Looking at the Permissions for Remote Debugging dialog in msvsmon on the remote machine, it says that two users are allowed to Debug: Amr Bekhit (AMRTABLET\Amr Bekhit) and Administrators (AMRTABLET\Administrators). However, although the username on my host machine is the same (Amr Bekhit), it's always referred to as AMR\Amr Bekhit in other security dialogs in Windows. Could it be this difference in the name that's causing the issue? Then again, for the full names were to be indentical, they would need to have identical network names, which I would guess would not be allowed.

    --Amr
    • Edited by Amr Bekhit Sunday, January 24, 2010 6:06 PM Adding some additional information
    Sunday, January 24, 2010 6:05 PM
  • Seeing as this problem does not intend to resolve itself any time soon, I was wondering if any of you experts would be willing to take part in a remote assistance session to help diagnose the problem?
    Wednesday, February 3, 2010 9:29 PM
  • Hi Amr,

    Do you still get the "Access Denied" error? What is the exact error message that you get?
    Have you verified the firewall settings on both machines?
    http://msdn.microsoft.com/en-us/library/bb385831.aspx
    One thing that can be missing is File and Printer sharing on the remote machine should open the following ports: TCP 139, TCP 445, UDP 137, and UDP 138.

    Please open a Connect bug and let me know the bug ID so we can take this communication offline.
    For that please visit

    https://connect.microsoft.com/VisualStudio/content/content.aspx?ContentID=14651

    Thanks,
    Dmitri.

    Dmitri Leonov. VS Debugger
    • Marked as answer by Dmitri Leonov Monday, April 5, 2010 10:44 PM
    Saturday, March 13, 2010 1:46 AM
  • Of course, it would be nice if you discussed any resolution of this problem online so those of us encountering the same issue might get some ideas on how to resolve it.

    I'm having essentially the same problem: Host machine = Windows 7 64-bit, Target machine = Windows 7 32-bit. Trying to attach to a process on the target machine gives the following error:

    Unable to connect to the Microsoft Visual Studio Remote Debugging Monitor named 'FOO'. Access is denied.

    Nothing else, no other useful information and so far nothing I've found on the web has actually addressed this issue.

    So, I too would like to see a resolution to this.

    Doug Harber

    Tuesday, August 31, 2010 8:01 PM
  • Hi Douglas,

    Unfortunately, I never managed to solve this problem and gave up on it a while ago. I would be certainly be interested to hear if you fare any better.

    --Amr

    Tuesday, August 31, 2010 10:43 PM
  • Hi Amr,

    Special Permission refers to other permissions on files and folders, but here we just need the Debug permission [it is greyed out].

    Have you tried disable Kaspersky protection and maually configure Windows Firewall for remote deubgging?
    Have you grant the user on both sides the Administrator's privilege?

    I have tested with Win7 [32bit] and Windows Server 2008 [64bit] and it's OK. Here are the detailed steps (I have an account of Administrator's privilege on both machines and they have the same username and password):

    1. Build a Console application in my Win7 machine [32bit] (set the Debug mode to X86 in the configuration manager)
    2. Copy the whole X86 folder (C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x86) to my remote machine (Win Server 2008)
    3. Run the msvsmon.exe in the folder on the remote machine
    4. Copy our whole program (.exe and .pdb file) to the remote machine and run it there
    5. Click Tools -> Attach to process and enter the server name to the Qulifier box (set Transport to Default) and then click Attach button
    Would you please have a try and tell me the result?

    For a video tutorial on remote debugging, please click the following link:
    http://www.microsoft.com/uk/msdn/screencasts/screencast/313/Visual-Studio-2008-Remote-Debugging-with-MSVSMONEXE.aspx

    Best regards
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!

    Thanks for your effort! Now I got it.
    Tuesday, January 25, 2011 10:51 PM
  • I've just spent a couple of days with the same remote debug issues after migrating from Visual Studio 2005 on an XP Pro host, to Visual Studio 2010 on a Win7 Pro Host. The target machine is the same for both hosts, and runs POSReady 2009.

    Remote debug under 2005 was running fine, the problems started with 2010, and were as described above - Unable to connect .... access denied etc, whilst the remote debug monitor showed a connection had been made?

    After much googling, firewall tweaking, creation of matching "debugUser" accounts etc, I've just found the solution to my problems - the DNS settings on the target machine.

    The target machine has a manually configured IP / DNS which hasn't changed in a long time, but our domain DNS settings have recently changed, and the target machine hadn't been updated. Both hosts (XP & 7) had the updated DNS settings, but not the target, and yet the XP/2005 host continued to be able to remote debug, whilst the Win 7/2010 host was consistently unable to connect.

    As soon as the target DNS settings were corrected, all the connection problems disappeared for the Win 7 / 2010 host which now works as expected, so now I can get back to the usual set of problems :)

    Hope that points someone in the right direction.

    Andy

    Tuesday, May 24, 2011 9:36 AM
  • Hi Amr...

    I've got the same PCs config of yours (I have Windows 7 Ultimate x64 installed on the host computer and Windows 7 Ultimate x86 installed on the remote computer. Both computers are part of the same network workgroup....).

    I'm facing the same frustrating issue of 'access denied'...have you fixed it?

     

    Thanks

    Fulvio

     

    Wednesday, December 28, 2011 9:44 PM
  • Hi guys...it's me once again!

    I found out the trik!!!

    Just get a glance guys at this post:

     http://blog.bugrapostaci.com/2010/04/08/remote-debugging-access-denied-visual-studio-2008/   
    
    
    The problems was that my client attempted to log on with uncorrect credentials (stored in windows credentials...likely some home user credentials issue...)

    Then I did remove stored networks passwords for specific targets in my client computer by

    Control Panel->User Accounts->manage your networks passwords

    After that i retried to put the server name my msvsmon.exe created in the qualifier of vs2008 "attach to process" window and...

    all my remote processe just popped up...immediately!!

    Honestly i was thinking to give up since I spent all the day yesterday  trying to fix this staff...i went to sleep and this morning...the miracle...

    It's allways the same story...don't be stubborn upon a thing, just be patient , maybe take a nap over and once you wake up you make it!! ;) 

    So guys I hope this could help

    Fulvio

     






    • Edited by Fuvix Thursday, December 29, 2011 9:25 AM
    • Proposed as answer by BrianPa Thursday, October 4, 2012 2:09 PM
    • Unproposed as answer by BrianPa Thursday, October 4, 2012 2:09 PM
    Thursday, December 29, 2011 9:17 AM
  • I know this thread is a little old, But as I had this problem and Found a solution for myself I am going to post it here.

    I was receiving the access is denied message and found the reason was in the Qualifier field I was simply selecting the name of the computer I was connecting to.    It turns out that you need to type in the qualifier as the server name listed on debugging monitor, which means the browse button would not work, in my case the name of the qualifier was 'DOMAIN\USERNAME@Computername.  The username was the user that started the instance of the debugging monitor.

    Thursday, October 4, 2012 2:12 PM