What Is Windows Subsystem for Linux (WSL)?
Windows Subsystem for Linux (WSL) is an installable feature in Windows that lets you run a Microsoft Store-supported Linux distro on a Windows 10 or Windows 11 device. Microsoft has partnered with Canonical (the publisher of Ubuntu) to bring its bash command line capabilities to a typical Windows desktop so that you can integrate both Linux and Windows into your workflow. WSL supports Linux file systems using commands for Bash but cannot offer a full Linux desktop experience, which is only possible with a virtual machine or dual-boot procedure. From Windows 11 onward, WSL supports native Linux GUI applications, such as Gedit, GIMP, and Nautilus in conjunction with Bash. To a Linux user who likes using the command line tools, WSL feels very natural and normal. It’s quite useful for Windows developers, too, who want to deploy Windows applications to Linux server environments.
Linux Distros That Work with WSL
To work with your favorite Linux distro in WSL, first ensure it can be downloaded from the Microsoft Store. Supported examples include:
UbuntuDebianKali LinuxSUSE Linux Enterprise Server Fedora Remix for WSL (Paid version)openSUSE LeapAlpine Linux
WSL Benefits: What You’ll Get
The following are the main benefits of using WSL on your Windows device:
Having Linux on top of Windows: you’ll end up with a Linux virtual machine you can run on Windows. You can have any of your favorite distro installed and running at the same time. Run Linux apps as standalone Windows applications: whether you want to launch Linux apps from the Windows Start menu or pin them to the Windows taskbar, WSL lets you access them from your Windows desktop.Switch between Windows and Linux: you can switch quickly between Linux and Windows and, perhaps most importantly, access your Windows files and programs from inside the Linux shell. WSL is perhaps the only software that allows Cut and Paste across Windows and Linux apps.Support for cross-platform languages and services: with WSL in place, you can run advanced programs between two integrated operating systems. These include vim, emacs, NodeJS, Python, Ruby, C/C++, Rust, Go, MySQL, Apache, and MongodB.Supports Windows applications for Linux user habits: are you a frequent Linux user? Now you can bring your favorite Linux commands to a Windows desktop without having to deal with its user interface. Whether you want to edit a Word file or run Notepad++, you can easily do it the Linux way.
On the other hand, if you’re a Windows user who has never used Linux before, you’ll need to learn some basic Linux commands to get started. Don’t worry. There aren’t too many of them for a Windows user’s needs.
Installing and Setting Up WSL in Windows 10
You’ll need to be running an up-to-date version of Windows 10 for this to work, but that’s just about the only requirement apart from knowing how to use Windows PowerShell or Command Prompt. The instructions below will set you up with the most recent version of Windows Subsystem for Linux (WSL2, Build 21354 as of September 2021). Note: the password is invisible, so make sure you store it in a safe place. If you forget your password, you’ll have to uninstall the Linux distro, which will delete all your Linux files.
Using WSL with Windows
If you want, you can use your Linux installation as its own system on Windows, with totally separate files and programs. You may want some files stored on Linux for its speed advantages, but one of the big perks of WSL is that you can interact with your Windows files and folders by effectively mounting the drive to your Linux system. This enables you to use Linux with anything you have on Windows, thus keeping all your stuff in the same place. Now that you’ve learned how to install Linux using WSL on your Windows 10 device, it’s time to familiarize yourself with its basic commands.
Basic Linux Commands
If you’re familiar with Linux command line navigation, you can skip down a little bit. Otherwise, the following are some basic commands you’ll need to know to move around in a Linux command line. Using Linux commands in a Windows shell like PowerShell or command prompt is easy. Just use: This will execute the Linux command on Windows without opening the actual operating system. Check the below screenshot to see all the above highlighted commands in action. or Eventually, though, you’ll probably wonder how to access Windows directories from inside your Linux system itself. The key here is that Windows is essentially mounted as an external drive to the Linux system, so Linux can use it as storage, making it pretty much the same as using your OS to edit files on a flash drive. Enter a few words, then press Ctrl + O to save and Ctrl + X to exit. If you’d like, you can navigate to any other folder or document on your Windows drive and edit it using Ubuntu. The . at the end stands for the current directory, and if you include it, explorer.exe will launch a Windows Explorer window that shows your Linux files. launches Notepad.
Run Linux GUI Apps in Windows 11
So far we’ve seen how to run Linux with the command line in Windows 10. From Windows 11 onward, it is now possible to have a limited GUI experience on Windows Subsystem for Linux (WSL). You have to at least be on a Windows 11 build 22000 or higher to enjoy the GUI apps for Ubuntu or any other supported distro package. We have seen how to install and launch GUI apps in your Linux Bash terminal. If you know the relevant Linux commands, you can start trying them out in Windows.
1. How do I uninstall WSL or Linux distros from my Windows PC?
You can uninstall WSL and its distros using PowerShell/Command line or from “Add or remove programs” in Windows 10/“Apps and Features” in Windows 11. To uninstall any configured Linux distro using PowerShell in a Windows PC, use the following command in Admin mode: To verify that the distro has been uninstalled, use: To differentiate WSL from PowerShell, enter the following which will give a list of installed applications. You can further use wsl –- help to be guided toward the uninstallation. Of course, the easier way to uninstall WSL is to access it in your list of apps and click the Uninstall button. The following screen is for Windows 11.
2. Where are my WSL files stored on a Windows device?
To access WSL files on a Windows 10/11 device for any installed distro, search for the %LOCALAPPDATA% hidden folder in C drive.
3. Is Windows Linux Subsystem safe to use?
Yes. The host Windows system always has full control over the guest Linux subsystem. As long as you have enabled security features in Windows with Windows Defender and corrected the Setting errors in Defender file, your virtual Linux subsystem is safe to use.
What Else Can You Do?
Now that you know how to install Linux on Windows 10 and 11 and how it interacts with Windows, you can do just about whatever you want. You can run programming languages, run local servers, use a Windows IDE to work in the Linux shell, run multiple Linux distros at the same time, or just play around with Linux to get comfortable with the command line. The price of failure is pretty low. If you mess something up, resetting or reinstalling your Linux distro is pretty easy. To work with bash prompts, check the best options available. While you’re running a Linux subsystem on Windows, check out some of the best Linux games to play on your Windows PC.