Replies: 4 comments 6 replies
-
This is a problem for you and your IT department to sort out. A standard Windows machine running WSL2 does not have this problem with Windows Defender. But thank you so much for studying it so carefully and going through the troubleshooting steps! You've done a great job. |
Beta Was this translation helpful? Give feedback.
-
Done that... but that doesn't work. I also tried following network firewall rules (from an elevated powershell):
(each one separately)... also no joy. I checked the block rules in place: there's 1 for Skype, but that's it. All the other are Allow. When I switch off Defender for the WSL part, xdebug works perfectly. I just don't find the right commands to "mess up" Defender to get the same result, but not mess it up so much that Defender will alert security. There's nothing special about the installed Defender, it's the default Windows 10 version (just that some group checks all the warnings the Defenders generate). When I start ddev with DDEV_DEBUG=true I get this part for the IP address:
Because I do this upfront:
else host.docker.internal is set to 127.0.0.1 which doesn't work even without firewall. I'm not the only one with the issue... there's this microsoft/WSL#4139 and microsoft/WSL#4585 and a couple of issue tickets in ddev. |
Beta Was this translation helpful? Give feedback.
-
To complete the story. I activate xdebug debugging. When I disable WSL in Defender I get this:
docker.host.internal = 172.30.32.1 ... The IP address of the WSL interface (ipconfig /all under Windows). When I restore the Defender settings I get this:
No idea what 192.168.32.5 is (it's not my windows address). And the thing triggering the debugging is a behat test running from the CLI inside the ddev webcontainer. |
Beta Was this translation helpful? Give feedback.
-
I'm going to have to revive this thread, but, i've had the same exact problem @sboden has had. I've had to disable the firewall since there was no other solution. Until i decided to just test it today, and xdebug is working again with the firewall enabled with no issue. It didn't occur to me before, but i was running Ubuntu 18.04 before and have had some other issues besides the firewall, so I installed the latest version of Ubuntu (24.04) and i'm using ddev 1.23.5. It works perfectly now. |
Beta Was this translation helpful? Give feedback.
-
I miss one final part to make my ddev installation work without getting security on my a**, I need some guidance.
I have a Windows 10 laptop. I use WSL2 on which I installed native docker-ce and ddev. I have PhpStorm running on Windows. Everything works except for xdebug when I don't disable the Windows Defender firewall. Are there any instructions on how to poke holes in Windows Defender for my setup?
More information:
I put my xdebug port to 9003. ufw is "Inactive" on the WSL2 (Ubuntu) host.
Extract from "ipconfig /all" on Windows:
With Windows Defender fully active, I can't connect from within the ddev container:
When I disable the WSL interface of Defender (either by the "Advanced options" in Windows Defender), or by running following commands in an elevated cmd on windows:
After this I can do following and xdebug also works with PhpStorm:
The remaining problem is that by disabling the WSL part of the firewall, Windows Security puts the firewall in a "to be looked at" state, which triggers Intune (so I can't access Microsoft Azure anymore until it's resolved) and it also flashes some warning on the company's security board apparantly.
I went through the ddev troubleshooting sections, which says to disable the firewall but no details on exactly what to execute to poke the hole in Windows Defender. I also tried the script at microsoft/WSL#4139 (comment) which doesn't work for my setup for some reason.
What would I need to execute to poke the right hole in Windows Defender firewall without shutting it down completely?
What I already tried and what doesn't work is e.g. from an elevated cmd on Windows:
and
Beta Was this translation helpful? Give feedback.
All reactions