This morning I tried to debug some Mono code in a Ubuntu 13.10 Saucy virtual machine that doesn’t have all the developer tools installed. Miguel de Icaza recently blogged about remote debugging, but it took a bit of fiddling to get it working. Here are my findings:
In the VM start your application with
mono --debug --debugger-agent="address=220.127.116.11:10000,transport=dt_socket,server=y" \ /full/path/to/mono-application.exe
The IP address is the address of the VM, transport is a required argument, dt_socket seems to be the only allowed option. It is important to specify the full path to your managed application otherwise you’ll get an error that the application can’t be found.
Then on your developer machine set the environment variable MONODEVELOP_SDB_TEST and start MonoDevelop:
export MONODEVELOP_SDB_TEST=1 monodevelop-4.0
This adds a new menu item that allows to start a remote debugging session, under Run -> Run With -> Custom Command Mono Soft Debugger. This opens a dialog window; enter the IP address of your VM (18.104.22.168) and the port (10000) and start the session with the Connect button. This starts the application in the VM. Debugging works the same as if you would start the app locally. Great!