Working with Windows Subsystem for Linux (WSL)
WSL is a way that you can run Linux distributions under Windows without dual-booting or running virtualization software like VMWare or Virtual Box.
- Importing a Distribution
-
You will use WSL in several upper-level Computer Science classes. Most of them will provide a custom Linux image for you to use in class. Follow these steps to import an image provided by your instructor. Or watch a 2-minute video if you prefer (opens in a new tab).
- Start a Windows command prompt by searching for cmd.
- Locate the file containing the Linux image; usually this will be in your courses' folder in the Computer Science Students Google Shared Drive.
- Pick a location where you'd like to store the files for the image. Don't store the
files on Google Drive, Drop Box, OneDrive, or any other cloud-based file system
If you're not sure, you can use %USERPROFILE%\Documents\CSCIXXX, where XXX is your course number. - Execute the following command:
wsl --import Distro VMPATH FILE
where:- Distro is the name you'd like to give the distribution (e.g. CSCI361)
- VMPATH is the folder you chose to store the files for the image
- FILE is the name of the file containing the image
Note this could take 5–10 minutes depending on the speed of your computer.
- Starting and using a Distribution
-
The best way to run your distribution is via the Windows Terminal application. Terminal provides a tabbed interface, allowing you to have several concurrent sessions without having lots of windows open.
Terminal will start either a Command Prompt or PowerShell instance by default. You can easily change that by pressing Ctrl - Comma to open the settings page, and then changing the Default Profile.
Usually your instructor will have created a non-root account for you to use, but will have given that user sudo privileges to allow you install new software as needed.
Watch this four-minute video to get a tour of the WSL filesystem and learn how to edit code using Visual Studio Code.
- For more information
- You can learn more about WSL by browing Microsoft's WSL documentation (opens in a new tab).