This guide shows you how to run Linux command-line tools directly on Windows 11 without the overhead of a virtual machine. You’ll use the Windows Subsystem for Linux (WSL) to get a real Linux environment where you can install and run tools like grep, curl, git, and Python natively. Before you start, make sure your PC is up to date and you have administrative access to enable the required Windows features.
What You’ll Need
- Windows 11 (any edition, 64-bit)
- Administrator account on the PC
- Internet connection to download the Linux distribution
Step-by-Step
- Open PowerShell as Administrator – Right-click the Start button and select “Terminal (Admin)” or “Windows PowerShell (Admin)”. If prompted by User Account Control, click “Yes”.
- Enable WSL – In the admin terminal, run the command:
wsl --install. This command enables the required Windows features (Virtual Machine Platform and Windows Subsystem for Linux) and automatically installs the default Linux distribution (usually Ubuntu). - Restart your PC – When the installation finishes, you’ll be asked to restart. Save your work and restart to complete the setup.
- Finish setup – After restarting, the Linux distribution will finish installing. You’ll see a terminal window open (or you can open it from the Start menu). Follow the prompts to create a username and password for your Linux environment.
- Update your Linux packages – Once you’re at the Linux command prompt, run
sudo apt updateand thensudo apt upgradeto make sure all software is current. - Install Linux tools – Use the package manager to install what you need. For example, to install common tools like git, curl, and build-essential, run:
sudo apt install git curl build-essential. You can install almost any Linux tool this way. - Run tools from Windows – You can now run Linux commands directly from Windows PowerShell or Command Prompt by typing
wslfollowed by the command, e.g.,wsl grep --version. Or just typewslto enter the Linux shell and work there. - Access your Windows files – Your Windows drives are mounted under
/mnt/c/in the Linux environment. For example, to navigate to your Windows user folder, typecd /mnt/c/Users/YourName.
Common Mistakes
- Skipping the restart – WSL won’t work until you restart. If you skip it, the terminal will show an error about enabling the Virtual Machine Platform.
- Using the wrong command prompt – Some older tutorials tell you to enable “Windows Subsystem for Linux” via Control Panel. The
wsl --installcommand does this automatically, but if you manually enable the feature without the Virtual Machine Platform, you’ll get a “WSL2 requires an update” error. - Forgetting to set a password – The Linux environment requires a username and password. If you skip it, you won’t be able to use
sudo. - Installing tools without updating – If you don’t run
sudo apt updatefirst, you may get “package not found” errors because the package lists are empty.
Tips
- Use WSL2 – WSL2 is the default and gives you full system call compatibility. It’s much faster and more reliable than WSL1.
- Set your default distribution – If you install multiple distros, set the default with
wsl --set-default <distro>. - Run Linux GUI apps – With WSLg (included in recent versions), you can run graphical Linux apps like gedit or GIMP directly from Windows.
- Use Windows Terminal – Windows Terminal gives you tabs and better customization for both Windows and Linux shells. It’s free from the Microsoft Store.
- Share environment variables – You can set Windows environment variables that WSL picks up, making it easier to share paths and settings.
Troubleshooting
“WSL is not installed” error: Run wsl --install again, then restart. If it still fails, check that virtualization is enabled in your BIOS (look for Intel VT-x or AMD-V).
“The requested operation is not supported” error: This usually means the Virtual Machine Platform is not enabled. Run dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart in an admin terminal, then restart.
“WSL 2 requires an update” error: Download and install the latest WSL2 kernel update from the Microsoft website, or run wsl --update in an admin terminal.
No internet in WSL: Check your DNS settings. Try sudo nano /etc/resolv.conf and add nameserver 8.8.8.8. If that fixes it, you may need to disable and re-enable the WSL network adapter in Windows.
Forgot your Linux password: From PowerShell, run wsl --user root to enter as root, then use passwd <username> to reset it.
Frequently Asked Questions
Is WSL the same as a virtual machine?
No. WSL runs a lightweight Linux kernel in a virtualized environment that shares the Windows kernel, using far less memory and starting instantly. It’s not a full VM with a separate OS.
Can I run Linux GUI applications?
Yes, with WSLg (included in Windows 11), you can run Linux GUI apps directly. Just install them with apt and launch them from the Linux terminal.
How do I uninstall a Linux distribution?
Go to Settings > Apps > Installed apps, find the distribution (e.g., Ubuntu), and uninstall it. You can also use wsl --unregister <distro> to remove the environment completely.
Can I access my Windows files from Linux?
Yes, your Windows drives are mounted under /mnt/c/, /mnt/d/, etc. You can read and write files there.
Do I need to enable Hyper-V?
No, WSL2 uses the Virtual Machine Platform, which is separate from Hyper-V. You don’t need to enable Hyper-V, and it works on Windows 11 Home.
Can I run Docker inside WSL?
Yes, Docker Desktop integrates with WSL2, and you can also install Docker Engine directly inside the Linux environment.
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- Fix Windows Could Not Prepare the Computer to Boot
- Windows 11 Security Settings: Best Config Guide
- Set a Google Play Budget & Stop Accidental Purchases
- Destiny 2 Error Code Anteater: Fixes & Causes
- View Android Photos on Chromebook: Step-by-Step
- Install Custom Recovery on Samsung Galaxy Trend