I have a Minikube cluster setup in WSL 2 of Windows 10 pro, where the docker-for-windows is used with WSL2 integration. Minikube was started with default docker driver.
$ minikube version
minikube version: v1.25.2
commit: 362d5fdc0a3dbee389b3d3f1034e8023e72bd3a7
If I follow the getting started guide,after creating the hellow-minikube service, I should be able to connect to the service either via <minikube-ip>:nodeport or via minikube service command.
But the first method didn't worked. Because it was impossible to even ping the minikube ip from WSL 2: (This works in Minikube setup on a pure Ubuntu installation. The problem is in WSL2 - Windows subsystem for linux).
$ minikube ip
192.168.49.2
$ ping 192.168.49.2
PING 192.168.49.2 (192.168.49.2) 56(84) bytes of data.
^C
--- 192.168.49.2 ping statistics ---
293 packets transmitted, 0 received, 100% packet loss, time 303708ms
The second method minikube service hello-minikube also didn't worked because it was again giving the access url with minikube IP.
$ minikube service hello-minikube
Starting tunnel for service hello-minikube.
Opening service default/hello-minikube in default browser...
**http://192.168.49.2:30080**
❗ Because you are using a Docker driver on linux, the terminal needs to be open to run it.
But this was actually working in previous Minikube versions, as it was actually exposing a host port to the service, and we could connect to the host port to access the service. It needed a manual intervention as the hostport access was available only until the minikube service command keeps running.
Is there any way that I can pre-configure a port to access the service (nodePort), and can access the service even if it is deployed in Minikube in WSL2?
Note:
I tried using other drivers from WSL like --driver=none. But that setup would be much more complicated because it has systemd, conntrack and other packages as dependencies, which WSL2 doesn't have currently.
Also tried to setup a Virtualbox+vagrant Ubuntu box in Windows 10 and installed docker and started minikube with docker driver there. Everything works inside that VM. But cannot access the services from windows host as minikube ip is a host-only ip address available inside that VM only.

