Home

Windows Subsystem for Linux

By Ben Lopez
January 26, 2023

I know a lot of students are familiar with the VS Code/WSL pairing from past classes like 121, 221, etc, so recommending that would be cool. To support that, this link from Microsoft would be useful.

If you want to just include the information directly, the way to install WSL is simply wsl --install in Powershell. Then, you can follow your instructions for Linux and the run with Makefile directly.

If someone already has WSL, then they need to do a few more things. First, check that they have WSL2 (full Linux kernel VM version) by doing wsl -l -v which will print something like

If they’re running 2, they only need to perform wsl --update in Powershell, and then wsl --shutdown to restart the VM. If they’re running 1, then first they need to move to version 2 by performing wsl --set-version <distro name from above> 2. This will take a while, and then they follow the update and restart instruction above. Last step here would be to perform sudo apt update to be sure everything is up to date.

To test that the GUI support is working, I installed and ran gedit. sudo apt-get install gedit -y and then ran gedit ~/.bashrc and it brought up a normal looking window:

Then, following the run with Makefile instructions in Lab \(0\) allowed me to run it which looked fine:

Hope this helps and can streamline development for those wishing to use a simple editor like VS Code!


Generated on Fri Jan 27 13:49:15 CST 2023