Requirements

1 Regular installation

  1. Search for PowerShell in Windows search

  2. Right-click on the application and select “Run as administrator”

  3. Enter the following command, and run it by pressing Enter

    wsl --install
  4. Try it out by searching for Ubuntu, and running the application

  5. You will be asked to enter a username, which must be lowercase

  6. You will be prompted for a password. It does not need to be particularly secure, and you will not see it being typed

Note : The official installation instructions can be found on the Microsoft page on WSL.

2 Installing software

  1. Always update before installing

    sudo apt update
    sudo apt upgrade
  2. Install the package. Let’s try with the compiler we’ll be using : g++

    sudo apt install g++
  3. To uninstall packages, run

    sudo apt purge <packagename>

    where <packagename> must be replaced by the name of the package you want to get rid of.

2.1 Qt Creator

We can install Qt Creator with the following command

sudo apt install qtcreator

(WSL 2 allows running GUI apps without configuration).

To start up Qt, one can run

qtcreator &

3 Possible errors

3.1 Error: 0x80004002 No such interface supported

In PowerShell, run

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

3.2 WSLRegisterDistribution failed with error 0x80370102

  1. Search for Configuration Panel in Windows search

  2. Select “Applications”, then “Turn Windows features on or off”

  3. Make sure Hyper-V and Virtual Machine Platform are enabled

3.3 When updating : Temporary failure resolving '<url>'

  1. Edit the /etc/resolv.conf file with

    sudo nano /etc/resolv.conf

    and replace nameserver 172.28.176.1 with nameserver 8.8.8.8

  2. To make sure the change survives a reboot, edit the /etc/wsl.conf with

    sudo nano /etc/wsl.conf

    and add the following two lines

    [network]
    generateResolvConf = false

Acknowledgements

We thank Kalan Walmsley, assistant in this course, for writing this document.