Skip to main content
Redhat Developers  Logo
  • Products

    Platforms

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat AI
      Red Hat AI
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • View All Red Hat Products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat Developer Hub
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat OpenShift Local
    • Red Hat Developer Sandbox

      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Secure Development & Architectures

      • Security
      • Secure coding
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • Product Documentation
    • API Catalog
    • Legacy Documentation
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

Getting started with RHEL on WSL

May 20, 2025
Eliane Pereira Sanne Raymaekers Terry Bowling
Related topics:
Developer ToolsLinuxWindows
Related products:
Red Hat Enterprise Linux

Share:

    Red Hat Enterprise Linux (RHEL) can now be used on Microsoft Windows Subsystem for Linux. This enables developers, system administrators, and other users to run RHEL, the leading enterprise Linux environment, locally on Windows.

    In this article, we'll explore the steps to get started with RHEL on Windows Subsystem for Linux, creating customized RHEL images, and enabling developers to work seamlessly with Windows and Linux environments.

    What is Windows Subsystem for Linux (WSL)?

    Windows Subsystem for Linux (WSL) is a feature of Microsoft Windows that enables Linux user-space environments to run on a Windows system without requiring separate virtual machines or rebooting. This feature simplifies development workflows for developers working across both operating systems.

    Essentially, Microsoft provides the Linux kernel running on top of the Hyper-V hypervisor in Windows. This allows a Linux user-space environment to be imported as a tar archive, which is then converted to a VHDX disk image that is isolated and specific to that particular Linux distribution.

    Figure 1 illustrates the WSL architecture and its components. Red Hat maintains the RHEL user space while Microsoft maintains the specialized Linux kernel and related subsystems. Learn more at How is Red Hat Enterprise Linux (RHEL) supported on Microsoft Windows Subsystem for Linux (WSL)?

    Diagram showing WSL2 architecture: Windows programs on top, interacting with a RHEL image, built on WSL2 Shared Linux Kernel and Hyper-V.
    Figure 1: Screenshot showing the WSL2 architecture.

    Windows Subsystem for Linux opens up a new world for developers, enabling them to run Linux distributions alongside their Windows environment. The release of Windows Subsystem for Linux 2 (WSL2) introduces support for more Linux distributions, including RHEL.

    Prerequisites

    Before you begin, ensure that you have the following prerequisites in place.

    1. Install WSL on your Windows system

    Follow the instructions on the Microsoft website: How to install Linux on Windows with WSL

    The examples in this post assume the following:

    1. Windows user account is named demo.
      1. User $HOME directory is C:\Users\demo.
      2. Image will be downloaded to C:\Users\demo\Downloads.
      3. WSL will import the image into a newly created directory C:\Users\demo\WSL.
    2. The default Linux user account will be set to demo.

    2. Obtain or verify your RHEL subscription and activation keys

    You can use Red Hat Enterprise Linux on WSL with any valid RHEL subscription, including one of several no-cost RHEL offerings:

    • Red Hat Developer Subscription for Individuals, intended for personal use, which you can access by joining Red Hat Developer.
    • Red Hat Enterprise Linux for Business Developers, intended for business use, which you can access as a Red Hat Developer member.
    • Red Hat Developer Subscription for Teams allows qualifying Red Hat customer organizations use Red Hat Enterprise Linux for specific development use cases at no extra cost.

    Activation keys are the most convenient and flexible way to ensure that your RHEL environment can download and install additional software, as well as bug fixes and security errata. They also enable you to choose which subscriptions will be used, which is great for enabling developers while preventing overuse of more expensive options.

    Learn more: Getting started with activation keys on the Hybrid Cloud Console | Red Hat Product Documentation 

    3. Obtain and install a RHEL for WSL image

    You can choose one of two methods to obtain an image of RHEL for WSL.

    Option 1: Create a customized RHEL image for WSL

    The recommended method is to create your own RHEL image tailored to your preferences. This enables you to preconfigure your future system to your needs with settings such as preferred language and keyboard layout, package selections and dated versions, custom repositories, registration method, and more. This reduces the runtime configuration of your system. All configurations are optional and you can skip to the last step to build if you only want a minimal, default install. This is particularly helpful for teams who need to share and standardize on a known, tested environment.

    Simply go to Insights image builder at the Hybrid Cloud Console and select the WSL target type to create your up-to-date, custom image (see Figure 2).

    Notes for WSL images:

    • Security compliance options do not currently work for WSL images but might be added at a later date.
    • File system configuration and storage options are not configurable as WSL instances do not have their own disk images by design.
    Screenshot of an image builder interface, showing options for Red Hat Enterprise Linux releases and output formats like WSL.
    Figure 2: Creating custom RHEL images for WSL.

    After selecting WSL as the Image output type, building a fresh image will take only a few minutes. The default settings generate the equivalent of a minimal installation. You can then download the image to a Microsoft Windows system and import it into WSL.

    For this example the file will be downloaded to the demo user’s Downloads folder. The image filename will default to using the unique identifier number within the filename such as composer-api-8b38ab7e-a991-4a71-917a-af9e8627867e-image.wsl but can be changed to anything more useful. This filename will be provided to the wsl.exe utility later in the instructions.

    Using the Microsoft PowerShell terminal, you can now import the image into WSL with the following commands. The options for the wsl.exe utility are as follows. 

    wsl.exe --import <DistroName> <InstallLocation> <InstallTarFile>

    Note: All following commands are performed in PowerShell on Microsoft Windows with administrator permissions.

    Create a folder named WSL in the home directory of the user named demo. This is where the image will be imported. Create the WSL folder where the image will be imported.

    PS C:\Users\demo> cd $HOME
    PS C:\Users\demo> mkdir WSL

    Import the image and name the distro RHEL-10-Custom. The file paths begin with .\, signifying relative path names to the user’s home directory.

    PS C:\Users\demo> wsl --import RHEL-10-custom .\WSL\RHEL10custom .\Downloads\composer-api-8b38ab7e-a991-4a71-917a-af9e8627867e-image.wsl

    Set RHEL 10 as the default distribution for WSL:

    PS C:\Users\demo> wsl -s RHEL-10-custom

    List the Linux distributions installed in WSL. (Your results might look different.)

    PS C:\Users\demo> wsl --list --verbose
     NAME              STATE           VERSION
    * RHEL-10-custom    Stopped         2
      Ubuntu            Stopped         2
      FedoraLinux-42    Stopped         2

    Option 2: Download a prebuilt RHEL image for WSL

    Red Hat now publishes a prebuilt Red Hat Enterprise Linux 10 WSL image for your convenience at the RHEL Downloads page. The file will be named rhel-10.0-x86_64-wsl2.tar.gz. The file extension will change to from .tar.gz to .wsl at some time in the near future.

    If not already created, create the WSL directory as in the preceding example for a custom image. Optionally either image can be set as default.

    PS C:\Users\demo> mkdir WSL
    PS C:\Users\demo> wsl --import RHEL-10-prebuilt .\WSL\RHEL10prebuilt .\Downloads\rhel-10.0-x86_64-wsl2.tar.gz

    You have now learned how easy it is to obtain and import RHEL into WSL. The following section will explain how to launch the WSL instance and verify that the system is registered so that it can receive updates.

    Launch the RHEL distro on WSL

    This section assumes that you have successfully installed Microsoft WSL on your machine, obtained the RHEL image from one of the methods described in the previous sections, and imported the RHEL image into WSL.

    Note: All following commands are performed in PowerShell with administrator permissions.

    From the Microsoft PowerShell terminal, you can list the distributions and verify which is the default.

    PS C:\Users\demo> wsl --list --verbose
     NAME              STATE           VERSION
    * RHEL-10-custom    Stopped         2
      Ubuntu            Stopped         2
      FedoraLinux-42    Stopped         2
      RHEL-10-prebuilt  Stopped         2 
    Launch the instance. The distribution name will need to be provided if not set to default.
    PS C:\Users\demo> wsl

    or

    PS C:\Users\demo> wsl -d RHEL-10-custom

    Your command prompt will now be that of the running RHEL instance. Verify the installed version using the following command:

    root@Win-demo:/mnt/c/Users/demo# cat /etc/redhat-release
    Red Hat Enterprise Linux release 10.0 (Coughlan)

    The Red Hat Connect rhc command is the new, preferred tool to configure registration. If not present, you can use the subscription-manager command instead. The following steps will explain how to verify and establish registration so that software and updates can be installed.

    When creating a custom image, the option to preconfigure auto-registration using an activation key was presented. If not chosen or when downloading the prebuilt image, registration can be completed now. Instructions for the activation key were listed above in the Prerequisites section.

    If not already registered, you can use either one of the following commands. It is recommended to use the organization ID and activation key as explained in the Prerequisites section. Optionally, you can use the same user ID and password as for Red Hat Insights and Customer Portal as well.

    # rhc connect --organization ORG_ID --activation-key KEY

    or 

    # subscription-manager register --org ORG_ID  --activationkey KEY

    Verify the registration state of the RHEL instance. If registered, the output for each of the tools will appear as demonstrated below.

    # rhc status
    Connection status for Win-demo:
    ✓ Connected to Red Hat Subscription Management
    ✓ Connected to Red Hat Insights
    ✓ The yggdrasil service is active
    Manage your connected systems: https://red.ht/connector
    # subscription-manager status
     subscription-manager status
    +-------------------------------------------+
       System Status Details
    +-------------------------------------------+
    Overall Status: Registered
    Once successfully registered, verify that software repositories can be queried and updates installed.
    # dnf repolist
    Updating Subscription Management repositories.
    repo id                             repo name
    rhel-10-for-x86_64-appstream-rpms   Red Hat Enterprise Linux 10 for x86_64 - AppStream (RPMs)
    rhel-10-for-x86_64-baseos-rpms      Red Hat Enterprise Linux 10 for x86_64 - BaseOS (RPMs)
    # dnf update

    A good next step is to add a user to your RHEL distribution and set them as the default when you start WSL. Image builder enables you to define users when you create the image. If you have not already added a user, or are using the prebuilt image, you can add user demo with sudo access to root, with the following command:

    # useradd -m -G wheel demo
    # passwd demo

    Setting the default user account 

    From the Microsoft PowerShell terminal, enter the following command to set the default use:

    PS C:\Users\demo> wsl --manage RHEL-10-Custom --set-default-user demo

    When you exit your WSL terminal and restart WSL and you will automatically be dropped into the demo account by default the next time you start a new WSL instance of RHEL.

    Summary

    In this tutorial, we successfully installed Microsoft WSL, obtained a RHEL subscription and activation key, and obtained a customized or prebuilt image of RHEL for WSL that you can easily launch on Microsoft Windows. This exemplifies the availability and flexibility of Red Hat Enterprise Linux across diverse platforms. 

    You are now ready to use this for Podman container development, along with Red Hat Universal Base Images (UBI), providing many runtime languages and packages. Try Red Hat UBI on the curated Red Hat UBI hands-on lab and reproduce it locally in your RHEL on WSL environment. 

    You can also learn more with the amazing tutorials and examples at developers.redhat.com/learn, as well as great example blogs such as How to deploy a Flask application in Python with Gunicorn.

    Try Insights image builder and RHEL 10 on WSL today

    Ready to experience it for yourself? Go to Insights image builder to build your customized image of RHEL 10, then deploy your image locally on Microsoft WSL. Check out the overview and explore the latest blog posts at redhat.com/image-builder.

    Last updated: September 9, 2025

    Related Posts

    • Red Hat Enterprise Linux now available for Windows Subsystem for Linux

    • Exploring x86-64-v3 for Red Hat Enterprise Linux 10

    • Access RHEL with a Red Hat Developer Subscription for Teams

    • Secure RHEL systems using Ansible Automation Platform

    • How SELinux improves Red Hat Enterprise Linux security

    • How to use RHEL 10 as a WSL Podman machine

    Recent Posts

    • How to enable Ansible Lightspeed intelligent assistant

    • Why some agentic AI developers are moving code from Python to Rust

    • Confidential VMs: The core of confidential containers

    • Benchmarking with GuideLLM in air-gapped OpenShift clusters

    • Run Qwen3-Next on vLLM with Red Hat AI: A step-by-step guide

    What’s up next?

    Ready to run Red Hat Enterprise Linux (RHEL) directly on your Windows machine? RHEL 8, 9, and 10 are now available for Windows Subsystem for Linux (WSL), both as ready-to-run images and through the Red Hat Image Builder service.  This cheat sheet gives you quick access to the essential commands and configurations for RHEL on WSL.

    Get the cheat sheet
    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2025 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue