{"id":676,"date":"2025-11-16T21:03:08","date_gmt":"2025-11-16T19:03:08","guid":{"rendered":"https:\/\/www.petersplanet.nl\/?p=676"},"modified":"2025-11-25T17:41:48","modified_gmt":"2025-11-25T15:41:48","slug":"openshift-local-on-windows-with-wsl","status":"publish","type":"post","link":"https:\/\/www.petersplanet.nl\/index.php\/2025\/11\/16\/openshift-local-on-windows-with-wsl\/","title":{"rendered":"Using WSL with OpenShift Local"},"content":{"rendered":"\n<p>You can install OpenShift Local (crc) on your Windows workstation but OpenShift Local runs as localhost. If you want to use Linux for instance to build images with docker or podman you can use the Windows Subsystem for Linux. Unfortunately WSL can not directly access OpenShift Local because it binds to localhost. To solve that I have installed nginx on Windows and configured it as a reverse proxy.<\/p>\n\n\n\n<!--more-->\n\n\n\n<ul class=\"wp-block-list\">\n<li>First install OpenShift Local<br><a href=\"https:\/\/developers.redhat.com\/products\/openshift-local\/overview\">https:\/\/developers.redhat.com\/products\/openshift-local\/overview<\/a><br><\/li>\n\n\n\n<li>Install WSL<br><a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/wsl\/install\">https:\/\/learn.microsoft.com\/en-us\/windows\/wsl\/install<\/a><br><\/li>\n\n\n\n<li>Install Nginx on Windows<br><a href=\"https:\/\/nginx.org\/en\/docs\/windows.html\">https:\/\/nginx.org\/en\/docs\/windows.html<\/a><\/li>\n<\/ul>\n\n\n\n<p>WSL<br>Download the oc binary and copy it e.g. to \/usr\/local\/bin in WSL.<\/p>\n\n\n\n<p>Configure Nginx<br>In WSL get the IP-address for Windows within WSL. That is the default part of the command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ ip route\ndefault via 172.30.208.1 dev eth0 proto kernel\n172.30.208.0\/20 dev eth0 proto kernel scope link src 172.30.214.37<\/code><\/pre>\n\n\n\n<p>So in this case it is 172.30.208.1. Make the Nginx server listen on that IP-address and port 6443.<br>Also create a self signed certificate for TLS:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>openssl req -x509 -nodes -newkey rsa:2048 -keyout localhost.key -out localhost.crt -days 365<\/code><\/pre>\n\n\n\n<p>Snippet nginx.conf:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\n    server {\n        listen       172.30.208.1:6443 ssl;\n        server_name  172.30.208.1;\n\n        ssl_certificate      localhost.crt;\n        ssl_certificate_key  localhost.key;\n\n        location \/ {\n\t\t    proxy_pass https:\/\/api.crc.testing:6443\/;\n\t}<\/code><\/pre>\n\n\n\n<p>If you have downloaded nginx as a zip-file you can start and stop it with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>start nginx\nnginx -s stop<\/code><\/pre>\n\n\n\n<p>Add the following to the \/etc\/hosts file in WSL:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>172.30.208.1    oauth-openshift.apps-crc.testing\n172.30.208.1    api.crc.testing\n172.30.208.1    console-openshift-console.apps-crc.testing\n172.30.208.1    default-route-openshift-image-registry.apps-crc.testing<\/code><\/pre>\n\n\n\n<p>Now you can use WSL to work with openShift.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ oc login -u developer https:\/\/api.crc.testing:6443\n$ oc config current-context\nopenshift-image-registry\/api-crc-testing:6443\/developer<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can install OpenShift Local (crc) on your Windows workstation but OpenShift Local runs as localhost. If you want to use Linux for instance to build images with docker or podman you can use the Windows Subsystem for Linux. Unfortunately WSL can not directly access OpenShift Local because it binds to localhost. To solve that<span class=\"excerpt-ellipsis\">&#8230;<\/span><\/p>\n<p><a class=\"more-link\" href=\"https:\/\/www.petersplanet.nl\/index.php\/2025\/11\/16\/openshift-local-on-windows-with-wsl\/\" itemprop=\"url\">Continue Reading<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,9],"tags":[],"class_list":["post-676","post","type-post","status-publish","format-standard","hentry","category-linux","category-programming"],"_links":{"self":[{"href":"https:\/\/www.petersplanet.nl\/index.php\/wp-json\/wp\/v2\/posts\/676","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.petersplanet.nl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.petersplanet.nl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.petersplanet.nl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.petersplanet.nl\/index.php\/wp-json\/wp\/v2\/comments?post=676"}],"version-history":[{"count":15,"href":"https:\/\/www.petersplanet.nl\/index.php\/wp-json\/wp\/v2\/posts\/676\/revisions"}],"predecessor-version":[{"id":693,"href":"https:\/\/www.petersplanet.nl\/index.php\/wp-json\/wp\/v2\/posts\/676\/revisions\/693"}],"wp:attachment":[{"href":"https:\/\/www.petersplanet.nl\/index.php\/wp-json\/wp\/v2\/media?parent=676"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.petersplanet.nl\/index.php\/wp-json\/wp\/v2\/categories?post=676"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.petersplanet.nl\/index.php\/wp-json\/wp\/v2\/tags?post=676"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}