Questions tagged [wsl-2]

This tag should be used for question about Windows Subsystem for Linux version 2. It should not be used for WSL version 1.

From the Microsoft docs:

WSL 2 is a new version of the architecture in WSL that changes how Linux distros interact with Windows. WSL 2 has the primary goals of increasing file system performance and adding full system call compatibility. Each Linux distro can run as a WSL 1, or a WSL 2 distro and can be switched between at any time. WSL 2 is a major overhaul of the underlying architecture and uses virtualization technology and a Linux kernel to enable its new features.

WSL provides a way to run linux binaries under Windows 10.

WSL 2 is stored in a single file and has it's own IP address while WSL 1 is stored in multiple files and shares an IP address with the host.

WSL 2 can access files in it's own directory structure faster than WSL 1 but it is slower with Windows files.

The guide for installing WSL2 can be found here.

1587 questions
298
votes
11 answers

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

I've just upgraded to Windows 10 Home May 2020, activated WSL2, and installed Docker Desktop. WSL2 must be installed in my system disk, which is a small SSD. I don't want to fill it with docker images. How do I change the docker images path? I'd…
neves
  • 33,186
  • 27
  • 159
  • 192
182
votes
23 answers

How to set up working X11 forwarding on WSL2

When moving from WSL1 to WSL2 many things change; apparently this applies to X11 forwarding as well. What steps do I need to make in order to use X11 forwarding with WSL2 on Windows 10 as I did with WSL1?
whme
  • 4,908
  • 5
  • 15
  • 28
142
votes
18 answers

Connecting to WSL2 server via local network

I'm developing a rails app using WSL2/Ubuntu on my Windows 10 machine, which is great! The problem is I can't connect to my server from another computer in the same network. For further clarity, I am running a Puma server on localhost:3000 I have…
Sebastian Rivas
  • 1,700
  • 2
  • 13
  • 15
139
votes
16 answers

WSL2 Clock is out of sync with Windows

WSL2 clock goes out of sync after resuming from sleep/hibernate. A workaround was shared on GitHub sudo hwclock -s to resync clock in WSL, but you have to do this every time you resume from sleep/hibernate.
piouson
  • 3,328
  • 3
  • 29
  • 29
111
votes
5 answers

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

I am working with WSL a lot lately because I need some native UNIX tools (and emulators aren't good enough). I noticed that the speed difference when working with NPM/Yarn is incredible. I conducted a simple test that confirmed my feelings. The test…
WrRaThY
  • 1,533
  • 2
  • 10
  • 14
106
votes
4 answers

Docker Desktop WSL ext4.vhdx too large

I have WSL installed as well as Docker Desktop. I tried to clean up docker as much as I could by running docker system prune -a docker volume rm $(docker volume ls -q -f dangling=true) Then I verified with ❯ docker system df TYPE TOTAL …
K Split X
  • 3,405
  • 7
  • 24
  • 49
93
votes
9 answers

docker on wsl2 very slow

After having read about the performance improvements when running Docker on wsl2, I have been waiting for the official release of Windows 10 that supports wsl2. I updated Windows and Docker and switched on the Docker flag to use wsl2 and was hoping…
doberkofler
  • 9,511
  • 18
  • 74
  • 126
80
votes
15 answers

Windows10 WSL2 Ubuntu / Debian # no network

After upgrading from WSL to WSL2 sudo apt-get update not works any longer. After: wsl --set-version Ubuntu-18.04 2 Output is: > sudo apt-get update Err:1 http://security.ubuntu.com/ubuntu bionic-security InRelease Temporary failure resolving…
Jundl
  • 3,084
  • 3
  • 15
  • 16
71
votes
3 answers

Where are the files inside wsl2 physically stored?

I've installed wsl2 on my windows machine and I was not able to figure out where the files are actually stored. Note, that I don't mean that I wanna browse them inside the file explorer - I know it can be done by typing in the explorer \\wsl$\. If…
Eliran Turgeman
  • 1,526
  • 2
  • 16
  • 34
71
votes
17 answers

Why am I getting a "Cannot connect to the Docker daemon" error in WSL2?

Here is my setup: Windows 10 PRO - build 19041.153 - insider program - slow ring Ubuntu 18.04LTS subsystem in WSL2 mode Docker for desktop 2.2.0.4 - enabled WSL2 integration with my Ubuntu subsystem I am currently forced to use Windows for…
70
votes
8 answers

Running graphical Linux desktop applications from WSL 2 – "Error E233: cannot open display"

How can I run graphical Linux desktop applications from the command line of Windows Subsystem for Linux (WSL)? First, I installed WSL 2 following these steps on how to install Linux on Windows with WSL : I installed Windows 10 Pro Insider Preview…
ASE
  • 1,702
  • 2
  • 21
  • 29
66
votes
3 answers

Error Updating Python3 pip AttributeError: module 'lib' has no attribute 'OpenSSL_add_all_algorithms'

I'm having an error when installing/updating any pip module in python3. Purging and reinstalling pip and every package I can thing of hasn't helped. Here's the error that I get in response to running python -m pip install --upgrade pip specifically…
patrick
  • 871
  • 1
  • 7
  • 9
63
votes
8 answers

Docker Image Taking up Space After Deletion

I committed an existing Docker container to create a new image but the committed image was way too large (the original image was 3+ GB, and with just a few additional things installed in the container, the committed image was 8+GB). I'm low on…
anonymous1a
  • 785
  • 1
  • 7
  • 12
52
votes
7 answers

Access a localhost running in Windows from inside WSL 2

I am running a local AEM server in my Windows machine. The server is running on localhost:4502. I am using a Ubuntu distribution running in WSL 2 for my development. I want to access the localhost:4502 running in the Windows machine in my WSL 2…
50
votes
2 answers

Memory allocation to docker containers after moving to WSL 2 in Windows

I recently updated my Docker environment to run on WSL 2 on Windows. For setting memory allocation limits on containers in previous versions, I had option in Docker Desktop GUI under Settings->Resources->Advanced->Preferences to adjust memory and…
Murtaza Haji
  • 1,093
  • 1
  • 13
  • 32
1
2 3
99 100