Windows Subsystem for Linux (WSL) provides a way to run Linux distributions like RHEL (Red Hat Enterprise Linux) or Fedora directly on Windows, removing the need for dual-booting or virtual machines. This setup streamlines workflows for developers and system administrators who need access to Linux tools while working in a Windows environment. Running RHEL or Fedora on WSL optimizes compatibility testing, package development, and command-line utilities without leaving Windows.
Install Fedora on Windows Subsystem for Linux (WSL)
Step 1: Open PowerShell as Administrator. This is necessary to install or configure WSL and Linux distributions. Type powershell
in Windows search and select Run as administrator
.

Step 2: Enable WSL and Virtual Machine Platform features. These are required for running Linux distributions on Windows. Enter the following command:
wsl --install

This command installs WSL and the default Ubuntu distribution. If you already have WSL enabled, you can skip this step. To ensure WSL 2 is being used, run:
wsl --set-default-version 2

Step 3: Download the Fedora WSL image. Fedora does not appear in the Microsoft Store by default, so you need to use a custom image. Go to the official Fedora WSL release page or a trusted source and download the latest Fedora root filesystem tarball (for example, Fedora-WSL.tar.xz
).
Step 4: Create a directory for your Fedora installation. This keeps your WSL distributions organized. For example, run:
mkdir C:\WSL\Fedora

Step 5: Import the Fedora image into WSL. Use the wsl --import
command to register your Fedora distribution:
wsl --import Fedora C:\WSL\Fedora C:\path\to\Fedora-WSL.tar.xz --version 2

Replace C:\path\to\Fedora-WSL.tar.xz
with the path to your downloaded tarball. This step sets up Fedora as a new WSL distribution using WSL 2.
Step 6: Launch your new Fedora WSL instance. Run:
wsl -d Fedora

This opens a new shell session in your Fedora environment. On first launch, you may need to create a default user and set a password.
Step 7: Update Fedora packages. Keeping packages up to date improves security and reliability. Inside the Fedora WSL shell, run:
sudo dnf update -y

Install additional packages as needed for your workflow.
Install RHEL on Windows Subsystem for Linux (WSL)
Step 1: Confirm WSL 2 is installed and enabled. RHEL requires WSL 2 for full functionality. Open PowerShell as Administrator and run:
wsl --set-default-version 2

Step 2: Obtain the RHEL WSL image. Red Hat provides WSL images for customers with a valid subscription. Log in to the Red Hat Customer Portal and download the RHEL WSL tarball (for example, rhel-wsl.tar.xz
).
Step 3: Create a directory to store your RHEL instance. For example:
mkdir C:\WSL\RHEL

Step 4: Import the RHEL image into WSL. In PowerShell, run:
wsl --import RHEL C:\WSL\RHEL C:\path\to\rhel-wsl.tar.xz --version 2

Replace C:\path\to\rhel-wsl.tar.xz
with the path where you saved the image. This command registers RHEL as a new WSL distribution.
Step 5: Start your RHEL WSL instance. Use:
wsl -d RHEL

On first launch, set up your user account as prompted.
Step 6: Register your RHEL system with Red Hat Subscription Manager. This is required to receive updates and install packages. In the RHEL shell, run:
sudo subscription-manager register

Follow the prompts to enter your Red Hat credentials.
Step 7: Update RHEL packages. Keep your system current by running:
sudo dnf update -y

Install any additional software as needed for your tasks.
Alternative: Using Fedora Remix for WSL from Microsoft Store
Fedora Remix for WSL is a community-supported distribution available on the Microsoft Store. This method is simpler but may lag behind official Fedora releases.
Step 1: Open the Microsoft Store and search for Fedora Remix for WSL
.
Step 2: Click Get
to install the distribution.

Step 3: Once installed, launch Fedora Remix from your Start menu. Complete any initial setup as prompted.
Step 4: Update packages to ensure you have the latest software and security fixes:
sudo dnf update -y
This version provides a Fedora-like experience but may not be suitable for all enterprise or production use cases.
Running RHEL or Fedora on WSL streamlines Linux access within Windows, improving development speed and reducing system resource usage compared to traditional virtualization. For ongoing stability, periodically update your distributions and review WSL documentation for new features or compatibility changes.
Member discussion