# 4.1.5.1 WSL support

## Install

For installation of WSL 2 in Windows, [refer to Microsoft's documentation.](https://learn.microsoft.com/en-us/windows/wsl/install)&#x20;

Make sure you're using Visual Studio Code to develop and install the [WSL extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) for it. Do **not** install Docker within the WSL Linux distribution. Docker For Desktop will automatically do that for you.

{% hint style="warning" %}
Do not install Docker within WSL. Install **Docker for Desktop** and it will do the integration for you.
{% endhint %}

## Post-install

Run Powershell, and make sure that you're running the correct WSL version, and Ubuntu is set as the default distribution in WSL.

```
PS C:\Users\dev> wsl --list -v
  NAME                   STATE           VERSION
* Ubuntu                 Running         2
  docker-desktop-data    Running         2
  docker-desktop         Running         2
```

Make sure that Docker Desktop is using WSL 2 based engine in it's settings<br>

<figure><img src="/files/uhnzcuCwkEMmZZUokKfM" alt=""><figcaption></figcaption></figure>

## Usual problems

### Only one or few OpenCRVS microservices aren't running

Typically this is because Windows is reserving a specific port but the WSL Linux world doesn't pick that up. For example, if gateway fails to run, you can find in Windows Powershell what process is running in the port

```
PS C:\Users\dev> netstat -ano | findstr :7070
  TCP    127.0.0.1:7070         0.0.0.0:0              LISTENING       20352

PS C:\Users\dev> tasklist /FI "PID eq 20352"

Image Name                     PID Session Name        Session#    Mem Usage
========================= ======== ================ =========== ============
wslrelay.exe                 20352 Console                    1      8 512 K
```

### WSL hangs or running out of memory

Running all the databases and Node.js services OpenCRVS uses can demand quite a bit of memory. For WSL, we're suggesting at least 16GB of memory but the amount can vary between computers and WSL installations. It's also recommended you allow WSL use more memory by editing `.wslconfig`\
\
You can do this by pressing `Win`+`R` and enter&#x20;

```
notepad.exe %UserProfile%/.wslconfig
```

Insert this content into the file and save. Don't go above the amount of memory visible in task manager (`CTRL` + `Shift` + `ESC`)

```
[wsl2]
memory=16GB
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.opencrvs.org/v1.4/setup/3.-installation/3.1-set-up-a-development-environment/3.1.5-tooling/4.1.5.1-wsl-support.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
