This tutorial only applies to Windows users
Must be running Windows 10 or higher
Search for PowerShell in Windows search
Right-click on the application and select “Run as administrator”
Enter the following command, and run it by pressing
Enter
--install wsl
Try it out by searching for Ubuntu, and running the application
You will be asked to enter a username, which must be lowercase
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.
Always update before installing
sudo apt update
sudo apt upgrade
Install the package. Let’s try with the compiler we’ll be using :
g++
sudo apt install g++
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.
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 &
Error: 0x80004002 No such interface supported
In PowerShell, run
-WindowsOptionalFeature -Online -FeatureName `
Enable-Windows-Subsystem-Linux Microsoft
WSLRegisterDistribution failed with error 0x80370102
Search for Configuration Panel in Windows search
Select “Applications”, then “Turn Windows features on or off”
Make sure Hyper-V and Virtual Machine Platform are enabled
Temporary failure resolving '<url>'
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
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
We thank Kalan Walmsley, assistant in this course, for writing this document.