# - path of the container file: c:\wslsources\ # Import the container file as a WSL v2 distro If the terminal used is the Windows Terminal, we will open a new Powershell tab and import the RHEL8 container file into WSL: # Create a new directory for containing the WSL custom distros, or move into it if already created We have now the file, containing an image of RHEL8, to be imported as a new WSL2 distro. # Check if the export has been successful # - name of the container to be exported: rhel8ĭocker export -o /mnt/c/wslsources/ rhel8 # - option to output to a file: -o /mnt/c/wslsources/ # Prior to the export, a directory has been created: c:\wslsources
However, as we will need to import it into WSL2 as a distro with the wsl command, we need to export it to a directory inside the Windows filesystem (read: /mnt/c): # Export the container to an archive file Once we created the container, we can now export it as an archive file. # Pull the GO image with the RHEL8 base imageĭocker run -name rhel8 /rhel8/go-toolset # Enter the Red Hat account username and password However that’s the behaviour we are looking for as we will export the container to a file: # Login to the Red Hat registry Please note we will not run any command, so the container will be created and will directly exit. Let’s create a container with the GO RHEL8 image. However, when searching the build images, and if we pick GO for example, there will be a RHEL8 image. Strangely enough, when searching for the RHEL base images, there’s only RHEL6 and RHEL7 fully featured images. In order to get the Red Hat Enterprise Linux (RHEL) container images, we need to pull it from Red Hat’s own registry The easiest way to create a new WSL distro, is to import a container export file.
In our case, if we don’t already have one from our company, Red Hat has a very handy (and let’s say it: cool) developer subscription.Īnd while we will be using our subscription for development purposes, there’s an even nicer update on the developer subscription applicability. In order to use Red Hat Linux, we need a subscription. Red Hat is a company that sells services around Linux (duh) and Cloud.
Still, when needed, the page name or “location” will be provided as an helper.
Prerequisitesįirst and foremost, for keeping this blog to the “technology” aspect, it will not describe how to browse Red Hat customer portal. So let our Corsair hearts run wild and “steal” this so precious gem. And those are that, even if not “supported”, there’s nothing blocking us to actually bring Red Hat as a WSL Distro. Still, this blog is really not about companies politics, so let’s focus on the good parts.
One thing almost for granted is that WSL was/is not part of the partnership between both companies. To no other sources than some posts on Twitter, we currently don’t really know who’s pushing back and for what exact reasons. When looking at the current WSL distributions in the Microsoft Store, anyone with even the smallest knowledge of Linux will remark a big absent from the list: Red Hat.