Setup Issues on Windows 10 WSL2 Ubuntu 20.04
See original GitHub issueDescription
Based on the suggestion of @raisedadead in #37865, i setup a local dev environment of this repository on an Ubuntu 20.04 WSL2 Instance. However, similar to #39278, the mongodb connector is unable to establish a connection to my MongoDB 3.6.21 instance, running on Docker Desktop 3.0.0. The MongoDB Container is not even printing any logs during the connection phase. I’m running on the latest master branch without any custom changes.
Connection fails: MongoNetworkError: failed to connect to server [localhost:27017] on first connect [MongoNetworkTimeoutError: connection timed out
Also, Even though the frontend compiles successfully, build time increases drastically on the WSL2 instance versus on native Windows 10. I did some Screenshots of the different build times:
Build Times
WSL2 - Ubuntu 20.04
Windows 10
Browser and Operating System:
OS: Windows 10 (Build 19042.685) with WSL2 Ubuntu 20.04 Browser: Firefox 84.0.1 (64-Bit) Docker Desktop 3.0.0 with WSL2 Integration and a MongoDB 3.6.21 Container
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
You can actually access WSL2 side files on Windows 10 Explorer like so:
For me on
Ubuntu 20.04
with the usernameraisedadead
You are right we should add tips on that guide. A PR is welcome if you are interested.
I was able to resolve this issue!
Most of my problems were based on the filesharing System between WSL2 and Windows. Therefore i had to move the cloned Repo to a place which is not shared with Windows (e.g.
~/user/PROJECTS/freeCodeCamp
). Build times are now blazingly fast and the Browser finally loads all pages without trouble.ConnectionTimeout
errors with MongoDB are now gone as well, even though i had someConnectionRefused
Errors, using a Docker MongoDB Container, which is somehow now resolved by restarting the Container.However, i didn’t have any problems with a local Ubuntu MongoDB Installation so far, so if someone wants to swap from a MongoDB Container to a local instance, i would recommend this Post for doing so.
I think it would be great to have some Hints to the How To Setup WSL Guidelines. At least regarding those intensive performance issues in conjunction with the WSL2 - Windows 10 file sharing System.
Thanks for the great Help @raisedadead and @ShaunSHamilton 😃 👍