Step 3: Install Linux on the Windows Machine

The following instructions use Alma Linux as an example but could be used as a guide for any Red Hat-based Linux distribution.

  1. Download the AlmaLinux 8 WSL image.

  2. Extract the .tar.gz file (for example, C:\wsl\almalinux8).

  3. Open PowerShell and navigate to the extracted directory.

  4. Register the distribution:

    wsl --import AlmaLinux8 C:\wsl\almalinux8\<path_to_almalinux_rootfs.tar.gz>
  5. Set the default user:

    almalinux8 config --default-user <username>
  6. Set the distro version to WSL 2:

    wsl --set-version AlmaLinux8 2