> For the complete documentation index, see [llms.txt](https://docs.emc.network/emc-testnet/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.emc.network/emc-testnet/emc-airdrop-guidelines/testnet-tutorial-guide/windows-cli-tutorial/wsl-subsystem-installation.md).

# WSL Subsystem Installation

## 1. WSL pre-installation setup<br>

**1.1 Check if CPU Virtualization is enabled**

<div data-full-width="false"><figure><img src="https://4040577148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRh2Ej6T3BJ4HfxcHvbyU%2Fuploads%2F1NJO9Zb0hN4DQWj7hBcp%2FWinCLI_001.jpeg?alt=media&amp;token=04db6f01-492e-41a7-aae2-2f56b2327db9" alt=""><figcaption></figcaption></figure></div>

Open Task Manager, click **\[Performance]**, and in the pop-up window, check if virtualization is enabled.

**1.2 Enable Virtual Machine and Windows Subsystem**

<figure><img src="https://4040577148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRh2Ej6T3BJ4HfxcHvbyU%2Fuploads%2FWhEYRPlDrixqgbGVKjLG%2FWinCLI_002.jpeg?alt=media&amp;token=ed386fb5-543f-416d-bbf0-083ff2b8bb3b" alt=""><figcaption></figcaption></figure>

As shown in the image above, Open the Control Panel, go to Programs and Features, click "**Turn Windows Features on or off,**" and check the relevant features in the pop-up window. Restart the computer to apply the changes.

## 2. WSL Installation of Ubuntu

**2.1 WSL installation and version update**

In Windows Powershell (run as administrator), enter <mark style="color:red;">`wsl --update`</mark> to start installing wsl or a newer version.

<figure><img src="https://4040577148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRh2Ej6T3BJ4HfxcHvbyU%2Fuploads%2FDUxTCgt99ONbBNviuMYc%2FWinCLI_003.jpeg?alt=media&amp;token=d2a9b161-7a25-4f47-945b-693ca107d479" alt=""><figcaption></figcaption></figure>

**2.2 WSL Install Ubuntu Subsystem**

In Windows Powershell (run by the administrator), enter the following command to install:

```powershell
# View available versions online
wsl --list --online

# Install Ubuntu 22.04
wsl --install -d Ubuntu-22.04
```

<figure><img src="https://4040577148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRh2Ej6T3BJ4HfxcHvbyU%2Fuploads%2FmLcLKPpegOSrH4grZyzn%2FWinCLI_004.jpeg?alt=media&amp;token=389a904c-2dcc-469b-94c7-22c49be88214" alt=""><figcaption></figcaption></figure>

Enter your username and password to create an Ubuntu user account.

<figure><img src="https://4040577148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRh2Ej6T3BJ4HfxcHvbyU%2Fuploads%2Fp7VQh28uva8xMFman5T5%2FWinCLI_005.jpeg?alt=media&amp;token=99254d26-1e61-4dda-af08-3d7e5d46d70e" alt=""><figcaption></figcaption></figure>

As shown in the above figure, the Ubuntu 22.04 subsystem has been successfully installed.

**2.3 Install Docker In The Ubuntu subsystem.**

Enter docker info to check if the subsystem already has a docker service.

<figure><img src="https://4040577148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRh2Ej6T3BJ4HfxcHvbyU%2Fuploads%2F7pSsGYORQfMe1J3QZtRr%2FWinCLI_006.jpeg?alt=media&amp;token=0a693774-1cf8-4dc6-8781-cdedb47856e7" alt=""><figcaption></figcaption></figure>

If it is already present, installation is not needed. Otherwise, use the following command in Ubuntu to install:

```PowerShell
sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get update
sudo apt-get install docker.io 
```

**2.4 Install Graphics Driver For Ubuntu Subsystem**

View graphics card information

<figure><img src="https://4040577148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRh2Ej6T3BJ4HfxcHvbyU%2Fuploads%2FHVsIAxivYI3JiduEuSs0%2FWinCLI_007.jpeg?alt=media&amp;token=6625260d-56be-41e6-bed0-59f706e1a824" alt=""><figcaption></figcaption></figure>

If the results match the image above, no further action is required.

**NVIDIA Container Runtime Installation and Usage**

With NVIDIA Container Runtime, registers a new runtime during container creation to expose the NVIDIA GPU to applications in the container.

**# Add Library**

```sh
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \&& curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
    sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
    sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
    
sudo apt-get update
```

**# Install nvidia-container-runtime**

```powershell
sudo apt-get install nvidia-container-runtime
systemctl restart docker
```

**#Verify if the installation was successful.**

```powershell
sudo docker run --gpus all --rm nvidia/cuda:12.0.1-base-ubuntu22.04 nvidia-smi
```

**Note:**&#x54;he above command should match your Ubuntu version; for details, refer to: <https://catalog.ngc.nvidia.com/orgs/nvidia/containers/cuda>

<figure><img src="https://4040577148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRh2Ej6T3BJ4HfxcHvbyU%2Fuploads%2FubmrOcirKLp1JQ1Dbk82%2FWinCLI_008.jpeg?alt=media&amp;token=4264a73f-9320-4640-a653-d0eba14edad7" alt=""><figcaption></figcaption></figure>

At this point, the WSL installation and Ubuntu subsystem setup are complete.
