How-to: CentOS 8.2 on Windows Subsystem Linux (WSL2)

Issues related to applications and software problems and general support
Post Reply
devlocalca
Posts: 10
Joined: 2019/06/28 05:58:41

How-to: CentOS 8.2 on Windows Subsystem Linux (WSL2)

Post by devlocalca » 2020/08/17 14:37:12

I want to run CentOS 8.2 (2004) under Windows 10 Pro (2004) that comes with WSL2

1. Is there a list of steps anywhere, that would help me download what I need, and get CentOS 8.2 running under WSL2?
2. What would I need to download? (need direct URL - there are so many options for CentOS 8.2 , I am confused)
3. What steps would I need to take to get this running locally on my Windows 10 machine?

Notes:
==> I don't want to run any existing CentOS available in the Windows store, I want to roll my own
==> I don't want to run CentOS 8.2 under VirtualBox or any other virtualization technology, just WSL2

If anyone has actually done this with CentOS 8.2 and WSL2 and has it working swimingly, please reply.
---

jfoechsler
Posts: 1
Joined: 2020/09/08 17:01:32

Re: How-to: CentOS 8.2 on Windows Subsystem Linux (WSL2)

Post by jfoechsler » 2020/09/08 17:19:37

Hi,
I have CentOS8 running in WSL2 not using Store, but built from https://github.com/yuk7/CentWSL project.

Approximate steps:

- General WSL2 setup (https://docs.microsoft.com/en-us/windows/wsl/wsl2-index).
- Kernel update (https://docs.microsoft.com/en-us/window ... sl2-kernel).
- Extract CentWSL zip and run executable.
- Open Windows Terminal and CentOS8 profile.
- Install some stuff:

Code: Select all

dnf config-manager --set-enabled PowerTools
dnf -y install \
	sudo \
	passwd \
	openssh-clients \
	wget \
	unzip \
	git \
	vim \
	https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
- Add user:

Code: Select all

user=<your_username>
useradd $user
passwd $user
gpasswd -a $user wheel
- From Windows Powershell:

Code: Select all

.\CentOS8.exe config --default-user <your_username>
- Open Windows Terminal and CentOS8 profile and see your user is used.

PavelSosin
Posts: 2
Joined: 2020/08/13 05:56:53

Re: How-to: CentOS 8.2 on Windows Subsystem Linux (WSL2)

Post by PavelSosin » 2020/10/30 08:30:16

I'm exactly in the same situation! I would like to run Podman on CentOS. The 2$ CentOS8 distro published in Microsoft store doesn't work. I had to Install CentOS8.1 from the git repository and rolled it forward to 8.2. Meanwhile, Microsoft upgraded the Linux kernel to 4.9 and is working on further upgrades to 5.4.
systemd has been enabled in Ubuntu 20.04 LTE and a new Podman version has been released. WSL2 is much closer to the real Linux capabilities. Maybe, it's time to release a new CentOS 8.2 WSL distro development pre-release? It will be appreciated by Redhaters

User avatar
Sencilla
Posts: 1
Joined: 2020/11/04 16:05:11

Re: How-to: CentOS 8.2 on Windows Subsystem Linux (WSL2)

Post by Sencilla » 2020/11/04 16:23:18

Hi
Sorry about my English, which is not very good ...
Great post from jfoechsler, for me. It has served me a lot.
Three notes to help in the process:
1 - Keep in mind that it takes about 3 hours to complete the whole process, so that's how long it took me ...
2 - Before: ** dnf config-manager --set-enabled PowerTools ** you have to do: ** dnf install 'dnf-command (config-manager)' **
3 - To do:** . \ CentOS8.exe config --default-user <your_username> ** You must be in the folder where you have the CentOS8.exe, which is the place where you unzipped the Centos 8 zip. Either (if you have it enabled) right click on the folder and ** run poweshell here **, or navigate through the powershell commands to that folder.

Very grateful jfoechsler for this post. Now I have my Centos8 beautifully installed, just like on my servers, so I can develop and test everything locally (before breaking anything on any server).
I hope I have helped with my tiny grain of sand.
Sencilla

PavelSosin
Posts: 2
Joined: 2020/08/13 05:56:53

Re: How-to: CentOS 8.2 on Windows Subsystem Linux (WSL2)

Post by PavelSosin » 2020/11/16 09:03:38

Could CentOS 8 WSL distro developers make CentOS 8.2 useful as systemd based distro using something like:
https://gist.github.com/djfdyuruiry/672 ... ee1f41f950
Without systemd support, it is useful for nothing. Ubuntu 20.04 already uses systemd and useful for Docker, Podman, etc. :cry:

devoleksiy
Posts: 7
Joined: 2020/12/12 17:37:39
Contact:

Re: How-to: CentOS 8.2 on Windows Subsystem Linux (WSL2)

Post by devoleksiy » 2021/04/06 18:15:06

I confirm, I also really need a centos 8 with WSL 2

Post Reply