What are the Slack Archives?

Itโ€™s a history of our time together in the Slack Community! Thereโ€™s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you wonโ€™t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hi All, Did anyone resolve a problem with xdebug on WSL2 as follows? `Could not connect to debugging

U015HHFCU1M
U015HHFCU1M Posts: 81 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet
edited August 2022 in Docker

Hi All,
Did anyone resolve a problem with xdebug on WSL2 as follows?
Could not connect to debugging client. Tried: host.docker.internal:9003 (through xdebug.client_host/xdebug.client_port)

Thanks!

Comments

  • U03QGK574SD
    U03QGK574SD Posts: 3 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet
    edited August 2022

    @U015HHFCU1M There is a pending PR fixing this, in the meanwhile go to docker/bin/platform.sh:5 and add -i after the -v of grep - but normaly it should work if there is the host.docker.internal route already.

  • U03QGK574SD
    U03QGK574SD Posts: 3 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    @U015HHFCU1M someone wrote in a blog-post that you still need to restart your container after a restart of the wsl2 instance because Windows always changes IPs when wsl2 starts.

  • U015HHFCU1M
    U015HHFCU1M Posts: 81 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    @U03QGK574SD, thank you, will try the solution.
    I workaround it by adding host.docker.internal to hosts files (both, win and linux) with IP fetched like so: wsl -- ip -4 route show default