How to install OpenShift Local on your Windows PC

Sean Boyd Avatar

Share with

I have installed and reinstalled OpenShift Local multiple times for testing on both my desktop PC and laptop.

This guide describes the condensed steps I followed to install OpenShift Local on my Windows 11 desktop PC. For a detailed guide refer to the references section.

Minimum requirements

According to the OpenShift Local guide, the following minimum requirements must be met:

  • 4 physical CPU cores
  • 9 GB of free memory.
    • When using OpenShift Local on my laptop having 16GB RAM I quite often found 16GB not enough.
  • 35 GB of storage space

It is not possible to install OpenShift Local using Windows Home Edition.

Environment

OpenShift Local was installed on the following desktop PC.

CategoryDetails
Open Shift LocalRed Hat Open Shift Local 2.33
Desktop PCHP Omen, 12th Gen Intel(R) Core(TM) i7-12700K, 3.6 GHz, 12 cores, 20 logical processors

NVMe WD WD_BLACK Gen4 1TB disk
LaptopHuawei Matebook Pro 2024, Intel(R) Core(TM) Ultra 9 185H, 2.5 GHz, 16 cores, 22 logical processors

NVMe 2TB disk
O/SWindows 11 Pro

The sizes I chose for the configuration are higher than the defaults for multiple reasons:

  • I ran into issues with the default sizes not being high enough.
  • With my desktop PC specs, I am able to set higher values than the defaults, which appear to be set as a minimum to run OpenShift Local on laptops.
  • I want to enable cluster monitoring. and according to the OpenShift Local installation guide this requires a minimum of 14GB memory.

Download OpenShift Local

The first step is to download OpenShift Local. I downloaded the Windows x86_64 installer.

This requires you to create and log into a Red Hat account.

Click the download button to download the file “crc-windows-installer.zip”

Also download your pull secret. This is required during the crc setup process.

Install OpenShift Local

Unzip and run the installer

Unzip this file, run the installer and follow the prompts.

Take note of the following comment from the OpenShift Local installation guide:

  • “On Microsoft Windows, you must install Red Hat OpenShift Local to your local C:\ drive. You cannot run Red Hat OpenShift Local from a network drive.”*

If you try to install OpenShift Local on a Windows Home Edition PC, you will receive the following error message. If you are using Windows Home Edition, you’ll need to upgrade to Windows Pro to continue.

Error when using Windows Home Edition

Once installed, you’ll be prompted to restart your PC.

Check the version

Open a command window. Enter the following command to check the version.

crc version

The command output should be similar to the following.

c:\ocp\LibertyToOpenShift>crc version
WARN A new version (2.39.0) has been published on https://developers.redhat.com/content-gateway/file/pub/openshift-v4/clients/crc/2.39.0/crc-windows-installer.zip
CRC version: 2.33.0+c43b17
OpenShift version: 4.14.12
Podman version: 4.4.4

Check the CRC status

Check the status of the installation.

crc status

You will see a message prompting you to run the setup.

C:\Users\sean>crc status
crc does not seem to be setup correctly, have you run 'crc setup'?

Do not run the setup just yet. We’ll make a few more changes before running the setup.

Usage data collection

I chose to disable usage data collection. Open a command window and issue the following command.

crc config set consent-telemetry no

The command output should be similar to the following.

C:\Users\sean>crc config set consent-telemetry no
Successfully configured consent-telemetry to no

(Optionally) Change some defaults

From my general usage it is not necessary to change the defaults. I have been using OpenShift Local for some time without any issues while using the defaults.

Recently, I started to face issues with ephemeral storage and DiskPressure. As a result, I decided to amend some defaults to higher values. With the higher values I have noticed a performance improvement on my PC. I also no longer faced any issues when building my images using OpenShift Local.

I set these defaults before issuing the crc setup command.

CPUs

Update the number of CPUS from 4 (default) to 6. I’m not sure whether this is really needed but I decided to change it anyway.

crc config set cpus 6

The command output should be similar to the following.

C:\Users\bdsae>crc config set cpus 6
Changes to configuration property 'cpus' are only applied when the CRC instance is started.
If you already have a running CRC instance, then for this configuration change to take effect, stop the CRC instance with 'crc stop' and restart it with 'crc start'.

Memory

Update the memory from 9 GB (default) to 25 GB.

As I plan on enabling the monitoring that requires a minimum of 14 GB I chose a much higher value. I’m glad I did as the crc status on my original setup showed the 9GB mostly used, and in my new setup it was well past the minimum.

The actual usage can be checked by issuing the crc status command. After installation I could see this going much higher than the default. I guess due to the components I am installing.

crc config set memory 25600

The command output should be similar to the following.

C:\Users\bdsae>crc config set memory 25600
Changes to configuration property 'memory' are only applied when the CRC instance is started.
If you already have a running CRC instance, then for this configuration change to take effect, stop the CRC instance with 'crc stop' and restart it with 'crc start'.

Disk size

I used this as a chance to increase the disk size from 31 GB (default) to a much higher value. As I have plenty of disk space, and I didn’t want to face future issues, I arbitrarily I chose 100 GB.

crc config set disk-size 100

The command output should be similar to the following.

C:\Users\bdsae>crc config set disk-size 100
Changes to configuration property 'disk-size' are only applied when the CRC instance is started.
If you already have a running CRC instance, then for this configuration change to take effect, stop the CRC instance with 'crc stop' and restart it with 'crc start'.

Enable cluster monitoring

I decided to enable cluster monitoring. The default is off. The documentation states a minimum of 14 GB memory is required if this feature is enabled.

Enabling monitoring is optional and is not required to successfully use OpenShift Local. I have enabled monitoring to get the full experience of using OpenShift Local; and I have the system resources available to enable it.

crc config set enable-cluster-monitoring true

The command output should be similar to the following.

C:\Users\bdsae>crc config set enable-cluster-monitoring true
Successfully configured enable-cluster-monitoring to true

Outcome of changing the defaults

You may be curious to see the status after a fresh setup using the crc setup command.

C:\Users\sean>crc status
CRC VM:          Running
OpenShift:       Running (v4.14.12)
RAM Usage:       8.946GB of 26.26GB
Disk Usage:      23.16GB of 106.8GB (Inside the CRC VM)
Cache Usage:     25.21GB
Cache Directory: C:\Users\sean\.crc\cache

After some time, and after completing one of the IBM Open Liberty guides (https://openliberty.io/guides/cloud-openshift-operator.html), the RAM usage had grown somewhat.

D:\Dev\vscode\Learning\LibertyGuides\guide-cloud-openshift-operator\start>crc status
CRC VM:          Running
OpenShift:       Running (v4.14.12)
RAM Usage:       14.48GB of 26.26GB
Disk Usage:      26.76GB of 106.8GB (Inside the CRC VM)
Cache Usage:     25.21GB
Cache Directory: C:\Users\sean\.crc\cache

Complete the setup

To complete the setup, issue the crc setup command.

Ensure you have plenty of free space on your C: drive.

The setup downloads large files so it may take considerable time to complete.

crc setup

Wait for the setup to complete, then issue the following command to start OpenShift Local.

Output from the setup command
C:\Users\sean>crc setup
INFO Using bundle path C:\Users\sean\.crc\cache\crc_hyperv_4.14.12_amd64.crcbundle
INFO Checking minimum RAM requirements
INFO Checking if current user is in crc-users and Hyper-V admins group
INFO Checking if CRC bundle is extracted in '$HOME/.crc'
INFO Checking if C:\Users\sean\.crc\cache\crc_hyperv_4.14.12_amd64.crcbundle exists
INFO Getting bundle for the CRC executable
INFO Downloading bundle: C:\Users\sean\.crc\cache\crc_hyperv_4.14.12_amd64.crcbundle...
4.33 GiB / 4.33 GiB [----------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00% 20.21 MiB/s
INFO Uncompressing C:\Users\sean\.crc\cache\crc_hyperv_4.14.12_amd64.crcbundle
crc.vhdx:  18.99 GiB / 18.99 GiB [---------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00%
oc.exe:  117.17 MiB / 117.17 MiB [---------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00%
INFO Checking if the win32 background launcher is installed
INFO Checking if the daemon task is installed
INFO Installing the daemon task
INFO Checking if the daemon task is running
INFO Running the daemon task
INFO Checking admin helper service is running
INFO Checking SSH port availability
Your system is correctly setup for using CRC. Use 'crc start' to start the instance
crc start

You will be prompted for your pull secret. Enter it now.

CRC requires a pull secret to download content from Red Hat.
You can copy it from the Pull Secret section of https://console.redhat.com/openshift/create/local.
? Please enter the pull secret

You should now be done and ready to use OpenShift Local!

Output from the start command
C:\Users\sean>crc start
INFO Using bundle path C:\Users\sean\.crc\cache\crc_hyperv_4.14.12_amd64.crcbundle
INFO Checking minimum RAM requirements
INFO Checking if running in a shell with administrator rights
INFO Checking Windows release
INFO Checking Windows edition
INFO Checking if Hyper-V is installed and operational
INFO Checking if Hyper-V service is enabled
INFO Checking if crc-users group exists
INFO Checking if current user is in crc-users and Hyper-V admins group
INFO Checking if vsock is correctly configured
INFO Checking if the win32 background launcher is installed
INFO Checking if the daemon task is installed
INFO Checking if the daemon task is running
INFO Checking admin helper service is running
INFO Checking SSH port availability
INFO Loading bundle: crc_hyperv_4.14.12_amd64...
CRC requires a pull secret to download content from Red Hat.
You can copy it from the Pull Secret section of https://console.redhat.com/openshift/create/local.
? Please enter the pull secret **********************************************************************************************************************************************************************************INFO Creating CRC VM for OpenShift 4.14.12...
INFO Generating new SSH key pair...
INFO Generating new password for the kubeadmin user
INFO Starting CRC VM for openshift 4.14.12...
INFO CRC instance is running with IP 127.0.0.1
INFO CRC VM is running
INFO Updating authorized keys...
INFO Resizing /dev/sda4 filesystem
INFO Check internal and public DNS query...
INFO Check DNS query from host...
INFO Verifying validity of the kubelet certificates...
INFO Starting kubelet service
INFO Waiting for kube-apiserver availability... [takes around 2min]
INFO Adding user's pull secret to the cluster...
INFO Updating SSH key to machine config resource...
INFO Waiting until the user's pull secret is written to the instance disk...
INFO Changing the password for the kubeadmin user
INFO Updating cluster ID...
INFO Enabling cluster monitoring operator...
INFO Updating root CA cert to admin-kubeconfig-client-ca configmap...
INFO Starting openshift instance... [waiting for the cluster to stabilize]
INFO 5 operators are progressing: console, image-registry, ingress, network, openshift-controller-manager
INFO Operator openshift-controller-manager is progressing
INFO All operators are available. Ensuring stability...
INFO Operators are stable (2/3)...
INFO Operators are stable (3/3)...
INFO Adding crc-admin and crc-developer contexts to kubeconfig...
Started the OpenShift cluster.

The server is accessible via web console at:
  https://console-openshift-console.apps-crc.testing

Log in as administrator:
  Username: kubeadmin
  Password: xxxxxxxxxxxxxxxxxxxxxxxxx

Log in as user:
  Username: developer
  Password: developer

Use the 'oc' command line interface:
  > @FOR /f "tokens=*" %i IN ('crc oc-env') DO @call %i
  > oc login -u developer https://api.crc.testing:6443

Possible problems

Error starting machine: Error in driver during machine start: exit status 1

One of the more frustrating problems I encountered when issuing “crc start” on my laptop was the “exit status 1” error. Such a meaningful error.

If you don’t have enough RAM on your system, you may encounter the below error.

c:\ocp\LibertyToOpenShiftInstantOn>crc start
WARN A new version (2.40.0) has been published on https://developers.redhat.com/content-gateway/file/pub/openshift-v4/clients/crc/2.40.0/crc-windows-installer.zip
INFO Using bundle path C:\Users\bdsae\.crc\cache\crc_hyperv_4.16.0_amd64.crcbundle
INFO Checking minimum RAM requirements
INFO Check if Podman binary exists in: C:\Users\bdsae\.crc\bin\oc
INFO Checking if running in a shell with administrator rights
INFO Checking Windows release
INFO Checking Windows edition
INFO Checking if Hyper-V is installed and operational
INFO Checking if Hyper-V service is enabled
INFO Checking if crc-users group exists
INFO Checking if current user is in crc-users and Hyper-V admins group
INFO Checking if vsock is correctly configured
INFO Checking if the win32 background launcher is installed
INFO Checking if the daemon task is installed
INFO Checking if the daemon task is running
INFO Checking admin helper service is running
INFO Checking SSH port availability
INFO Loading bundle: crc_hyperv_4.16.0_amd64...
INFO Starting CRC VM for openshift 4.16.0...
Error starting machine: Error in driver during machine start: exit status 1

To dig further, start crc in debug mode to find the real error, in my case not enough RAM – it really makes no sense why the real error is hidden in a debug option.

To collect more details on the “crc start” command, use the debug option.

crc start --log-level debug

Look for the following in the output.

DEBU Command failed: exit status 1
DEBU stdout:
DEBU stderr: Hyper-V\Start-VM : 'crc' failed to start.
Unable to allocate 9216 MB of RAM: Insufficient system resources exist to complete the requested service.
(0x800705AA).
'crc' failed to start. (Virtual machine ID 933DE899-E345-4C58-B6B2-E60802F6B9D6)
'crc' is unable to allocate 9216 MB of RAM: Insufficient system resources exist to complete the requested service.
(0x800705AA). (Virtual machine ID 933DE899-E345-4C58-B6B2-E60802F6B9D6)
At line:1 char:43

Free up memory and re-try the command.

Useful commands

There are many CRC commands. I have listed a few I used to make these changes.

crc config
crc config get cpus
crc config get memory
crc config get disk-size
crc setup
crc start
crc status
crc --help

Final thoughts

As part of my learning, I followed the OpenShift using Kubernetes Operators Open Liberty guide after installing OpenShift Local. This put my OpenShift Local installation through its paces and is the primary reason I increased the default sizes. Increasing the default sizes was crucial to resolving the problems I faced with ephemeral memory and Disk Pressure.

References

Primary Red Hat landing page.https://developers.redhat.com/products/openshift-local/overview
Download page for OpenShift Local. This includes the pull secret and a link to the setup guide.https://console.redhat.com/openshift/create/local
Setup guide. This is what I followed. This blog has extracted the bare-bones from this guide to install and configure OpenShift Local.https://access.redhat.com/documentation/en-us/red_hat_openshift_local
Great Red Hat blog to install OpenShift Local on a Linux laptop.https://www.redhat.com/sysadmin/install-openshift-local
Deploying microservices to OpenShift 4 using Kubernetes Operatorshttps://openliberty.io/guides/cloud-openshift-operator.html

Tagged in :

Sean Boyd Avatar

Leave a Reply

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