Unable to use "User Mode Debugger" in VS2013 on VirtualBox machine - visual-studio

Trying to configure Visual Studio 2013 (pro, FWIW) to debug a VirtualBox host. I followed this guide and set up the host correctly: It works for kernel mode, but not for user mode. Here is the debugger settings:
When I use kernel mode it works (and I'm debugging the kernel successfully):
But I cannot do it for user mode. I ran:
dbgsrv.exe -t tcp:port=53902
and saw that dbgsrv.exe actually runs, but still I get this:
Actually it makes sense, since I never specified the machine name/IP (where should I enter it?).
The firewall is off and the machine is accessible via network (files sharing).
So how to accomplish user-mode-debugging (Windows User Mode Debugger, not Remote)?

Ok, silly me... the "Computer name" must match the VirtualBox host name...

Related

How to do debugging with Vagrant virtual machines?

Before I started, I want to make it clear that the 'debugging' here I mean is for programming debugging, while not vagrant itself debugging.
We all know, Vagrant is great to maintain a solid devlopment evnrionment among a team, and also tons of benefits from it as stated all over Vagrantup.com.
My question is: For instance of python programming, how can I keep using my favorite debugging tools coming along with Pycharm on Windows, but the python dependencies are installed in the Vagrant virtual machines?
I can easily do the deployment and testing with Vagrant command line, but I still can not get the point of how to enhance the developing stage, especially debugging on the development machine (Windows here).
As you have quoted Python and PyCharm as the language and IDE, I will build on the same example. PyCharm supports a feature called Remote Debugging, but this is available only on the professional edition of pycharm. Pycharm has documentation on setting up of a remote debugger. I am quoting the answer from this SO Post. To consolidate the steps required
Upload & install remote debugging helper egg on the remote server that is to be debugged (vagrant machine)
Setup remote debug server run configuration: click on the drop-down run configuration menu, select Edit configurations, Click on the + button, choose Python remote debug.
set Local host name to your laptop's IP address, set port to any free port that you can use on your laptop (e.g. 8888)
Now follow the remaining instructions in that dialog box: copy-paste the import and pydevd.settrace(...) statements into your code, specifically where you want your code to "hit a breakpoint". This is basically the PyCharm equivalent of import pdb; pdb.set_trace(). Make sure the changed code is sync'ed to your server.
Hit the bug button (next to play; this starts the PyCharm debug server), and run your Python script just like you'd normally do, under whatever user, environment etc. When the breakpoint is hit, PyCharm should drop into debug mode.

Debug VMWare Process with Visual Studio: Login Failed

From a Windows7 host, I have a process running under a Windows10 VM from VMWare. Using Visual Studio 2013 and the VMWare remote debugging plugin, I want to attach to this process. When I try, I'm prompted for my Username and Password but after entering such, I get the error:
Login Failed. Authentication failure or insufficient permissions in
guest operating system.
The "Attach to Process" dialog has the correct "Running Virtual Machine" and associated "Virtual Machine Location". The "Remote Debug Monitor" is set to the path on the host of ...\Remote Debugger\x86\msvsmon.exe. The "Remote Debug Monitor Name" is set to "VMDebug".
My Win7 host is part of a domain but the Win10 guest is not. They have different passwords. I am able to do remote-debugging on a Win7 VM that is also on the domain. There I connect as "COMPANY\bcwhite" with my password that is the same as the host.
The first obvious question is: What is the correct "User name" because Win10 doesn't make this obvious? Is it "Brian White", "bcwhite", or "bcwhite#example.com"? Granted, I've tried all three and always get the same error.
The second question is: What other permissions could the guest operating system need? How do I get more information?

Getting Visual Studio debugging to work when running in Parallels

I've got a Windows 7 machine set up on Paralells.
Everything is working fine. Can access internet from IE or other browsers on my Parallels.
However, when trying to debug a web application in Visual Studio 2010 (by pressing F5 for example) then my default browser in OSX launches, which is great, with localhost:4243 (or whatever port Cassini has allocated on my vm)
Naturally, this doesn't find anything...
What do I need to do to either my parallels vm, or the settings on OSX to get debugging working? ie- my mac talking to the vm?
Make sure you are on the same network.
Use IIS.
Like so:
Your Win-machine has a name, let's say it's called "myWin7machine". Change "localhost:4243" to "myWin7machine:4243" in the browser.
If this doesn't work (well... it shouldn't) you might have the firewall on or the network not bridged. Let's start with the bridging.
Time to check some basics - be on the same network
Check your IP address. It's "ipconfig" on the Win machine and "ifconfig" on the mac; both run from the command prompt. The IP address should be something like 10.4.... or 192.168... on both. The important thing is that only the last number is different. (this is technically not correct but works for 99% of the cases) If they are equal (except the last) you are bridged - which means both machines are on the same network. If they differ too much you had running the Win machine's network "inside" the Mac's. Go to the settings for Parallels (in windows: move your mouse to the top to show Parallel's menu and go to Devices->Network and something "(bridged)". Wait until the balloons disappear and check ipconfig again.
Check that you can ping the Win machine from the Mac. Ping functionality might be turned off in the Win machine but probably isn't.
Now we know we are on the same network.
Still doesn't work
Can you do http://myWin7machine:4243 from the mac? Well.. you shouldn't be able to.
Can you do it from the Win machine? You should.
IIRC Cassini doesn't talk to strangers. I.e. it doesn't talk to anything but localhost.
If I am wrong - just open port 4243 in the firewall on the win machine and you should be good to go.
But otherwise...
Time to change web server.
Install IIS on the win machine.
In the Mac: surf to http://myWin7machine and see the IIS7 logo show.
If you don't you have a firewall issue. Open port 80. Try again.
If you have come this far then you can surf from the Mac to the IIS on the Win machine.
Time to set up your VS solution
Open the IIS admin GUI. Create a new Site. Let's say you call it MyTestSite. (you can always rename it later) Point it to your VS solution's web. Typically the same folder as web.config resides in. On the win machine: try surfing to "http://localhost/MyTestSite". Your site should show up. You might get an Apppool error.
Now try http://myWin7machine/MyTestSite on the Mac. It should work.
ROCK!
Time to set up debugging in VS
For debugging in IIS you have to connect to the process. In Win7 it requires elevated privileges so either you restart VS as admin or you try to connect and VS will do it for you.
The menu in VS is Debug->Attach to process and you choose w3wp.exe.
This is how you debug faster anyway - by connecting. Restarting your web for every debugging session is a waste of time.
To make connecting faster - use ctrl-alt-p and the continue with using the keyboard.
To make connecting even faster use a macro.
There is more info in these 4 articles: http://www.selfelected.com/tag/iis/
Set a breakpoint. Refresh your browser and the breakpoint should be hit.
Time to hack some code
Good luck!
I'm using Windows 10, VS 2015, Parallels 11 on iMac with OS X El Capitan (10.11.5). The following are the steps that worked for me:
On Windows side:
Get the IP (run ipconfig command in command window)
Get the host name (run hostname command in command window)
In control panel look for Windows Firewall -> Advanced Settings and add a new inbound rule and a new outbound rule. For both make sure you select Port, Allow Connection, TCP and specific IPs. I added a range of IPs 45000 - 45999 but you can select the range you like.
In Visual Studio:
Look for project properties and under web section change Server settings to look something like this.
Instead of "winmac" you will use the host name found in "Windows Side - Step 2". The port can be any number inside the range you setup for your firewall rules.
On Mac OS side:
Update /etc/hosts file. At the end of the file add the IP and host name that we found on steps 1 and 2 of the "Windows side" section. When you finish this step the file should like something similar to this.
Ready to debug:
Now you can start debugging in your Mac from Visual Studio. Make sure that before start the debugging process you select "Open In Mac" option (instead of Chrome or IE in your debugging options in visual studio).

Remote Debugger over internet (Remote IP machine)

My setup:
Local PC: x86 vista & visual studio
Client server: x64 server ( static ip ).
Currently I connect with it using Remote desktop. Remote Debugger is running as service and there is a user name with login as service privilege.
Can I configure remote debugger to this setup?
Guides, experiences will make my life little less of a hell. Thanks.
I had a similar problem, and like Hans Passant said above, a VPN is necessary. I was able to attach to the process and debug over the internet by doing the following:
Install the latest microsoft remote debugger on the server.
Install Hamachi on both my local machine and the server and connect so that I was on the same network.
Go to Debug->Attach To Process on my local machine's Visual studios and enter the Hamachi IP address of the server.
Pick "show processes from all users" and pick the process in question.
Note: I was logged in as the exact same user on both machines and had the same password on each.
I hope that helps someone out there.
There's no way to channel your debugger to work over Remote Desktop.
Check out How to: Set Up Remote Debugging, specifically the "Configuring the Windows Firewall" section. You will need make sure you can connect to the correct ports, which will require Software and/or Hardware firewall changes. A VPN could be part of the solution (as #Hans Passant suggested in his comment).
A simpler answer may be to install Visual Studio on a machine within the same network as where you're trying to debug. Then your debugger is making a local connection and you are still interacting with the remote network via Remote Desktop. I'm not sure if this is an option.
For me it just worked over a public ip address. Ensure Visual Studio remote tools will open firewall ports for all relevant networks when installing. Also ensure the connection target public IP address is written with the TCP port (the default for VS2019 is 4024) when listing processes.
No 3rd party apps needed!
(I advise to follow this tutorial, especially the bottom part titled "Set up the remote debugger"). However, to say shortly, after installing Remote Debugging Tools on remote machine, run it with administrator privilegges and then:
Open up Windows Firewall settings page
Click Advanced Settings and there will show up such window:
Click Inbound Rules->New Rule and choose on the following pages:
- [Rule Type] Custom
- [Program] Specific program (and choose : C:\Program Files\Visual Studio\Common7\IDE\Remote Debugger\x64\msvsmon.exe or whatever is your correct path, also note x86/x64 your desired route)
- [Protocol and Ports] Skip that page by clicking Next (or for maximum security, you can actually choose the exact port that Remote Debugger window is showing)
- [Scope] Choose in the second field (where it says Which REMOTE IP..) your current IP address
- [Action] Allow connection
- [Profile] Next
- [Name] whatever slug you want to identify, i.e. My rule for VS
The last step what you might need, is to set the Junction (hardlink) for folder on remote machine to correctly resolve the application files:
* When connecting with Remote-Desktop, share drive from Local Resources > More > Drives > C
* After you connect, on remote "My PC" there will appear your "mapped drive" and copy it's location (i.e. \\RobertoPC\). Then open CMD with admin privilegges and execute:
mklink /D C:\my_folder \\RobertoPC\C\my_folder
On your local PC C: drive create a folder my_folder and put the project into that folder, and run the project with remote debugging option:

Windows Virtual PC - Discarding Changes On Exit (Win7 Host)

I need Virtual PC (VPC) for testing my Visual Studio 2008/2010 applications, and I want to test and debug it using VPC running a clean install of WinXP (nothing else installed).
Back when I was running WinXP, I could launch a VPC session, do whatever I needed to (install my application, run it, debug scenarios, etc.), then exit without saving any of the changes to my virtual machine's hard drive.
There does not seem to be this option under Windows 7 - or, if there is, I have been unsuccessful in activating it.
Is there a way to make sure changes to my virtual machine are not saved?
Regards,
~Joe
This functionality is enabled by using 'undo disk(s)'. Check out this blog entry for info.

Resources