# WSL

WSL is a very handy tool to have in your Windows OS so that you do not need a VirtualMachine or native Linux install in your computer to run Linux. With WSL you are running Linux through Terminal that means you do not get any Graphical User Interface, however, with Windows 11 it is possible to have a GUI.

Follow the instructions given in the PX4 website below to setup WSL. Those instructions also contain the setting up of PX4 and VisualCode to that WSL, if you only need to install WSL only follow the WSL Installation guide.

{% embed url="<http://docs.px4.io/main/en/dev_setup/dev_env_windows_wsl.html>" %}

### Setting up you USB port with WSL

1. You will need to download and install the latest version of usbipd-win using the link below. After installing restart your PC.

{% embed url="<https://github.com/dorssel/usbipd-win/releases>" %}

2. Then, install Ubuntu via Microsoft Store. We installed Ubuntu 20.04.4 LTS or "Ubuntu on Windows". The last one seems to be used a lot more.
3. Next, start Ubuntu (from Store or as application) 1st to create own username and password.
4. Open the Ubuntu WSL terminal and type the following:

```
sudo apt install linux-tools-5.4.0-77-generic hwdata
```

```
sudo update-alternatives --install /usr/local/bin/usbip usbip /usr/lib/linux-tools/5.4.0-77-generic/usbip 20
```

5. Attach a USB device for testing (Each windows reboot you will have to repeat this process)

* Open the windows PowerShell as Administrator.
* Type the following, to see which USB devices are available.

```
usbipd wsl list
```

* Then attach your USB using:

```
usbipd wsl attach -b [YOUR device id (example 2-4)]
```

{% hint style="info" %}
Note: The first time you attach a device to WSL requires administrator privileges; subsequent attaches will succeed with standard user privileges.
{% endhint %}
