Containers

OpenShift Local on Windows 11 and Troubleshooting Errors

Learn how to install and get up and running with OpenShift Local in Windows 11 and some hurdles and troubleshooting along the way

With all the tumult across the virtualization space this year, many have been looking at alternative solutions to running virtualized environments, containers, VMs, etc. There are many great solutions out there. One that I haven’t personally tried before putting the effort getting into my lab is Red Hat OpenShift. In case you didn’t know, there is a variant of OpenShift called OpenShift Local that allows running an ephemeral development OpenShift environment. It is a great way to kick the tires and get started learning OpenShift. Let’s look at OpenShift Local, how to install it, and get up and running.

What is OpenShift Local?

It is a minimal OpenShift Container Platform 4 cluster that you can run locally on a development workstation. Think of it as being similar to Minikube as an example. You can use it for development and testing use cases. This makes it a perfect choice for home labs as well for those that want to get familiar with OpenShift in a lab environment.

OpenShift Local, formerly known as CodeReady Containers, allows developers to create a single-node OpenShift cluster on their local machine. This setup is perfect for developing and testing container-based applications without needing a full-scale infrastructure.

OpenShift Local benefits

  1. Single Node OpenShift Cluster: OpenShift Local runs a single node cluster on your local machine, so simplified setup
  2. Cloud Development Environment Locally: Developers can setup a cloud development environment on their local computer
  3. Integrated Tools: You can access to a range of tools and features that are part of the OpenShift Container Platform

What are the differences from a production OpenShift installation?

Red Hat makes some notes about the Local distribution from production. These include the following highlights:

  • They describe it as “ephemeral”
  • Not intended for production use
  • There is no supported upgrade path to newer OpenShift Container Platform versions
  • It is a single node so no high-availability
  • The single node contains both the control plane and worker node
  • Cluster monitoring is disabled
  • It runs in a virtual machine that they call an instance
  • You can’t customize the cluster settings as you could with production, such as the domain, address range for cluster comms and it uses the 172 address range, that can’t be changed

OpenShift Local Windows 11 Install

I saw a lot of posts out there showing how to install and work with this in Linux and MacOS, but none with Windows, so I wanted to try the installation out there, since that is my daily driver workstation.

Prerequisites for Installation

Before you begin the installation process, ensure your local machine meets the following requirements:

Hardware for OpenShift local instance:

  • 4 physical CPU cores
  • 9 GB of free memory
  • 35 GB of storage space

Operating System – OpenShift Local supports multiple operating systems, including Red Hat Enterprise Linux, macOS, and Windows.

Virtualization – If you are working on Windows, you will need to have Hyper-V role installed

Installing OpenShift in Windows 11

To install OpenShift Local, follow the steps listed below.

Download the CRC Bundle for OpenShift Local

If you have trouble finding the download, it is located here: https://developers.redhat.com/download-manager/link/3868678.

In the Select an OpenShift cluster type to create, you will select the download for OpenShift Local you want to deploy. Here, I have selected Windows.

You will note there are two buttons you see below:

  • Download OpenShift Local – the binaries
  • Download pull secret – this will be needed during installation
Downloading the openshift local package for windows
Downloading the openshift local package for windows

Below are the files that I have after downloading. I have extracted the .zip file, so that explains the 3 files. But

Files downloaded for openshift local installation
Files downloaded for openshift local installation

Install the CRC OpenShift Local installation

Running the installer in Windows was uneventful and was basically a “next, next, finish” type process. The MSI installer had no configuration outside of accepting the EULA, but I am including screenshots for posterity:

Beginning the installer:

Starting the installation of openshift in windows 11
Starting the installation of openshift in windows 11

Accepting the EULA:

Accept the eula for openshift local installation
Accept the eula for openshift local installation

Beginning the install:

Begin the openshift local installation
Begin the openshift local installation
Finish the installation of openshift local in windows 11
Finish the installation of openshift local in windows 11

As a note, it will request you to reboot your machine after the installation.

Reboot prompt after the installation
Reboot prompt after the installation

CRC Setup

Once you have rebooted, you need to run the crc setup command as you see here. What this does is downloads the software bundle from Red Hat and extracts it. Since I am using Windows, as you can see in the screenshot, it is downloading resources for the resulting Hyper-V virtual machine. It also configures the environment. It makes sure all the necessary dependencies are correctly installed.

Running crc setup
Running crc setup

This is where I started having issues with the crc setup. The command would run and then give me the error in Windows 11: failed to register crcDaemon task, exit status 1: Register-ScheduledTask : Access is denied.

Access denied error with openshift local in windows 11 scheduled task
Access denied error with openshift local in windows 11 scheduled task

I thought, OK, I need to run as elevated permissions. However, when doing that, you get another error saying you shouldn’t run as administrative privileges. So, a bit of a catch 22. I also thought I could find the XML scheduled task file it is trying to register, but was unsuccessful finding it.

However, in doing some looking around and I found the crc config command. This showed there were ways to bypass some of the prerequisites checks. Bingo! And, there were two that looked like what I might need.

  • skip-check-daemon-task-install
  • skip-check-daemon-task-running
Skip checkes for the daemon task in openshift local
Skip checkes for the daemon task in openshift local

So first, disabled the task-install one. Still had the error when running the crc setup.

Skip daemon check install
Skip daemon check install

Then I disabled the task running one.

Skip deamon check running
Skip deamon check running

Success! As you can see below it is flagging the two options as a warning, but at the end is saying it is setup correctly for using CRC.

Successfully past crc setup command
Successfully past crc setup command

Now, since we don’t have the scheduled task spinning up the daemon, we need to do this manually. To do that, I simply launched another PowerShell window and issued the command:

crc daemon

This started the daemon. After it was running, I hopped over to the other PowerShell tab to run the crc start command.

CRC Start

Now with the daemon running, let’s run:

crc start

Great! Making progress.

Running crc start for openshift local
Running crc start for openshift local

I launched my Hyper-V Manager on the local workstation and was able to see the VM get created. You can see this in the first side-by-side pic:

Starting openshift local instance and hyper v virtual machine
Starting openshift local instance and hyper v virtual machine

After just a couple of minutes, the cluster was started and I got the successful messaging along with credentials to use:

Openshift local hyper v instance is created and started successfully
Openshift local hyper v instance is created and started successfully

Accessing the Web Console

As you noticed on the output screen when the cluster is provisioned we get the URL for the web console.

You can access this with:

  • developer/developer
Accessing the openshift web console
Accessing the openshift web console

After logging in and dismissing the “guided tour” messaging.

After logging into the web console for openshift local
After logging into the web console for openshift local

Using the OC command line tool

If you are like me, one of the first things I wanted to do was kubectl type commands. To do that with OpenShift, you use the oc command. Below, you will see the output of commands I tried and mistakes along the way:

As you can see you need to set the environment variable for the oc command:

& crc oc-env | Invoke-Expression

Then, we can login:

oc login -u developer https://api.crc.testing:6443

I tried to run a get pods as developer, but realized with the error I didn’t have permissions. So changed to kubeadmin to do these commands. As you can see in the final command, I was able to pull the single node information.

Oc commands in openshift local instance
Oc commands in openshift local instance

Troubleshooting Red Hat OpenShift Local cluster issues

I have already detailed much of this throughout, but there were definitely issues I ran into with OpenShift Local on Windows. It seems a bit finicky, but definitely cool to run it in Windows. Make sure of the following:

  • Don’t use an admin prompt for running the crc commands, it will error out
  • If you get the scheduled task issue, you can run the daemon manually in a separate session and then run your crc start command separately.
  • Make sure you are logged in as the correct user when you want to interact with the cluster from the command line.

Wrapping up

It was great to see we could get OpenShift Local up and running in Windows 11. I didn’t see much information out there on ones that have been successful with this, so hopefully this will add some value to the community with the steps above. Let me know if you are playing around with OpenShift in your environment and what you are using it for. Are you using OpenShift Local, or full blown openshift?

Subscribe to VirtualizationHowto via Email ๐Ÿ””

Enter your email address to subscribe to this blog and receive notifications of new posts by email.



Brandon Lee

Brandon Lee is the Senior Writer, Engineer and owner at Virtualizationhowto.com, and a 7-time VMware vExpert, with over two decades of experience in Information Technology. Having worked for numerous Fortune 500 companies as well as in various industries, He has extensive experience in various IT segments and is a strong advocate for open source technologies. Brandon holds many industry certifications, loves the outdoors and spending time with family. Also, he goes through the effort of testing and troubleshooting issues, so you don't have to.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.