Skip to content

joshuagrisham-karolinska/wsl-rhel9

Repository files navigation

RHEL9 WSL Distribution

This is a sample WSL distribution of Red Hat Universal Base Image 9 with some specific configurations for usage at Karolinska Hospital:

  • Assumes you are connected to the Region Stockholm network (VPN or on-site) in order to download certain resources.
  • Adds various Region Stockholm and Inera SITHS certificate authorities to the trust store.
  • Installs and configures the following utilities:
    • terraform
    • vault
    • helm
    • kubectl
    • oc (requires download from Karolinska's test OpenShift cluster)
  • Sets up a default developer user (that's you who are using this in your envirnoment!)
  • Installs and configures zsh as the default shell for this default user, plus adds Oh My Zsh! with some extra plugins depending on response to a few prompts.
  • Assumes you have installed v0.4.x+ of wsl-vpnkit and configures the RHEL9 WSL distrubtion with a systemd service to keep it running in the background as long as RHEL9 is running (see Installing below).
  • Assumes you have installed Git for Windows >= v2.39.0 and that you have set up all of your config as needed with Git for Windows including Git Credential Manager.

WSL Setup

Make sure you have at least WSL version 2.0.14.0 or higher.

Check the WSL version using the command wsl --version.

> wsl --version
WSL-version: 2.0.14.0
Kernelversion: 5.15.133.1-1
WSLg-version: 1.0.59
MSRDC-version: 1.2.4677
Direct3D-version: 1.611.1-81528511
DXCore-version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows-version: 10.0.19045.3803

Upgrade WSL if it is not at least 2.0.14.0 from Microsoft Store or with the command wsl --upgrade.

Git Setup

This solution assumes that you will run all environments from one centrally-managed .gitconfig in Windows, that will then be referenced and occasionally copied depending on the scenario. Recommended settings for Git in Windows include the following:

  • git config --global user.name "YourGitHubUsername" (your own actual GitHub username)
  • git config --global user.email "YourGitHubVisibleEmailAddress" (your "visible" email address per your own GitHub Email settings)
  • git config --global init.defaultbranch main
  • git config --global pull.rebase false
  • You have authenticated at least once using git from Windows and successfully completed the browser-based authentication flow with GitHub (and thus have your credentials stored in Git Credential Manager).

The path of Git Credential Manager is currently expected to be C:\Program Files\Git\mingw64\bin\git-credential-manager.exe, which is the default path for Git for Windows starting with v2.39.0 and higher.

The following scenarios have been tested as working with no other intervention or login required by the user (assuming everything is set up and working in Windows):

  • Git CLI from Windows
  • Git CLI from this WSL distro (RHEL9)
  • VS Code launched from Windows, and opening one of the RHEL9-based "dev" containers from this repository using the Dev Containers extension (note this approach is not recommended by Microsoft due to file performance issues).
  • VS Code launched from this WSL distro (RHEL9), and again opening one of the RHEL9-based "dev" containers from this repository (this is the recommended approach from Microsoft).

Installing

  1. Fetch, import, and start wsl-vpnkit by running the script install-vpnkit.ps1.

  2. Build and install the "RHEL9" WSL distribution by running one of the following scripts depending on your needs:

NOTE: This script will wipe and remove any existing distribution with the name "RHEL9" distrubution if you already have one!

Other Containers

Some other containers are available here, with the idea that they can be used as Dev Containers (for example in GitHub Codespaces or with VS Code), but more testing and configuration may be needed.

Here are some commands you can use to build them:

# Build the base image
docker build ./containers -f ./containers/base.Containerfile -t rhelubi9:base
# Build the base dev image
docker build ./containers -f ./containers/dev-base.Containerfile -t rhelubi9:dev-base

# Build Java dev containers
docker build ./containers -f ./containers/dev-java11.Containerfile -t rhelubi9:dev-java11
docker build ./containers -f ./containers/dev-java17.Containerfile -t rhelubi9:dev-java17

To use one of these images in VS Code, set the above image tags in the .devcontainer/devcontainer.json file, like this for example:

{
	"name": "java11",
	"image": "rhelubi9:dev-java11"
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published