Getting Wsl
Windows Subsystem for Linux (WSL) enables using the Linux terminal within your Windows system. It is more light weight than running a virtual machine. It is terminal only, so it is not the right option if you want to run a programme relying on a graphical user interface. However, you can launch the VS Code editor using WSL. WSL is a great light weight Linux developer tool for Windows users.
WSL installation
See the official guide by Microsoft or follow the steps below: https://docs.microsoft.com/en-us/windows/wsl/install-win10
- Run the following command as administator in PowerShell:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
-
Restart you computer.
-
Install Ubuntu from the Microsoft Store:
https://www.microsoft.com/store/productId/9NBLGGH4MSV6
-
Launch Ubuntu and wait for the installation to complete.
-
Enter your desired username and password.
Folder navigation
Navigate to your Windows folder system by writing:
cd /mnt
Return to the path of the Linux subsystem by writting:
cd ~
Visual Studio Code using WSL
Visual Studio Code (“VS Code” or just “Code” abbreviated) is an editor or light weight IDE. If you have not used it before you can download it here: https://code.visualstudio.com/
- Launch VS Code.
- Navigate to the Extensions Marketplace.
- Search for “WSL” or “Remote - WSL” in the marketplace or download the extension here: https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl
- Once installed you can now launch it from
View>Command Palette...
the shortcut for opening it isCtrl+Shift+P
. - The Command Palette should now be seachable in a field in top of the VS Code Window. A
>
should appear in the start of the search field. - Search for “Remote-WSL: New Window” and press enter once it has been selected.
- Launch the terminal within VS Code to check that you are within the WSL environment. Open it using hte menu in
View>Terminal
or by using the shortcutCtrl+æ
(Danish keyboards) - You should now see a Bash terminal where the name you chose in the WSL installation step should appear.
It is also possible to start VS Code from WSL by writing code .
in the WSL terminal.