Development Tools

Windows Subsystem for Linux (WSL)

The Windows Subsystem for Linux (WSL) is a feature of Windows 11 that allows you to run a Linux environment on your Windows machine. It gives you access to most of the command-line tools and utilities found in a Linux system without the need for a separate virtual machine or a dual-boot setup.

WSL runs Linux in a lightweight virtual machine managed by Windows and which has access to the file system, network resources, and other elements of your Windows system "out of the box." This allows you to use Linux and Windows programs side-by-side

WSL is a useful option for getting familiar with a Linux command-line environment (such as the bash shell) without abandoning the Windows enviornment you are comfortable with. It is also particularly attractive for installing and configuring programming tools which are difficult or impossible to configure for Windows (such as a C/C++ compiler).

You can find additional information about WSL on Microsoft's website, including a tutorial on installation; common WSL commands; and how to set up development tools like Visual Studio Code and git to work across your hybrid Windows/Linux environment.

Installing the Windows Subsystem for Linux

The easiest way to install WSL is using the PowerShell command line, as it requires you to run exactly one command.

Installing WSL

Installing WSl
  1. Open an *administrator* PowerShell
    1. Open your Start Menu and type "PowerShell"
    2. Look for the option "Run as administrator" and click it; then say "yes" to the pop-up window which appears (allowing PowerShell to modify your computer).
  2. Run the command: > wsl --install
  3. When this command finishes running, restart your computer.
  1. Open an *administrator* PowerShell
    1. Open your Start Menu and type "PowerShell"
    2. Look for the option "Run as administrator" and click it; then agree to run the resulting pop-up which requests elevated permissions.

Running WSL for the first time

Once the WSL installation process is complete, you can open your new Linux system via the Start menu. Simply type "WSL" and choose the option that comes up to open a terminal.

The first time you run WSL, you'll be asked to create a new user by typing a username and password. The username does not have to be the same as your Windows username or your netID -- it can be anything you like. Note that while entering your password, nothing will appear on the screen. This is completely normal (it's a security feature to protect your password).

The installation instructions shown here will install the Ubuntu distribution of Linux -- a great distro to use if you are new to Linux!

If you are less new to Linux and have feelings about your distro, you can see a list of available distros in WSL with the command:

> wsl --list --online

You can choose any distro from this list and install it with the command:

>wsl --install -d

The user account you create will be an administrative account with sudo permissions. You'll need to type the password you choose to run such commands.

Interacting with WSL

You will interact with your new WSL distribution primarily through a command-line interface such as the bash shell (the default shell for Ubuntu systems). The learning curve for such an interface can seem intimidating -- but it's less complicated than it appears! Your next steps may include:

  • An intro to bash, the shell you interact with by typing commands.
  • An intro to vim, a command-line text editor you can use to create and modify text files within your terminal.
  • Learning more about the package manager for your chosen distro (for Ubuntu, this is apt), which you use to install and update programs and utilities within Linux.
  • You may find that working with your local Linux environment makes you more comfortable with remote Linux machines you access via ssh.