Can be a hassle, that’s why I’m writing this post for you:
First of all some prerequisites:
- VMware Workstation 7 (6.5 probably will be the same)
- A VM, XP / Vista / 7, whatever you want
- Visual Studio 2008 SP1
Second of all: VMware can be a little cryptic with it’s error messages so stay calm!
We start by having our sample application we want to run on the VM:
Next we click the wrench tool on the VMware toolbar in Visual Studio:
This opens the following dialog:
For your convenience I highlighted the settings you need to change.
The following order is not the order in the window, but the order that seems the most understandable in my opinion:
Virtual Machine: The VM you want to debug into, just select a suitable vmx.
Remote Debug Monitor Path: The path to Remote Debugger folder on the host computer NOT on the guest! So for 32-bit debugging that would be:
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x86\msvsmon.exe
Replace x86 with x64 if you require 64-bit debugging.
Shared Folders: This one is not used
Guest Command: The command to be executed on the guest to start the application. This one was quite the hassle for me. If you leave it on the standard it will result in the following (cryptic) error:
So instead of leaving it on default you enter this;
Please replace application.exe to the name of your executable!
The last item, Guest Logon Credentials, is the easiest. This should be the username and password you use to log in to the VM.
Next up is setting the shared folder between the guest and the host.
While I tried this with the Shared Folder Item in the window we just filled in, I just can’t seem to get it to work. So I bypassed this.
Go to the settings of the VM (in VMware Workstation –> VM –> Settings (CTRL+D)):
On the second tab, you take shared folders, and click add (as pointed on the picture).
On the wizard I would suggest opening the shared folder in the debug folder of your application and name the shared folder ‘test’
Enable the share in the following window, and make it read-write.
Now we can start the debugging from Visual Studio. The application will then be started through the shared folder we just created.