#80 CentOS Stream9 in WSL
Closed 4 months ago by jwboyer. Opened 2 years ago by jcpunk.

The Windows Subsystem for Linux is a neat place to try out various Linux things for folks. Having a CentOS Stream9 image available within the Microsoft Marketplace would be a great way to help folks try out the distribution.


This would indeed be advantageous, but we are blocked on adding official images in WSL for the same reasons Fedora is. There is a long-standing legal matter that needs to be resolved.

If we can get this resolved, then Hyperscale would be potentially interested in WSL images too.

+1, same story as having centos7 on WSL, we can probably prepare a howto/recipe but that is not as convenient for the end user.

This is still blocked on Red Hat. No further updates at this time.

Metadata Update from @spotz:
- Issue assigned to jwboyer

a year ago

Still no movement on the Red Hat side, so still blocked.

We do have images in Azure, but that is separate from WSL.

I think a how-to is the way to go. I mean, we have a ton of tarballs right now at https://cloud.centos.org/centos/9-stream/x86_64/images/; they should just import into WSL fine.

Let me try https://cloud.centos.org/centos/9-stream/x86_64/images/CentOS-Stream-Container-Base-9-latest.x86_64.tar.xz right now, using MS's own guide at https://learn.microsoft.com/en-us/windows/wsl/use-custom-distro.

Pitfalls:

  1. there's no xz support. Gotta get the tar out with 7-zip first.
  2. gotta run wsl --update to install the actual parts of WSL before running wsl -d.
  3. you aren't supposed to import that tar either; you're supposed to import the layer.tar inside.
  4. you probably want to run yum install util-linux passwd sudo -y. C: drive filesystem mapping apparently depends on these things.

And that's really it! I think you can make this into a powershell script.
1. Bring in our own 7za.exe from https://7-zip.org/a/7z2408-extra.7z. This is unfortunately a hard requirement, because Windows has no builtin xz.

.\7za e CentOS-Stream-Container-Base-9-latest.x86_64.tar.xz
$a = .\7za l .\CentOS-Stream-Container-Base-9-latest.x86_64.tar | Select-String -Pattern "[0-9a-f]+\\layer.tar" | ForEach-Object { $_.Matches[0].Value }
.\7za e CentOS-Stream-Container-Base-9-latest.x86_64.tar $a
mkdir C:\WSL\CentS9
wsl --import CentS9 C:\WSL\CentS9 "$pwd\layer.tar"
wsl -d CentS9 yum install util-linux passwd sudo -y

That's one approach. Another is to use Image Builder to generate a custom image: https://developers.redhat.com/articles/2023/11/15/create-customized-rhel-images-wsl-environment

That can be accessed with a free (no cost) Developer subscription and CentOS Stream 9 is an option.

Josh will make issues for Alt Images and Doc SiGs, then we will close the issue for the Board with an official comment from RH

As the trademark holder for CentOS and Fedora, Red Hat is choosing not to pursue direct inclusion of these distributions in WSL at this time. Users are free to create and import tarballs derived from CentOS into WSL for their own use, similar to how Red Hat recommends customers use RHEL in WSL.

This ticket has two suggested methods, and the AltImages and Docs SIG tickets referenced below may further provide means to accomplish this.

https://pagure.io/centos-sig-alt-images/sig/issue/7
https://gitlab.com/CentOS/docs/sig/-/issues/2

Metadata Update from @jwboyer:
- Issue status updated to: Closed (was: Open)

4 months ago

As the trademark holder for CentOS and Fedora, Red Hat is choosing not to pursue direct inclusion of these distributions in WSL at this time. Users are free to create and import tarballs derived from CentOS into WSL for their own use, similar to how Red Hat recommends customers use RHEL in WSL.

So this happened: https://www.redhat.com/en/blog/bringing-red-hat-enterprise-linux-windows-subsystem-linux

Can we re-open this then?

We are investigating, if we get something to work off of we'll reopen then.

Log in to comment on this ticket.

Metadata
Attachments 1