Skip to content
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

Improve WSL2 filesystem and mutagen documentation #3366

Closed
deviantintegral opened this issue Nov 10, 2021 · 4 comments
Closed

Improve WSL2 filesystem and mutagen documentation #3366

deviantintegral opened this issue Nov 10, 2021 · 4 comments

Comments

@deviantintegral
Copy link
Collaborator

Is your feature request related to a problem? Please describe.

I recently went through a "from scratch" setup of Docker and ddev on Windows with WSL2, to support a client who will likely have Windows-using team members in the near future.

To do this, I followed steps at Installation or Upgrade - Windows (WSL2). Of note was:

You won't need NFS anymore once you switch to WSL2, since it provides awesome filesystem performance out of the box.

I was pretty excited to read this given the experience on macOS. However, at the end there's the caveat:

Make sure you put your projects in the Linux filesystem (e.g. /home/), not in the Windows filesystem (/mnt/c), because you'll get vastly superior performance on the Linux filesystem.

In summary, ddev is installed inside an Ubuntu VM, and Docker Desktop is configured to use WSL2. Initially, I accidentally cloned to the /mnt/c/Users/... filesystem, and ddev composer install eventually errored out after trying for 30 minutes. So, I flipped to the linux filesystem, and everything worked smoothly until I tried to start up PHPStorm which says:

In other words, in the "Open" dialog, browse to \wsl$\Ubuntu\home\rfay\workspace\d9 (in this example). (If you're running PhpStorm inside WSL2, there are no special instructions.)

I did this, and PHPStorm would never finish indexing the project. In fact, it wouldn't even render the file tree! I left it for 10 minutes, but eventually had to kill PHPStorm.

At first, I assumed there was some issue with my WSL install, or I needed to change a setting somewhere to get that "awesome filesystem performance". After discussing in Slack it sounds like the \\wsl$ share is not particularly fast, and my experience was common.

Describe the solution you'd like

My first thought was to follow what's being done on macOS, and turn on mutagen. However, for the "zero configuration" solution ddev provides, you have to have ddev installed in Windows and not WSL. Given that installing Windows executables is marked as legacy, it seems like installing on the Windows side and using mutagen is not a long-term solution.

Describe alternatives you've considered

An alternative would be to recommend Windows users install their IDE inside of Linux, and remote in to the UI somehow. PHPStorm is working on remote development (both with a remote language server, and by projecting the UI via a web app), but there's tutorials out there for using X forwarding.

Microsoft is supporting GUI apps natively in Windows 11, and perhaps the community would eventually backport their wayland + RDP solution to Windows 10. For our clients using Windows, it's because it's managed by a central IT org and there's no way they'll be on Windows 11 any time soon.

Next Steps

I feel like the docs should be clarified, but in doing so I'd like to provide solid steps to Windows users other than 🤷 . I think we should choose between directing towards Mutagen or directing towards the IDE in Linux. I'm open to other ideas! Once we get that sorted, I'm glad to take a first pass at updating the docs.

@rfay
Copy link
Member

rfay commented Nov 10, 2021

Hi @deviantintegral - I hope you'll take a look at just-pushed addition (it was circulating as a blog post for more than a year, but didn't get into docs) https://ddev.readthedocs.io/en/latest/users/topics/phpstorm/#phpstorm-basic-setup-on-windows-wsl2 - Look especially at running PhpStorm inside WSL2, which solves everything (well, if you run a browser inside WSL2 then you're actually solving everything)

WSL2 zero-configuration debugging with PhpStorm works fine, happy to work with you on trouble you had.

See if that helps with context, and PR or further conversation is very welcome.

Mutagen does work fine on traditional Windows, except the initial sync can be painful due to NTFS slowness. After that it's lovely. And it's true that traditional Windows is marked as deprecated, but I'm not completely sure it will ever be able to go away because there are lots of people happy with it and not being dislodged after more than a year.

@deviantintegral
Copy link
Collaborator Author

Thanks for those updates - they're very much what I had in mind.

PHPStorm is slow to index files and is slow to respond to file changes in this mode.

Are there other frameworks or CMS's that aren't a problem for this? If a default Drupal 9 install isn't usable, I can't imagine a project with npm dependencies. What I'm not sure about is why we're recommending using \\wsl$ at all other than for very simple projects.

On Windows 11 or Windows 10 Insider Builds you don't need to install an X11 server, because WSLg comes with that these days

I thought it was Windows 11 only? https://github.com/microsoft/wslg#pre-requisites

@rfay
Copy link
Member

rfay commented Nov 11, 2021

Are there other frameworks or CMS's that aren't a problem for this? If a default Drupal 9 install isn't usable, I can't imagine a project with npm dependencies. What I'm not sure about is why we're recommending using \wsl$ at all other than for very simple projects.

I'm pretty sure this is just a function of trying to deal with thousands of files over what amounts to a network mount. \\wsl$ is basically a network mount, and it doesn't work very well. So I'm sure Drupal 7 works fine and Magento2 is far worse than Drupal 9.

Many, many people switched to vscode because of this problem, and have ended up happy. JetBrains has been slow to respond in kind, but they do now have projector, which is definitely something, and of course you can run native.

I thought it was Windows 11 only? https://github.com/microsoft/wslg#pre-requisites

Well, WSLg was in the Windows 10 Insider builds for months and months long before Windows 11 came out. Maybe there is no longer such a thing? I certainly don't know, as my test machines are now Win11. Sounds like some edit would be useful there.

@rfay
Copy link
Member

rfay commented Dec 1, 2021

If you think the existing docs have dealt with your concerns @deviantintegral please close this, thanks. PRs always welcome too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants