New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ddev hostname
should edit both WSL2 and Windows hosts file when used
#3818
Comments
That warning only happens when either there's no internet or a non-ddev.site URL is in place. |
Thanks for your fast response! From my windows host resolving some-project.ddev.site is not possible while google.com is, so internet should be available.
In my WSL both the ddev domain, as well as google is reachable
Do I understand you right, that the ddev hostname notices shouldn't appear at all? Thanks for your help! |
You can There is a problem with certain routers though where DNS rebinding is prohibited, this could be your situation, as described in https://ddev.readthedocs.io/en/latest/users/troubleshooting/#dns-rebinding-prohibited - but I'd think that would affect WSL2 and Windows equally. Again, lookup of |
Yes, adding ddev.site to the whitelist solved this issue for me. But this issue might be more more important than you might think. Everyone of my colleagues helping me test the plugin had the same issue. AVM (FritzBox) has quite a large market share, at least in germany. Also this might be a problem in enterprise environments, as admins will not be happy to open their firewalls for rebinding attacks. As this issue was about the host entry, it has lower priority to me now. But the actual problem of setting the host entries from WSL still exists. Your decission if you like to keep this issue open or close it as my actual problem with that is solved. |
ddev hostname
should edit both WSL2 and Windows hosts file when used
I have always wanted |
maybe this could be useful? |
Thanks so much @morvy, please continue to keep your eyes open! - It seems go-wsl2-host only adds an IP address on the Windows side to access the WSL2 environment directly. The goal here is for ddev to be able to add a |
Thanks i think that was it! Link changed to: https://ddev.readthedocs.io/en/stable/users/troubleshooting/#dns-rebinding-prohibited and here the tutorial for Fritzbox: #2409 (comment) |
@nico-loeber @morvy @mhsdesign and anybody else, would love it if you could test #4377 - the binary should be in the PR in just a few minutes. You will need both the Windows and linux binaries/installers. |
Is there an existing issue for this?
Run a Diagnostic and Paste Link Here
No response
Current Behavior
When using DDEV inside WSL and starting a new ddev project the first time ddev adds entries in the /etc/hosts file of the system to ensure the project.ddev.site domain can be resolved locally.
This does not work well on WSL as ddev is currently editing the hosts file inside WSL which is not exposed to the windows host, so accessing the website via a browser on the host system is not possible.
Additionally the WSL hosts file will be regenerated on every WSL start to pepresent the state of the windows one.
DDEV warns you about this fact by outputting:
This suggestion will only work if ddev is also installed on the windows host.
So you have to install ddev on Windows and inside WSL to be able to ensure the basic functionallity is working, wihtout the need to manually editing files.
Expected Behavior
I would expect ddev to work within WSL just as it does installed on a native operating system.
I don't expect to have to manually edit any files with an editor.
I don't expect to have to install and keep ddev up to date in Windows and WSL.
Steps To Reproduce
ddev config
andddev start
in a new project inside WSLAnything else?
This issue can be avoided by using the Windows binary inside WSL as proposed by the concept DDEV Interop Based WSL Integration, but @rfay had valid reasons for not implementing this concept as default.
This issue does affect the following issue of the DDEV Integration Plugin: php-perfect/ddev-intellij-plugin#32
The text was updated successfully, but these errors were encountered: