Introduction
The idea here, is to run the remote debugger (msvcmon) on the Virtual Machine (VM), using a local admin account.
On the client side, we will impersonate the same account, by having a local account with same password.
We will use this 'impersonating' account to run Visual Studio, and so we will have permission to access the remote debugger on the VM.
This is simpler than trying to impersonate a domain level account (your VM is usually not on the domain).
note: we assume that the VM is already connected to the network, but is not actually on the domain - this is a common case where you create your own VM and cannot add it to the office domain.
0. On the VM: When installing Visual Studio Remote Debugger
When you install the remote debugger, the Remote Debugger Wizard will launch.
You need to set these settings to be ON:
Select the checkbox "Run the Visual Studio 2005 remote Debugger service".
Select 'Allow any computer to connect to the remote debugger'.
1. On the VM:
take note of the administrator account that you use to run the remote debug tool (msvcmon)
note: to add/view users:
- Select Start button.
- Select Control Panel
- Select Performance And Maintenance
- Select Administrative Tools
- Select Computer Management
- Select Local Users and Groups
see screen shot:
2. On the VM:
- install the Visual Studio 2005 remote debugger.
- start up the remote debug tool (msvcmon).
- Select Tools | Options
- Set the Server name to be (localAccountName)
@(vmHostName)
for example: bwclient@seanryanvm1
3. On the client that will run Visual Studio:
- Create a new local user, with same name + password as the VM account.
- Clear the checkbox 'User must change password at next logon'
- Set the check box 'Password never expires'
see screenshot:
4. On the client that will run Visual Studio:
make sure that the DNS lookup for your VM hostname is working ok.
make sure that the DNS lookup for your VM hostname is working ok.
From command line using: ping (vmHostName).
If the DNS lookup returns the wrong address, then you can add an entry to your Windows hosts file.
In Explorer, browse to this location: C:\WINDOWS\system32\drivers\etc
In Explorer, browse to this location: C:\WINDOWS\system32\drivers\etc
- Select the hosts file.
- Press CTRL+C
- Press CTRL+V
- Right click on the hosts file.
- Select Send To -> Notepad.
- In Notepad, add an entry for your VM.
For example:
10.1.3.3 seanryanvm1
- Select File | Save
- Exit Notepad.
5. On the client that will run visual Studio:
Run Visual Studio, under the local account that matches the VM account.
To do this:
In the command prompt, use the following line to run Visual Studio:
To do this:
- Select Start | All Programs | Microsoft Visual Studio 2005 | Visual Studio Tools | Visual Studio Command Prompt
In the command prompt, use the following line to run Visual Studio:
runas /user:bwclient devenv
- You will be prompted for the password.
- Visual Studio will start.
- In Visual Studio, select menu Tools | Attach to Process....
- Set Transport to be Default
- Set Qualifier to be (localAccountName)
@(vmHostName)
for example: bwclient@seanryanvm1
- Press ENTER.
The processes on the VM should show up in the Available Processes list.
You can now attach to the remote C++ or .NET processes as you wish.
cheers Javin
ReplyDeleteyour Eclipse guide is useful