Skip to content

Instantly share code, notes, and snippets.

@jonuwz
Created May 16, 2024 18:13
Show Gist options
  • Save jonuwz/2ffb44f0d38e5aed35f784bbe17f3f79 to your computer and use it in GitHub Desktop.
Save jonuwz/2ffb44f0d38e5aed35f784bbe17f3f79 to your computer and use it in GitHub Desktop.
RHEL 8 on WSL
================
https://console.redhat.com/preview
Make sure 'preview' is enabled in the top right
Services->Deploy->Images
Create Blueprint
Choose RHEL 8, if preview is enabled, you'll have WSL as a target environment at the very bottom
Next, Next ... Next
Wait for the image to build, then download.
In a cmd prompt
wsl --import RHEL-8.9 %USERPROFILE%\WSL\RHEL-8.9 <path to the composer.tar.gz>
wsl -d RHEL-8.9
Register the OS
================
# subscription-manager register
username/password is the same you used to login to the RH console webpage
# subscription-manager attach
Get usual software
===================
# subscription-manager repos --enable "codeready-builder-for-rhel-8-x86_64-rpms"
# dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
# yum module install -y container-tools
# yum install podman-docker sudo
# touch /etc/containers/nodocker
# mount -o remount,shared / /
Dont use root
==============
groupadd -g 1000 <user>
useradd -g <user> -G wheel -u 1000 -m <user>
passwd
passwd <user>
Setup windows terminal
======================
Settings -> Add new profile
Name : RHEL-8.9
Command line : C:\Windows\system32\wsl.exe -d RHEL-8.9 -u <user>
Starting directory : ~
Replace default prompt
======================
add this to ~/.bashrc
export PS1=$'\e[0;31m\u25CF \[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
log in+out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment