Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

Red Hat OpenShift 4.0 Developer Preview on AWS: Up and running with Windows

<p>&nbsp;</p> <quillbot-extension-portal></quillbot-extension-portal>

April 23, 2019
Don Schenck
Related topics:
ContainersKubernetes
Related products:
Red Hat OpenShift

    https://youtu.be/fXgAKlaBOGs

    In a previous article, "OpenShift 4.0 Developer Preview on AWS is up and running" I included instructions for using macOS or Linux to install and manage your Red Hat OpenShift 4.0 cluster. Since I recently added a Windows 10 PC to my technology mix, I decided to try to use Windows as my only choice.

    I was saddened to learn that the installer, openshift-install, isn't available for Windows. But, like any developer who won't be denied; I found a way.

    The key to success is to embrace the Windows Subsystem for Linux (WSL). With this tool in hand, you can download and install the necessary bits to start up your Red Hat OpenShift 4.0 cluster on AWS, then switch over to PowerShell on Windows to log in and do your development. In my case, my code is written in C# and, although the WSL Linux that I used (Fedora Remix) does have vi installed, I want to do my work in Visual Studio Code. Windows is my comfort zone; why should I be forced to leave it? Besides, I know how to exit VS Code (**grin**).

    Overview

    Here is the plan, the TL;DR:

    1. Enable WSL (Windows).
    2. Install a Linux Distro (Windows).
    3. Configure AWS (Linux).
    4. Install openshift-install (Linux).
    5. Start the cluster (Linux).
    6. Install the OpenShift CLI for Windows (Windows).
    7. Copy the configuration file from WSL to Windows (Both).
    8. Log in from Windows (Windows).

    But first...

    I strongly recommend reading the aforementioned article, "OpenShift 4.0 Developer Preview on AWS is up and running", for some details that are not repeated here. Don't worry if you don't understand all the Linux commands; the important part is to know what steps need to happen.

    Enable WSL

    The PowerShell command is:

    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

    Install a Linux distro

    Go to the Microsoft Store on your Windows PC and install the Linux distro of your choosing. For this article, I spent the five bucks and opted for the "Fedora Remix" distro. If you install a different distro, the package-related commands will differ (e.g., "yum" for Fedora versus "apt-get" for Ubuntu). The rest will be the same, however.

    Install the distro and open a terminal window.

    Configure AWS

    For this, follow the instructions at steps one and two on the Red Hat OpenShift 4.0 on AWS installation page.

    Install openshift-install

    The instructions from the developer preview are browser-based. That is, you visit a web page and click on a button to download the bits. We're not going to use that. We're going to use wget instead to download the bits from the command line.

    Use your distro's package management tool to make sure wget is installed. On my Fedora Remix distro, I had to run sudo yum install -y wget.

    Open your Windows browser of choice and visit the openshift installer releases web page. Right mouse-click on the link for "openshift-install-linux-amd64" and select the option to copy the link to your local clipboard. Then switch over to your Linux terminal window so you can paste in the link and run the command:

    wget <paste-the-link-in-here>

    You'll see a few super-long URLs scroll by before you see the bits downloading to your Linux distro in your WSL.

    Rename the downloaded bits with this command:

    mv openshift-install-linux-amd64 openshift-install

    Now, make it executable with this command:

    chmod +x openshift-install

    Start the cluster

    Now you have the OpenShift installer available on your Linux distro. You can take the steps needed to start your Red Hat OpenShift 4.0 cluster on AWS. If you followed the "Configure AWS" steps above, you'll have the Access ID and key needed.

    You can copy the Pull Secret from the installation page mentioned earlier as well.

    The magic starts to happen when you use the following command in your Linux terminal:

    ./openshift-install create cluster

    Be patient. I've had it take up to 24 minutes for a cluster to install. Don't worry; it's worth the wait.

    Install the OpenShift CLI for Windows

    When the installation is finished, your cluster will be up and running. You won't be able to log in until the time, but you can go ahead and make sure the OpenShift command-line tool, oc, is installed on your Windows PC. At your PowerShell command line, run:

    choco install -y openshift-cli

    Again, if you don't have Chocolatey installed on your Windows machine, stop everything and get it immediately. It's that good.

    Copy the configuration file from WSL to Windows

    Here's the part where you make the transition from Linux to Windows, which will allow you to run everything from your PowerShell command line—and from inside VS Code too, if you wish.

    After the installation is finished and the cluster is up and running, a configuration file will be written to your Linux distro's filesystem. The file is /home/<your-username>/auth/kubeconfig. We need to copy this file to a location where we can read it from Windows PowerShell.

    To date (April 2019), the WSL filesystem maps to the Windows filesystem as follows:

    /mnt/c (Linux) maps to C:\ (Windows)

    Note: Future versions of Windows 10 will make it much easier to share data files between WSL and Windows. For now, just to be safe, we'll copy the configuration file.

    So, we can create a directory—I did it off the root of my C: drive to keep it simple—and then use the Linux cp(copy) command to get the config file over to Windows.

    In PowerShell:

    mkdir C:\ocp4aws

    In Linux:

    sudo cp /home/<username>/auth/kubeconfig /mnt/c/ocp4aws

    Switch back to your PowerShell terminal and move the directory C:\ocp4aws. A listing of the directory contents will show the file kubeconfig, which is now available to your PowerShell session.

    There's just one more step before logging in.

    In PowerShell, set the environment variable "KUBECONFIG" that points to your config file:

    $env:KUBECONFIG="C:\ocp4aws\kubeconfig"

    Stop. Take a Breath

    Up to this point, it's been a winding path with a lot of steps just to be able to log in to an OpenShift 4.0 cluster on AWS. Here's the good news: After this, you just need to do two steps: Set the $env:KUBECONFIG environment variable and run oc login.... That means, when you return to your PC tomorrow, you run two steps and, boom, you're connected to your cluster.

    In other words:

    $env:KUBECONFIG="C:\ocp4aws\kubeconfig"
    oc login -u kubeadmin -p <password-generated-during-cluster-install>

    Log in from Windows

    Simply run the command as instructed in your Linux terminal session. It should look like the following—with a different password.

    oc login -u kubeadmin -p KSiVQ-gww7K-HEaiv-HNnfG

    Keep this information. You'll need it to log into your cluster again.

    Next Steps

    To create or destroy a cluster, use the openshift-install command within your Linux distro terminal.

    After creating a new cluster, you'll have a new login password. It'll be displayed in your Linux distro terminal after the cluster is created. Copy that to your clipboard to paste into PowerShell to log in from Windows.

    Before you log in from Windows, make sure the $env:KUBECONFIG is set.

    That's it. You can now create, use and destroy your Red Hat OpenShift 4.0 cluster on AWS from your Windows PC.

    Last updated: March 28, 2023

    Recent Posts

    • Trusted software factory: Building trust in the agentic AI era

    • Build a zero trust AI pipeline with OpenShift and RHEL CVMs

    • Red Hat Hardened Images: Top 5 benefits for software developers

    • How EvalHub manages two-layer Kubernetes control planes

    • Tekton joins the CNCF as an incubating project

    What’s up next?

     

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.