How to Install Unix on Windows 11 Using WSL: A Comprehensive Guide

  • Thread Author

A laptop screen displays colorful code or data columns in a modern office setting.Installing Unix on Windows 11: A Step-by-Step Guide​

Imagine having the power and flexibility of Unix right on your Windows 11 desktop without having to dual-boot or rely on a virtual machine. Thanks to the Windows Subsystem for Linux (WSL), developers, students, and tech enthusiasts can effortlessly tap into a Unix-like environment for running powerful command-line tools such as grep, awk, bash, and more. This guide will take you through every step to ensure a seamless and beginner-friendly experience, whether you’re new to Unix or just looking to enhance your development toolkit.

Why Run Unix on Windows 11?​

Before diving into the installation, it’s important to understand why integrating a Unix-like system can enrich your computing experience:
  • Development Ecosystem: Unix environments provide native access to a host of programming languages and tools. If you’re coding in Python, Ruby, or even using version control systems like git, having a Unix command line can streamline your workflow.
  • Seamless Command-Line Experience: Unix commands are renowned for their efficiency. Whether you’re listing files with ls or processing text with awk, these commands can significantly improve productivity.
  • Interoperability: With WSL, you can access your Windows files from the Unix shell and vice versa. This harmony between two systems is perfect for managing projects that involve both Windows-specific and Unix-specific tools.
  • Learning Opportunity: Unix’s prevalence in the world of servers and cloud infrastructure means that learning Unix commands and systems not only broadens your technical skill set but also prepares you for future professional endeavors.

Step 1: Enabling Windows Subsystem for Linux (WSL)​

The journey to run Unix on Windows starts with enabling WSL—an essential component that allows you to run Linux distributions directly on your desktop. Here’s how to do it:

Launch PowerShell with Administrative Privileges​

  • Press Windows + S and type PowerShell.
  • Right-click on PowerShell and select “Run as administrator.”

Install WSL with a Single Command​

Once you have the PowerShell open in administrator mode, simply type the following command:
wsl --install
This command does more than one thing:
  • Enables WSL: It activates the Windows Subsystem for Linux feature.
  • Sets Up Virtual Machine Platform: It automatically enables the Virtual Machine Platform necessary for WSL.
  • Downloads and Installs Ubuntu: It fetches the latest version of Ubuntu—the default Linux distribution—setting it up for first use.
If the command instructs you to restart your computer, go ahead and complete the process. After restarting, open PowerShell again and verify the installation with:
wsl --list
You should see Ubuntu listed among your installed distributions.

Key Takeaways​

  • WSL simplifies running a Unix-like environment on Windows 11.
  • A single command removes much of the complexity traditionally associated with setting up Unix on a Windows system.
  • Restarting your PC might be required to finalize the setup.

Step 2: Setting Up Your Linux Distribution​

After WSL is enabled, the next step is configuring your chosen Unix-like environment. Ubuntu, being the default, is user-friendly and ideal for beginners.

Launch Your Installed Distribution​

  • After the WSL installation process, Ubuntu should open automatically in a terminal window.
  • If not, search for “Ubuntu” in the Start menu and launch it.

Create a Unix User Account​

Upon the first launch, the terminal will prompt you to create a new user account:
  • Enter a username (for example, “john”).
  • Set a secure password. Note that the password will not appear as you type, but it is being recorded for security purposes.

System Updates and Upgrades​

To ensure your Unix-like environment is up-to-date, run these commands in your terminal:
Code:
sudo apt update
sudo apt upgrade -y
  • sudo: Executes the command with elevated privileges.
  • apt update: Refreshes the package lists.
  • apt upgrade -y: Installs all available updates without further prompts.

Summary​

This step lays the groundwork for a personalized Unix environment:
  • A new user account is created.
  • Essential system updates ensure smooth performance.
  • Minimal setup steps help prevent errors during the process.

Step 3: Customizing Your Unix Experience​

One of the real joys of working in a Unix-like environment is the ability to tailor it to your exact needs. Let’s explore some customization tips:

Explore Alternative Linux Distributions​

While Ubuntu is a popular choice, you aren’t locked in. Here’s how to install another distribution:
  • Open Microsoft Store: Search for “Linux” to find alternatives such as Debian or Kali Linux.
  • Install & Launch: Click on your desired distribution, install it, and launch it from the Start menu.
  • Set as Default: In PowerShell, run:
    wsl --set-default <distro-name>
    Replace <distro-name> with your chosen distribution’s name (e.g., Debian).

Upgrading to WSL 2 for Enhanced Performance​

WSL 2 brings better performance and full system call compatibility:
  • In PowerShell as an administrator, type:
    wsl --set-version <distro-name> 2
    For example, to upgrade Ubuntu, type:
    wsl --set-version Ubuntu 2
  • If prompted, download the necessary kernel update.

Installing Windows Terminal​

Windows Terminal offers an elegant command-line experience with support for multiple tabs, customization options, and an aesthetically pleasing interface. It’s available in the Microsoft Store:
  • It allows you to run multiple shells (e.g., PowerShell, Ubuntu) concurrently.
  • Theme and font customizations help personalize your terminal experience.

Frequently Used Unix Commands​

To familiarize yourself with Unix, try these basic commands:
  • ls: Lists files in the current directory (similar to dir in Windows).
  • cat filename: Displays the contents of a file.
  • grep “pattern” filename: Searches for specific text within files.
  • man command: Opens the manual for any command (for example, man ls).

Summary of Customizations​

  • Switching or installing additional distributions offers flexibility.
  • WSL 2’s upgrade improves performance significantly.
  • Windows Terminal enhances usability, making the Unix environment more user-friendly.

Step 4: Installing Essential Tools for Development​

A Unix environment isn’t just about executing commands—it’s an ecosystem where a multitude of tools come together to create a productive workspace. Here are some essential tools you might find useful:

Version Control with Git​

Version control is a cornerstone of modern development. To install git on your Unix environment, type:
sudo apt install git
This command allows you to manage your project histories and collaborate with other developers using git repositories.

Python Development​

Python remains a staple in many development and scripting tasks. To install Python 3, simply run:
sudo apt install python3
Couple this with pip (Python's package installer) to expand your development toolkit.

Editing Text with Vim​

For those who prefer working within the terminal, Vim is an incredibly powerful text editor. Install it using:
sudo apt install vim
Vim’s robust features and keyboard shortcuts become invaluable as you progress in your Unix journey.

Exploring More Tools​

  • Package Managers: Learn to manage packages using apt to install software like curl, wget, or build-essential.
  • Customized Shells: Experiment with configuring your shell, tweaking the prompt, or installing extensions such as Oh My Zsh to improve your command-line experience.

Summary​

Installing development tools transforms your Unix environment into a versatile, programming powerhouse:
  • Tools like git, Python 3, and Vim cover fundamental development needs.
  • The customization potential ensures that your environment evolves as your projects grow.

Step 5: Running Graphical Unix Applications​

For users whose work involves graphical applications, WSL 2 offers the ability to run GUI Unix apps seamlessly—an exciting development for video editors, graphic designers, or those who need more than just command-line tools.

Running GUI Apps on Windows 11 via WSL​

WSL 2 includes support for running Linux GUI applications:
  • Verify Your Version: Check that you are using WSL 2 by entering:
    wsl --list --verbose
  • Install a Graphical Application: For example, to install GIMP, run:
    sudo apt install gimp
  • Launch the Application: Simply type gimp in the terminal. The application should appear on your Windows desktop.

Troubleshooting Graphical Apps​

  • X Server Installation: If the GUI app fails to launch, consider installing an X server such as VcXsrv. Follow the official configuration guides to ensure compatibility with WSL 2.
  • Performance Tweaks: If the application window lags or doesn’t interact as expected, review your WSL and Windows graphics settings for adjustments.

Summary​

Running graphical applications bridges the gap between Unix command-line power and modern desktop experience:
  • GUI functionality means you can enjoy the full desktop application experience within your Unix environment.
  • Troubleshooting options like installing an X server provide robust solutions for potential issues.

Conclusion​

Setting up a Unix-like environment on Windows 11 via WSL marks a transformative step for those eager to combine the best of both operating systems. Let’s recap the key steps:
  • Enabling WSL: A single command in PowerShell sets the stage for running a Unix system on your Windows 11 PC.
  • Configuring Ubuntu (or an alternative): Creating a dedicated user account and updating the system are simple yet fundamental tasks.
  • Customizing the Experience: From switching distributions to using Windows Terminal, you can tailor your environment to your preferences.
  • Installing Essential Tools: Version control, development languages, and text editors enrich your productivity.
  • Embracing Graphical Applications: WSL 2 enables you to run full-featured graphical Unix applications, blending command-line efficiency with desktop functionality.
By following this guide, you’re not only installing a Unix environment—you’re stepping into a world where cross-platform productivity reaches new heights. Whether you’re a developer looking to streamline your coding tasks, a student eager to learn the intricacies of Unix commands, or simply a tech enthusiast ready to explore new horizons, Windows 11 combined with WSL offers endless possibilities.
As you become more comfortable with the Linux command line, you might experiment with scripting, automation, and even server management within your familiar Windows ecosystem. With continuous updates and improvements in both Windows 11 and WSL, the integration will only grow stronger, supporting emerging software and advanced functionalities.
So, fire up PowerShell, type that wsl --install command, and begin your Unix journey on Windows 11 today. This fusion of technology not only empowers your present projects but also prepares you for the future of cross-platform development—where the command line meets innovation with every keystroke.

Embrace this unique blend of environments, and let your creativity and technical prowess flourish in a setup that is as robust as it is flexible. Happy coding, and welcome to the power of Unix on Windows 11!

Source: TechDator How to Install Unix on Windows 11 (Simple Guide)
 
Last edited: