# 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="/files/k6u4LtQbjmhWa6TLLdH6" 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="/files/q64xKJRUuZkwZfHMYOLL" 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="/files/jkSoimmqxi8HXzT0J37o" 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="/files/Nk17vqeaKgxkr51leAIx" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/vznmBPz7k6VoLIwWmyzh" 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="/files/LxYStnAZUFnVyIWyu3gj" 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="/files/Ny1fem8aGNg56aZCDV08" 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="/files/vcYDIivNJ01ckIDGSF1F" alt=""><figcaption></figcaption></figure>

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


---

# 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://docs.emc.network/emc-testnet/emc-airdrop-guidelines/testnet-tutorial-guide/windows-cli-tutorial/wsl-subsystem-installation.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.
