0

I've got CRC running on Windows 11 and I would like to connect there from a RHEL9 VM.

  1. CRC listening on 127.0.0.1:6443

  2. Port forwarding rule created on Win machine to fwd connections on 192.168.1.156 (local intf) to 127.0.0.1:

$ netsh interface portproxy show v4tov4

Listen on ipv4: Connect to ipv4:

Address Port Address Port

192.168.1.156 9000 127.0.0.1 6443

  1. Added rule in firewall to allow connections to port 9000

  2. From the VM:

[test@workstation ~]$ telnet 192.168.1.156 9000 Trying 192.168.1.156... Connected to 192.168.1.156. Escape character is '^]'. Connection closed by foreign host.

[test@workstation ~]$ oc login -u developer -p developer https://192.168.1.156:9000 The server is using a certificate that does not match its hostname: x509: certificate is valid for 10.217.4.1, not 192.168.1.156 You can bypass the certificate check, but any data you send to the server could be intercepted by others. Use insecure connections? (y/n): y

Error from server (InternalError): Internal error occurred: unexpected response: 412

Any idea on how I can fix this and be able to connect from my VM towards CRC?

thanks

aocferreira
  • 673
  • 2
  • 8
  • 15

1 Answers1

0

i did the part that you are stuck on by the following

windowsIP that host the CRC was 192.168.0.234

in windows machine 1- you need to copy what under C:/users/YOURUSER/.kube and put it in your Linux machine under your home directory (/home/user for normal user or /root for root user) and you will find a file called config you need to edit it and put the port 9000 in every place you find the port 6443 2- download the OC command from downloads-openshift-console.apps-crc.testing (get it from "oc get routes -A" and go to the one that start with download and downland it ) and move to the Linux machine and make it exactable 3- in C:\Windows\System32\drivers\etc you will find entry for the CRC , copy it as you will need to make like it in the linux machine, and you need to put the IP of the windows machine
something like

192.168.0.234 api.crc.testing canary-openshift-ingress-canary.apps-crc.testing console-openshift-console.apps-crc.testing default-route-openshift-image-registry.apps-crc.testing downloads-openshift-console.apps-crc.testing oauth-openshift.apps-crc.testing

and it worked for me ./oc login -u kubeadmin -p URPASSWORD https://api.crc.testing:9000

so the full steps are the following

[1] port forwarding rules on windows machine that host the CRC to see the current forword rules netsh interface portproxy show v4tov4 to delete netshinterface portproxy delete v4tov4 listenaddress=192.168.0.234 listenport=9000

to add netsh interface portproxy add v4tov4 listenaddress=192.168.0.234 listenport=9000 connectaddress=127.0.0.1 connectport=6443 netsh interface portproxy add v4tov4 listenaddress=192.168.0.234 listenport=9001 connectaddress=127.0.0.1 connectport=443

[2] open the ports in the firewall (port 9000 and 9001 to accept connections) (if enabled) on windows machine that host the CRC to test telnet windowsIP:9000 telnet windowsIP:9001 it should open a connection

[3] on the linux machine that you want to run oc
(first make sure you can telnet windowsIP:9000) telnet windowsIP:9000 telnet windowsIP:9001 do the steps that mentioned in the first of the reply 1- 2- 3-

edit (1) you just need the 9000 port and some how each time i restart the machine i need to delete and add the forwording rules "netsh"

for testing after CRC start from windows 1- from windows test if you can telnet on the local host to the normal port telnet 127.0.0.1 6443 2- from windows test if you can telnet on the windows machin IP and the port 9000 (to test the forwarding rule) telnet 192.168.0.234 9000 3- from linux test if you can telnet on the windows machin IP and the port 9000 (to test the forwarding rule) telnet 192.168.0.234 9000