question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setup Issues on Windows 10 WSL2 Ubuntu 20.04

See original GitHub issue

Description

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

WSL2_Buildtime

Windows 10

Windows_Buildtime

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:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
raisedadeadcommented, Jan 7, 2021

You can actually access WSL2 side files on Windows 10 Explorer like so:

\\wsl$

For me on Ubuntu 20.04 with the username raisedadead

\\wsl$\Ubuntu-20.04\home\raisedadead

image

You are right we should add tips on that guide. A PR is welcome if you are interested.

0reactions
robinduerhagercommented, Jan 7, 2021

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 some ConnectionRefused 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 😃 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting Windows Subsystem for Linux | Microsoft Learn
This is likely because your machine has not yet taken the backport for WSL 2. The simplest way to resolve this is by...
Read more >
How to Install WSL 2 on Windows 10 (Updated) - OMG! Ubuntu!
If you want to try out the improved Windows Subsystem for Linux 2 (aka WSL 2) in the latest Windows versions here's how...
Read more >
Install Ubuntu on WSL2 on Windows 10 - Tutorials
Finally, it's always good practice to install the latest updates with the following commands, entering your password when prompted. Press Y when prompted....
Read more >
How do I make Ubuntu 20.04 work on Windows 10 WSL 2?
after Windows 10 restarted, navigating the Start Menu: Windows Settings->Apps->Optional features->More Windows features->Turn Windows features ...
Read more >
Cannot install Ubuntu 20.04 on WSL2 - Super User
What AMD chip? Apart from the other things (BIOS, Virtual Machine Platform, Windows Hypervisor Platform and Windows Subsystem for Linux), ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found