Running Unix on Windows 11 opens up a world of powerful tools for developers, students, and tech enthusiasts.

With Unix-like environments, you can execute commands like grep, awk, or bash right from your Windows PC.

Thanks to modern advancements, setting this up is easier than ever. In this guide, weโ€™ll walk you through installing a Unix-like system on Windows 11 using the Windows Subsystem for Linux (WSL), ensuring a seamless and beginner-friendly experience.

Step 1: Enable Windows Subsystem for Linux (WSL)

The easiest way to run a Unix-like environment on Windows 11 is through WSL, which lets you install Linux distributions like Ubuntu. Hereโ€™s how to set it up:

  1. Open PowerShell as Administrator:
    • Press Windows + S, type PowerShell, right-click it, and select Run as administrator.
  2. Install WSL:
    • Type the command wsl โ€“install and press Enter. This command automatically:
      • Enables WSL and the Virtual Machine Platform.
      • Downloads and installs the latest version of Ubuntu as the default Linux distribution.
    • If you see a prompt to restart your PC, do so to complete the setup.
  3. Verify Installation:
    • After restarting, open PowerShell again and type wsl โ€“list or wsl -l. You should see Ubuntu listed as an installed distribution.

This single command simplifies what used to be a multi-step process, making WSL accessible to everyone.

Step 2: Set Up Your Linux Distribution

Once WSL is enabled, youโ€™ll need to configure your Unix-like environment:

  1. Launch Ubuntu:
    • After the WSL installation, Ubuntu should automatically open in a terminal window. If not, search for Ubuntu in the Start menu and click it.
  2. Create a User Account:
    • Ubuntu will prompt you to set a Unix username and password. These donโ€™t need to match your Windows credentials.
    • Example: Enter john as the username and create a secure password like MyPass123!.
    • Note: The password wonโ€™t display as you type for security reasonsโ€”just press Enter when done.
  3. Update the System:
    • To ensure your Unix environment is current, run these commands in the Ubuntu terminal:
      sudo apt update
      sudo apt upgrade -y
    • sudo runs commands with elevated privileges, apt update refreshes package lists, and apt upgrade -y installs updates without prompting for confirmation.

Step 3: Customize Your Unix Experience

To make your Unix environment more powerful, consider these enhancements:

Install a Different Linux Distribution

Ubuntu is great, but you might prefer another Unix-like system, such as Debian or Kali Linux. To install a different distribution:

  1. Open the Microsoft Store.
  2. Search for Linux, and choose a distribution like Debian or Kali Linux.
  3. Click Install, then launch it from the Start menu.
  4. Set it as the default by running wsl โ€“set-default <distro-name> in PowerShell (e.g., wsl โ€“set-default Debian).

Upgrade to WSL 2

WSL 2 offers better performance and full system call compatibility. To switch:

  1. In PowerShell (as administrator), type wsl โ€“set-version <distro-name> 2 (e.g., wsl โ€“set-version Ubuntu 2).
  2. If prompted, download the WSL 2 Linux kernel update from the

Install Windows Terminal

For a polished command-line experience, install Windows Terminal from the Microsoft Store. It lets you run multiple shells (PowerShell, Ubuntu, etc.) in tabs and supports customization like themes and fonts.

Step 4: Run Unix Commands and Tools

With your environment set up, you can start using Unix commands. Try these in your Ubuntu terminal:

  • 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 text in files.
  • man command: Shows help for a command (e.g., man ls).

To install additional tools, use:

  • sudo apt install git for version control.
  • sudo apt install python3 for Python development.
  • sudo apt install vim for a powerful text editor.

You can access your Windows files from Linux at /mnt/c (e.g., cd /mnt/c/Users/YourUsername).

Step 5: Run Graphical Unix Applications (Optional)

Want to run Unix apps with a graphical interface, like GIMP or Firefox? WSL 2 supports GUI apps on Windows 11. Hereโ€™s how:

  1. Ensure youโ€™re using WSL 2 (check with wsl โ€“list โ€“verbose).
  2. Install a graphical app, e.g., sudo apt install gimp.
  3. Launch it by typing gimp in the terminal. The app will appear on your Windows desktop.

If you encounter issues, install an X server like VcXsrv and configure it per the Microsoft WSL GUI guide.

Conclusion

Installing a Unix-like environment on Windows 11 with WSL is a game-changer for anyone wanting to blend the power of Unix with the familiarity of Windows.

By following these stepsโ€”enabling WSL, setting up a Linux distribution, and customizing your setupโ€”youโ€™ll have a robust Unix environment ready for coding, scripting, or learning. Whether you stick with Ubuntu or explore other distributions, the possibilities are endless.

LEAVE A REPLY

Please enter your comment!
Please enter your name here