Enter the vagrant machine with
ssh vagrant
Install xdebug
sudo apt-get update
sudo apt-get install php-xdebug
Config PHP to accept xdebug connections
sudo nano /etc/php/7.0/apache2/php.ini
[XDebug]
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_connect_back = 1
VSCode configuration
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000,
"pathMappings": {
"/root/to/the/web/in/vagrant": "${workspaceRoot}/root/to/web/on/local/project"
},
},