EECS 280 Tutorials

Windows Command line tools (WSL)

The Windows Subsystem for Linux (WSL) runs an Ubuntu Linux guest virtual machine on your Windows host machine.

When you see $ in this tutorial, you should type into your shell the command that comes after the $.

Upgrade Windows

We recommend Windows 11. Windows 10 version 2004 build 19041 and higher will also work. Here’s how to check your Windows version.

Free Windows upgrades are available for UM students via OnTheHub. If you have an older Windows machine and are not able to upgrade, please reach out to course instructors for assistance.

Install Windows Subsystem for Linux (WSL)

Start PowerShell and run it as administrator. Search for PowerShell in the start menu, then right-click and select “Run as administrator”. (Note: these instructions are based on the instructions from Microsoft.)

Check if WSL was already installed. If you see this, WSL is already installed.

C:\WINDOWS\system32> wsl -l -v
* Ubuntu    Stopped     2

If you see the WSL help text, WSL is not installed.

C:\WINDOWS\system32> wsl -l -v
Copyright (c) Microsoft Corporation. All rights reserved.
Usage: wsl.exe [Argument]

Install WSL.

C:\WINDOWS\system32> wsl --install

Pitfall: Make sure Windows Update is enabled and your machine is up-to-date. Settings > Update and Security > Windows Update.

Pitfall: If you still get an error from wsl --install, try the Manual installation steps.

For the Linux distribution, choose the latest version of Ubuntu LTS. At the time of this writing, that’s Ubuntu 22.04 LTS.

Restart your computer.

Start PowerShell as administrator, and check that the VERSION is 2.

C:\WINDOWS\system32> wsl -l -v
* Ubuntu    Stopped     2

If the VERSION is 1, you must upgrade to WSL 2.

Open terminal

Start an Ubuntu Bash shell.

Install CLI tools

Use the apt package manager to install a few command line programs. Linux users will run this same command.

$ sudo apt update
$ sudo apt install g++ make rsync wget git ssh gdb python3 tree

Use CLI tools

Now would be a great time to take a look at our CLI Tutorial.


Accessing Linux files from Windows

To access Linux files from the Windows File Explorer, click the Linux icon. You may need to scroll down.

Navigate to your home directory: Linux > Ubuntu > home > awdeorio. Your username will be different.

Pro-tip: Right click your Linux home directory and choose “Pin to Quick access”.

It should now show up under “Quick access” in the left sidebar.

To open the File Explorer in any directory at the WSL (Ubuntu) Terminal:

$ explorer.exe .

Accessing Windows files from Linux

To access Windows files from Linux, navigate to /mnt/c/.

For example, here’s how to access your Windows Desktop. Your username will be different.

$ cd /mnt/c/Users
$ ls
'All Users'  'Default User'   defaultuser0   awdeorio   Default   Public   defaultuser100000   desktop.ini
$ cd awdeorio
$ ls
... Desktop  Downloads ...
$ cd Desktop

CLI open file

Opens a file or directory with the default application, like a double click. See the wslview command in the CLI tutorial.

Copy paste

Copy: ctrl + shift + c

Paste: ctrl + shift + v

If Copy/Paste doesn’t work, read on to enable it.

Enable copy paste

These instructions show how to enable WSL Copy/Paste on Windows 11 H2 or newer.

Right click on the window pane header of your Ubuntu WSL terminal. Click on the Settings option in the drop down menu.

Pitfall: If your dropdown contains the option “Properties” follow the instructions for Older versions of windows.

Click on the Actions tab on the left side of the settings window.

Confirm that the “Copy text” and “Paste text” bindings exist. You may need to scroll down. Add them if needed using the “Add new” button.

Enable copy paste on older Windows

These instructions show how to enable WSL Copy/Paste on version of Windows older than 11 H2.

Click on the properties option in the dropdown.

Enable “Use Ctrl+Shift+C/V Copy/Paste” option in the Console “Options” properties page


Original document written by Andrew DeOrio

This document is licensed under a Creative Commons Attribution-NonCommercial 4.0 License. You’re free to copy and share this document, but not to sell it. You may not share source code provided with this document.