Why is WSL extremely slow when compared with native Windows NPM/Yarn processing?

Since you mention executing the same files (with proper performance) from within Git Bash, I’m going to make an assumption here. Correct me if I’m wrong on this, and I’ll delete the answer and look for another possibility. This would be explained (and expected) if your files are stored on /mnt/c (a.k.a. C:, or /C … Read more

Running graphical Linux desktop applications from WSL 2 – “Error E233: cannot open display” [closed]

The networking subsystem in WSL2 is different than the used in WSL1. You must consider the differences to access networking apps running on Windows and on Linux: In WSL1, Linux uses the same IP addresses than the Windows host, then, you can access the applications using localhost or 127.0.0.1 In WSL2, Linux runs on a … Read more

Access a localhost running in Windows from inside WSL2? [closed]

Short answer for most recent Windows versions mDNS has been a feature of WSL2 for a while now. Concatenating your WSL2 hostname (or the equivalent command/function in your programming/language environment) with “.local” should get you access. For example, from Bash, try: ping “$(hostname).local” For instance, if your hostname is “MyComputer”, then the mDNS should be … Read more

Get err_connection_refused accessing django running on wsl2 from Windows but can curl from Windows terminal

Seems like a forwarding problem. WSL2’s interface is NAT’d, whereas WSL1 was bridged by default. WSL seems to do some “auto-forwarding” of ports, but only on localhost. However, sometimes this auto-forwarding mechanism seems to “break down”. The main culprit seems to be hibernation or Windows Fast Startup (which are both closely-related features). Does the problem … Read more

Connecting to WSL2 server via local network

See this video, it helped me: https://www.youtube.com/watch?v=yCK3easuYm4 netsh interface portproxy add v4tov4 listenport=<port-to-listen> listenaddress=0.0.0.0 connectport=<port-to-forward> connectaddress=<forward-to-this-IP-address> for example netsh interface portproxy add v4tov4 listenport=3000 listenaddress=0.0.0.0 connectport=3000 connectaddress=172.30.16.3 Microsoft has published a little bit of information about this on their WSL1 to WSL2 comparison page

How can I change the location of docker images when using Docker Desktop on WSL2 with Windows 10 Home?

The WSL 2 docker-desktop-data vm disk image would normally reside in: %USERPROFILE%\AppData\Local\Docker\wsl\data\ext4.vhdx Follow the following to relocate it to other drive/directory, with all existing docker data preserved (tested against Docker Desktop 2.3.0.4 (46911), and continued to work after updating the 3.1.0 (51484)): First, shut down your docker desktop by right click on the Docker Desktop … Read more

How can nodemon be made to work with WSL 2?

Root cause: inotify is not fully supported in the 9P filesystem protocol on WSL2. There are several github issues on the WSL project related to this, but perhaps the most relevant is #4739. Possible Workarounds: Try nodemon -L (a.k.a. –legacy-watch) as Simperfy suggested. Try running from the default ext4 filesystem (e.g. mkdir -p $HOME/Projects/testserver). Note … Read more

How to set up working X11 forwarding on WSL2 [closed]

TL;DR: Add the following to your ~/.bashrc: export DISPLAY=$(ip route list default | awk ‘{print $3}’):0 export LIBGL_ALWAYS_INDIRECT=1 Enable Public Access on your X11 server for Windows.* Add a separate inbound rule for TCP port 6000 to the windows firewall in order to allow WSL access to the X server, as described by the wsl-windows-toolbar-launcher … Read more