A working .lando.yml file that allows enabling of xdebug, and also a launch.json and php.ini (if using WSL2)
name: example-xdebug recipe: drupal9 config: webroot: . # Set Xdebug off by default. We use the tooling below to turn it on as needed. xdebug: false services: appserver: overrides: environment: XDEBUG_MODE: 'debug,develop' tooling: xdebug-on: service: appserver description: Enable Xdebug. user: root cmd: - docker-php-ext-enable xdebug && kill -USR2 $(pgrep -o php-fpm) > /dev/null || /etc/init.d/apache2 reload - tput setaf 2 && echo "Xdebug On" && tput sgr 0 && echo xdebug-off: service: appserver