For development on Windows machines we recommend using the Windows Subsystem for Linux (WSL). This allows you to run a lightweight Linux virtual machine on your Windows system where you can use the shell commands and utilities presented in the course.
There are 2 versions of WSL - WSL1 and WSL2. WSL2 is advertised to be much faster and supports more functions of the Linux kernel, but it is more isolated from your file system. It also requires a recent version of Windows 10 (version 2004, build 19041 or higher). We suggest using WSL2 for its performance improvements and other capabilities. You can read more about the differences between the WSL versions here.
Follow this tutorial from Microsoft to set up WSL(2).
In short you need to run PowerShell as the administrator and issue the following commands:
Install WSL:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestartIf you simply wish to use WSL1, you can restart your computer at this point.
You need to enable the "Virtual Machine Platform" component to update to WSL2.
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestartYou will need to restart for the changes to take effect.
Finally, set WSL2 as the default WSL version.
wsl --set-default-version 2You might be prompted to update the kernel with a message such as this:
> wsl --set-default-version 2
WSL 2 requires an update to its kernel component. For information please visit https://aka.ms/wsl2kernelIn that case, follow the instructions at the link to update the kernel component.
After these steps you can install your Linux distribution of choice from the Microsoft Store. We recommend Ubuntu 20.04 LTS since there are a lot of resources for beginners online. After installing your Linux distribution of choice you can launch it as a regular application. Further we recommend installing and using the more feature rich Windows Terminal over the default terminal. We also provide a Go installation guide and a some guidance related to code editors.
When opening your newly installed Linux distribution you will be asked to create an account, you can choose a username of your convenience. You can also make it the default user in wsl, so next time you login you will automatically login as that user.
Please also take a look here to understand the implications of running applications as root.
To confirm that WSL2 is being used, run the following command in PowerShell:
wsl --list --verboseIf VERSION is not 2 you need to manually set the version.
E.g. if your WSL distribution is called Ubuntu-20.04 you can execute the following command:
wsl --set-version Ubuntu-20.04 2If you run into issues you might want to check the WSL issue tracker.
If there are some blocking issues, you might want to switch back to WSL1 for the meantime.
In PowerShell, you should be able to switch to WSL1 by finding your WSL distro's name (let's call it <distro>) with:
wsl --list --verboseand then changing the version of <distro> with:
wsl --set-version <distro> 1