Skip to content

Installing WSL (Windows-only)

Install Ubuntu LTS

Searching Ubuntu LTS in the Windows Store

  1. Open the Windows Store
  2. Type “Ubuntu LTS” in the search bar
  3. Click on the most recent version (highest number) of Ubuntu LTS found. As of February 2024, this is version Ubuntu 22.04.3 LTS.

The Ubuntu LTS page in the Windows Store

  1. Click on the button labeled “Get”

The Windows Store App is installing Ubuntu LTS

It will take a while for Ubuntu LTS to be installed.

The Windows Store App has completed installing Ubuntu LTS

Eventually, the installation completes.

  1. Click on the button labeled “Open”

Error message because WSL is not enabled

Enabling WSL

Opening the PowerShell as administrator

  1. Search for “powershell” in the search field of the task bar
  2. Right-click on the hit “Windows PowerShell”
  3. Click “Run as administrator”

Prompt asking for confirmation to run PowerShell as admin

  1. Click “Yes” to confirm running the PowerShell as administrator

PowerShell terminal opened as administrator

  • Type wsl --install and confirm with the return-key.
  • After a while, the following message should appear:

PowerShell after WSL has been enabled

  • Now reboot Windows to complete the installation

Windows installing WSL during reboot

The reboot will take longer than usual due to the installation of WSL. You may see a screen like above for some time. Once the reboot is completed, an Ubuntu terminal should open automatically.

Setup Ubuntu LTS

You should now see an Ubuntu terminal such as:

An Ubuntu terminal when first started

If no Ubuntu terminal has opened, click here to see how to open it

Open Ubuntu in the start menu

  1. Click on the Start / Windows button in the task bar
  2. Click on the “Ubuntu” entry
  • Enter a user name of your choice, memorize it, and confirm with the return-key
  • Enter a password of your choice, memorize it, and confirm with the return-key
  • Repeat the password and confirm with the return-key
  • Once you successfully have entered user name and password, you should see something like this:

Ubuntu terminal after username and password are configured

  • now type (without quotation signs) “sudo apt update” and confirm with the return-key
  • you will be asked for you password. Enter it and confirm with the return key
  • Once you successfully entered the password, something like this will show up:

Ubuntu terminal after running apt update

  • Now type sudo apt upgrade and confirm with the return-key
  • This command will list which packages are about to be updated. Confirm with with the return-key
  • Eventually after all software packages in Ubuntu have been updated, you will see something like this:

Ubuntu terminal after updating software

Installing VS Code

Windows Store page of VS Code

  1. Click on the Windows Store icon to open the Windows store
  2. Type vs code in the search bar
  3. Click on the “Visual Studio Code by Microsoft Corporation” search result (not shown in the screenshot above)
  4. In the Windows Store page of VS Code (as shown in the screenshot above), click on the button labeled “Install”

Windows Store installing VS Code

  • Downloading and installing VS Code by the Store App may take some time
  • Eventually, it should show something like this:

Windows Store completed installing VS Code

  • Now, launch VS Code via the start menu
  • On the first launch, VS code will look similar to this:

First Launch page of VS Code

  • You can select a theme of you liking
  • You might want to dial back the data collection by Microsoft by clicking on “opt out”

Installation of the WSL extension for VS Code

  1. Open the extension marketplace by clicking on the extensions icon in the left menu bar
  2. Search for wsl in the search field
  3. Click on the “Install” button for the “WSL” extension by “Microsoft”

Installing usbipd-win

Release Page of usbipd-win

  1. Open the release page of usbipd-win
  2. Download the installer (file extension .msi) of the most recent release

Download of usbipd-win completed

Once the download is completed:

  1. Open the downloaded installer

Confirmation to open the installer

  1. Confirm that you indeed want to execute the installer by clicking “OK”.

Setup of usbipd-win

The setup of usbipd-win opens.

  1. Click on the “Install” button to proceed with the installation.

Confirmation of installation

  1. Confirm the installation by clicking on “Yes”.

Completion of the usbipd-win setup

Eventually, the setup will inform you of the completion of the installation.

  1. Click the “Close” button to acknowledge.

Attach a USB device to WSL

Running PowerShell as admin

  1. Search for powershell in search field in the task bar
  2. Right-click on the search result “Windows PowerShell”
  3. Select “Run as administrator”

Confirmation to run PowerShell as admin

  1. Click on “Yes” to confirm running the PowerShell as admin

PowerShell terminal

  1. Type the command usbipd list and confirm with the return-key
  2. Identify the USB device to share. In this guide we use an ESP32 development board, which almost all use an USB to UART bridge (here the CP2104).
  3. Run usbipd bin --busid <BUSID>, but replace <BUSID> with the correct BUSID. E.g. 2-5 for the CP2104 identified in step 2.
  4. Run usbipd attach --wsl --busid <BUSID>
    • If an error (such as above in red) is shown that WSL is not running, just start the Ubuntu terminal now and repeat (step 5.). If it worked the first time, no need to run it again.

Now that you have successfully installed Ubuntu LTS and enabled WSL on your Windows we can proceed with the next steps to setup our development environment.