How to Install Windows Subsystem for Linux in Windows 11
The software version of a turducken
It seems odd to invite the competition in, but Microsoft now lets you run Linux inside Windows. It’s easier to install than you think and more flexible and powerful than we imagined.
Why Install Windows Subsystem for Linux?
It seems contradictory to install one operating system (OS) inside another. What’s the point? And why Linux? We can think of six reasons to use Linux in Windows off the top of our heads.
The most obvious answer is that Linux is free. But what good is something free if it’s hard to use? The good news is that Windows Subsystem for Linux (WSL) is easy, simple, and fast to install or uninstall, so it’s worth trying if you’re just curious about Linux.
If you don’t want to install a virtual machine (VM) host like Hyper-V, VirtualBox, or VMWare, WSL is the way to go. It takes up less space and resources like CPU and RAM too.
At the time of writing, 17 Linux distributions (or “distros”) were available in the Microsoft Store. These include different versions and variations of Ubuntu Desktop and Server, Debian, Kali, SUSE Linux Enterprise Server, OpenSUSE, and Oracle Linux.
You also can use the following PowerShell command to see all available distros:
wsl –list –online
You could learn about Linux andvarious Linux distroslike Ubuntu, Debian GNU/Linux, Kali, and Alpine WSL for work or school. Linux has a significant market share of servers, and more organizations are using Linux for the desktop.
Students can use it for tutorials instead of going to the computer lab. Security researchers can useKali and other Linux hacking distrosand its many included tools. Many web developers, programmers, and artificial intelligence researchers may use Debian or Alpine WSL as their development environment as they have built-in developer tools.
Most open-source software (OSS) is developed first for a Linux environment. As a result, OSS is becoming the standard in several industries, like game development, graphic design, and Internet of Things (IoT) embedded systems.
Consider all the open source software, which is often free. Wish you had Photoshop? Consider using GIMP. Want to learn CAD but can’t afford AutoCAD? Try OpenSCAD. Want to take your video editing to the next level, but Adobe Premiere is out of reach? Linux has Openshot.
Even more impressive is that you can run these Linux GUI apps in their windows as if they were Windows apps. There’s no need for a separate virtual machine in Hyper-V, VirtualBox, or a second physical computer. You could use Visual Studio in Windows and do photo edits in GIMP on Linux without disturbing your workflow.
If you’re a fan ofWindows Terminaland its multi-tab feature, you’ll love that you can run several Linux distros simultaneously, each in its own tab.
Should I use WSL 1 or WSL 2?
There are two versions of WSL: WSL 1 and WSL 2. WSL defaults to version 2. That’s fine for most people. However, if you’re not sure your system can handle a full Linux kernel install, or you will not use things like Docker, then WSL 1 is fine.
The version is easy to update if you change your mind. As an administrator,open PowerShellor the Command line and use the following wsl.exe command:
wsl –set-default-version 2orwsl –set-default-version 1
Install Windows Subsystem for Linux with PowerShell
You can install WSL with eitherPowerShellor the command line interface (CLI). If you haven’t learned PowerShell, that’s okay. The wsl.exe commands work in either.
If the wsl.exe help text shows, WSL is already installed.
It takes a few minutes to install and then prompts you to reboot Windows.
Note:This installs the bash shell for Ubuntu. It’s not the graphical user interface (GUI). There are additional steps and prerequisites to enable that. However, you can now use Linux bash shell commands on your Windows computer.
Install Windows Subsystem for Linux with Control Panel
The installation begins. When it’s done, theWindows needs to reboot your PCmessage shows. SelectRestart now.
After the restart, openUbuntu on Windowsfrom theStartmenu, or in PowerShell or Command Prompt, use thewsl.execommand.
How Do I Uninstall Windows Subsystem for Linux?
To remove WSL, you must uninstall any Linux operating systems first. You can then remove the supporting components in Windows. It’s easiest to do this through Windows settings.
How Do I Access the Linux File System from Windows?
Unlike using Linux in a virtual machine, it’s easy to access Windows files from Linux and vice versa.
OpenFile Explorerand selectLinuxin the navigation pane on the left. When moving files between Windows and Linux, make sure you use a copy, not the original. There are some filetype compatibility issues, and sometimes the file gets corrupted.
How to Fix the Error Message “wsl.localhost is not accessible”
You may get this error the first time you open the Linux filesystem through File Explorer.
Windows treats this connection like a physical connection between Windows and Linux computers. So you must tell it the network exists and is accessible. You’ll do this through theWindows Registry. If you’re not comfortable working in the Registry, ask someone who is. A mistake in the Registry can cause Windows to stop working. Always make a backup of the Registry, too.
HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlNetworkProvider/HwOrder
You can open the Ubuntu filesystem through Windows File Explorer now. If the error persists, restart Windows, and it should work.
How Do I Access the Windows File System from Linux?
cd users/username/documents
If you need to access something else, just usecdandlsuntil you find it. Ensure you only copy files, not move them, due to the risk of corrupting the file.
What Else Can I Do With Windows Subsystem for Linux?
When you enable WSL, you’ve got an entire Linux environment on your Windows computer. Or maybe several Linux environments. Whatever you can think of doing in Linux, you can now do. Take a look at our Linux-related articles and tutorials to get some ideas.
Guy has been published online and in print newspapers, nominated for writing awards, and cited in scholarly papers due to his ability to speak tech to anyone, but still prefers analog watches.Read Guy’s Full Bio
Welcome to Help Desk Geek- a blog full of tech tips from trusted tech experts. We have thousands of articles and guides to help you troubleshoot any issue. Our articles have been read over 150 million times since we launched in 2008.
HomeAbout UsEditorial StandardsContact UsTerms of Use
Copyright © 2008-2024 Help Desk Geek.com, LLC All Rights Reserved