Skip to content

Latest commit

 

History

History
69 lines (35 loc) · 3.03 KB

Setup VSC on Windows 10.md

File metadata and controls

69 lines (35 loc) · 3.03 KB

Windows 10

NOTE: Even though code runs successfully in the environment suggested here, it will not necessarily be error free in the Labnet environment for marking. You are responsible for testing on a Labnet system.

In broad strokes, there are 3 steps.

  1. Install Windows Subsystem for Linux (WSL)

  2. Install Visual Studio Code (code) and connect to your WSL

  3. Setup for compiling

Installation Steps

Step 1: Install WSL

  1. Update windows. WSL will not properly install unless your Windows install is up-to-date.

  2. Remember this is for Windows 10. Install Windows Subsystem for Linux following the Quickstart linked on this page. An overview on the Windows Subsystem for Linux | Microsoft Docs

  3. You do not need to follow the simplfied install, that is if you subscribe to Windows Insider. The manual installation is only 6 steps, mainly made up of copying and pasting commands.

  4. NOTE: The powershell that is used in the install must be an Administrator powershell

  5. Restart when required, specifically after enabling WSL, but before installing the kernel packages.

  6. Ensure that the last instruction on installing a Linux distribution is followed. I suggest Ubuntu as that is the installed Linux distribution for Labnet.

Step 2: Visual Studio Code "code" Installation

  1. Install Visual Studio Code. It is a free program, search for it, and follow the official install instructions. Visual Studio Code - Code Editing. Redefined

  2. On the first run of code, it will recognize your WSL install.

    • When it asks (in the lower right) if you want to install the recommended extensions for WSL. You can say yes here to shortcut the install.

    • If the quick install was missed, or bypassed, there is a manual way to setup.

Configure code to use WSL

At this point you should have successfully installed VS Code and WSL with a Linux distribution, the next part is to link them together.

  1. Start Visual studio code, go to the extensions.

    VS Code Extensions Icon

  2. Search for "Remote - WSL", use the install button and install it. Restart Visual Studio Code (VSC) if asked.

  3. Now in the lower left corner of VSC there will be an icon like:

    VS Code Remote SSH Icon

  4. Click it and, then in the selections that open in the upper centre of the window, pick new window.

Step 3: Setup for compiling.

These steps should be run from the terminal inside of code.

Running sudo requires the password that you used when installing WSL (part of step 1)

  1. Run the command sudo apt update

  2. Run the command sudo apt upgrade

  3. Run the command sudo apt install gcc make

You should now be setup for using code to write and test the programs that you write for class.

One last note<: You should restrict code to one window open at a time. It is possible to have more than one open at a time, but my experience has shown that eventually multiple windows open will cause problems.