The Vagrant environment has xdebug installed. In order to get it working, you need to do a few things on your IDE.
Set up the server:
Set up the Remote debug in the configuration section:
At this point, XDebug will begin to work. However, you will get a path mapping error. In order to resolve this, enter the path /var/www.
XDebug uses a cookie. As such, you cannot debug when passing through Varnish unless the cookie is in the list of allowed cookies in the Varnish configuration file. User the -d6phx.dev addresses for debugging.
Using Xdebug with curl
You can invoke Xdebug for a curl request by adding ?XDEBUG_SESSION_START=1 to the url, eg:
This works for all types of http request (not just GET).