# Completing my WSL installation

To use TSan, I required a working WSL terminal. But the moment I opened it, it would instantly crash. This is how I got it to work(all of the following was conducted while running Windows PowerShell as an administrator).

Firstly, I tried:

```shell
wsl
```

It showed:

```shell
Windows Subsystem for Linux has no installed distributions.

You can resolve this by installing a distribution with the instructions below:

Use 'wsl.exe --list --online' to list available distributions and 'wsl.exe --install <Distro>' to install.
```

I tried:

```shell
wsl --list --online
wsl --install -d Ubuntu
```

It would tell me to reboot to see the changes, but it would show the earlier (”*Windows subsystem.. ..to install.*”) output. Upon GPT’s suggestion, I put:

```shell
wsl --status
```

It showed:

```shell
Default Version: 2
WSL1 is not supported with your current machine configuration.
Please enable the "Windows Subsystem for Linux" optional component to use WSL1.
WSL2 is unable to start since virtualization is not enabled on this machine.
Please ensure the "Virtual Machine Platform" optional component is enabled and virtualization is turned on in your computer's firmware settings.

Enable "Virtual Machine Platform" by running: wsl.exe --install --no-distribution" 
```

I put:

```shell
wsl --install --no-distribution
```

This required another reboot. After that, I checked whether my Virtualization was enabled(Go to Task Manager→Performance→CPU). Thankfully, it was enabled(if it’s not, you need to enable virtualisation in your BIOS/UEFI).

<mark class="bg-yellow-200 dark:bg-yellow-500/30">The next two commands really revealed what was inhibiting the wsl installation</mark>. For wsl to install, both of the following commands..

```shell
Get-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform

Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
```

..must return `Status: Enabled` among its outputs. But in my case, for the latter one, it returned `Status: Disabled`. To enable it, I had to run:

```shell
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
```

The operation completed successfully. I rebooted the pc as per GPT’s suggestion. Finally, for the last time, when I put in:

```shell
wsl --install -d Ubuntu
```

It started its proper installation and asked for my Linux username and password.
