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
First experience running DDEV on Windows 10 WSL2 #2251
Comments
The trick to getting mkcert to work isn't too hard. There's more than one way to do it, but the basic idea is to set CAROOT on the WSL2 side to point to the CAROOT on the Windows side. I have a symlink on the WSL2 side in my home directory called "winhome", so ~/winhome is a symlink to /mnt/c/Users/rfay.
|
That worked 🎉 , but there's one gotcha: your Windows and Linux username need to be exactly the same, otherwise you'll keep getting SSL errors (the Linux username is shown in the certificate on Windows, while the CA on Windows is based on the Windows username). Had to find that out the hard way 😂 Final thing I had to fix was my XDebug config in VS Code; I had to set the hostname to {
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"hostname": "0.0.0.0",
"port": 9000,
"pathMappings": {
"/var/www/html": "${workspaceRoot}"
}
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000
}
]
} Up and running now on WSL2 + DDEV! Love it 😍 @rfay OK if I write a WSL2 section for the Installation guide, based on the steps mentioned above? |
I'd love you to write a section in the docs, but maybe first a guest blog on ddev.com? I don't use the same username on Window and in WSL2, and the CA is not tied to a username, so I'm a little lost about what you're saying there. However, the CAROOT has to point to the user where you're using the web browser. I guess that must be what you're saying. There are a few other things I've been collecting:
|
Happy to write a guest blog. Feel free to ping me on Gitter, just joined the drud/ddev room 👍 |
I'm sure you know we'd love you to do both; the blog and the docs update are both super-important with Windows 2004 about to drop. |
@rfay Here's a concept blog post, let me know what you think: https://gist.github.com/dennisameling/8317b9dc6b7d971860a4797c64f16eaf |
Absolutely awesome. Commented there, https://gist.github.com/dennisameling/8317b9dc6b7d971860a4797c64f16eaf#gistcomment-3308672 |
Updated based on your feedback @rfay 🚀 https://gist.github.com/dennisameling/8317b9dc6b7d971860a4797c64f16eaf#gistcomment-3308687 |
Blog post should be done now (see Gist link above), will work on the DDEV installation docs on Thursday. Will be mostly the same content as the blog post but in slightly different format |
Thanks to @dennisameling for writing this up wonderfully on https://ddev.com/ddev-local/ddev-wsl2-getting-started/ Looking forward to your docs PR when you get to it. |
Have the installation docs part now scheduled for the coming weekend, had a lot of work to go in the last 2 weeks. Apologies for the delay. Will provide a separate PR when done 👍 |
You are AWESOME, thanks. |
Hey guys I am not able to make xdebug to work.
Also I have installed xdg-utils but still I can't seem to open anything. xdg-open https://google.com doesn't seem to work so is ddev launch |
Hi @MuhammadMurtaza - this is a closed issue. Please do these things and then open a new issue if you need one, or use one of the other support venues
If you're running vscode using X11 inside WSL2 and setting $DISPLAY, that's a completely different (and totally valid) technique. |
I do see you are running vscode inside WSL2, so that's a whole new situation, and it will work just like it does on Linux, so you should be able to use the debugging scenario pretty easily. |
I am running vscode in windows but using Remote-WSL extension to connect to ddev which is in ubuntu (WSL2 default distro in docker)
|
Please do the things I asked in #2251 (comment) |
Already done. Not just once but again n again with slight variations. Doesn't work for me. |
Aright. I got it working! |
Is your feature request related to a problem? Please describe.
Since DDEV is planning to add explicit support for Windows WSL2, I thought I'd give it a try already on my machine that's running Windows 10 2004. I took the approach of having my project files in the Linux filesystem, not in Windows, for faster performance. This is Microsoft's recommended approach.
Steps I took:
docker
commands will be available from within your WSL2 distro)ddev config
andddev start
.ddev.site
URL or the special localhost port. The only thing that doesn't work yet is themkcert
SSL certificate (as that's installed in Linux, not in Windows):... but after skipping this warning, I can access my DDEV site without any issues (and it's CRAZY FAST 🎉 🚀):
If there's anything I can do to help support WSL2 better (as in, improve the developer experience), please let me know!
Describe the solution you'd like
n/a
Describe alternatives you've considered
Tried running DDEV from the Windows OS as well, but filesystem performance was very poor. In Linux it's lightning fast 🚀
Additional context
n/a
The text was updated successfully, but these errors were encountered: