Using WSL2 as your main development environment for Linux based university courses.

Many of us tried using the sluggish, full of problems VM’s given by the University course staff.
Many of us had a lot of trouble using those machines and developing on them, but NO MORE!
Let me introduce you: WSL2 — Your savior!

What is WSL2?

“WSL 2 is a new version of the Windows Subsystem for Linux architecture that powers the Windows Subsystem for Linux to run ELF64 Linux binaries on Windows. Its primary goals are to increase file system performance, as well as adding full system call compatibility.” — Microsoft docs

  • Choose your favorite GNU/Linux distributions from the Microsoft Store.
  • Run common command-line tools such as grep, sed, awk, or other ELF-64 binaries.
  • Run Bash shell scripts and GNU/Linux command-line applications including:
  • Tools: vim, emacs, tmux
  • Languages: NodeJS, Javascript, Python, Ruby, C/C++, C# & F#, Rust, Go, etc.
  • Services: SSHD, MySQL, Apache, lighttpd, MongoDB, PostgreSQL.
  • Install additional software using your own GNU/Linux distribution package manager.
  • Invoke Windows applications using a Unix-like command-line shell.
  • Invoke GNU/Linux applications on Windows.

Installing WSL2

First, make sure that your windows version is up to date:

  • For x64 systems: Version 1903 or higher, with Build 18362 or higher.
  • For ARM64 systems: Version 2004 or higher, with Build 19041 or higher.
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
wsl --set-default-version 2

First steps with WSL2 and Ubuntu 16.04

After installing the WSL2 and Ubuntu 16.04, lunch it through Start menu — Just search for “Ubuntu 16.04 LTS” and run the app.

Ubuntu first boot on WSL2
sudo apt update
sudo apt-get install make
sudo apt-get install gcc-5 5.4.0

Using Visual Studio Code with WSL to write and debug C code

In order to use your brand new WSL system for Uni purposes, make sure that you have Visual Studio Code installed on your computer — then open your Ubuntu app and run: code

Code server update
C/C++
Code Runner

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store