https://rancher.com/ logo
Title
p

powerful-electrician-18876

11/17/2022, 9:53 AM
Hi everyone, Please let me why I cannot resolve "localhost" but only 127.0.0.1 I have also added host.docker.internal on my host file in windows 11. Is there any good way to debug this through issue on my environment
c

calm-sugar-3169

11/17/2022, 5:56 PM
why do you need the
host.docker.internal
in the host file on windows? that domain is for inside the wsl vm, can you elaborate on what you are trying to do?
p

powerful-electrician-18876

11/18/2022, 2:02 PM
I have added host.docker.internal as docker desktop had this on my host file. I am trying run sql server in container. and bind port 1433 to host so that I can connect from host environment.
c

calm-sugar-3169

11/18/2022, 4:51 PM
ok, you don’t need to add
host.docker.internal
to windows’s host file. In rancher desktop we already add that entry to the wsl’s host file (inside the vm) and that should be mapped to wsl’s interface IP address. This will allow connectivity from your containers to the host using that domain or even an IP address if one wishes to use IP. What IP address are you using on the host side to bind 1433 to?
p

powerful-electrician-18876

11/18/2022, 8:03 PM
I'am having 172.25.80.1 for wsl, and for wireless - 192.168.68.137
c

calm-sugar-3169

11/18/2022, 8:12 PM
Which IP address are you binding 1433 to?
Can you bind 1433 to
0.0.0.0
and try again?
p

powerful-electrician-18876

11/18/2022, 8:19 PM
my netstat doesn't show any 1433 port binding and but my docker logs says 127.0.0.1. so I have to change docker yaml to 0.0.0.0?
2022-11-18 15:02:41.56 spid18s Server is listening on [ 'any' <ipv6> 1433]. 2022-11-18 15:02:41.57 spid18s Server is listening on [ 'any' <ipv4> 1433]. 2022-11-18 15:02:41.59 Server Server is listening on [ ::1 <ipv6> 1434]. 2022-11-18 15:02:41.59 Server Server is listening on [ 127.0.0.1 <ipv4> 1434].
thats the docker log
May I ask you how can I bind to 0.0.0.0?
netstat - a gives TCP [::]:135 DESKTOP-HEQK2EA:0 LISTENING TCP [::]:49668 DESKTOP-HEQK2EA:0 LISTENING TCP [::]:49674 DESKTOP-HEQK2EA:0 LISTENING TCP [::1]:1433 DESKTOP-HEQK2EA:0 LISTENING TCP [::1]:5672 DESKTOP-HEQK2EA:0 LISTENING TCP [::1]:6443 DESKTOP-HEQK2EA:0 LISTENING
is it clashing with ipv6 ?
c

calm-sugar-3169

11/18/2022, 8:27 PM
you mentioned earlier that you want to the following:
I am trying run sql server in container. and bind port 1433 to host so that I can connect from host environment.
so you can simply use the publish feature in docker e.g
docker run -d -p 1433:[sqlport] sqlImage
this will simply run a sql container and publish the port on the host on 1433, you can then access your database from other containers on
host.docker.internal:1433
in order for this to work you do not need to edit any host file or anything, you would just need to deploy your DB container correctly
p

powerful-electrician-18876

11/18/2022, 8:32 PM
oh sorry I got confused with host and container. the DB container is created using docker-compose yaml which worked fine in docker desktop.
sqlserver:
  image: "<http://mcr.microsoft.com/mssql/server:2017-CU22-ubuntu-16.04|mcr.microsoft.com/mssql/server:2017-CU22-ubuntu-16.04>"
  container_name: sqlserver-integrationtest
  environment:
    SA_PASSWORD: "******"
    ACCEPT_EULA: "Y"
  ports:
    - "1433:1433"
thats the yaml part
c

calm-sugar-3169

11/18/2022, 8:33 PM
ok, so when you run this what do you see if you do
netstat -ant | findstr '1433'
that’s on the host side windows 11
p

powerful-electrician-18876

11/18/2022, 8:34 PM
ok thank you
I get TCP 127.0.0.1:1433 0.0.0.0:0 LISTENING InHost
c

calm-sugar-3169

11/18/2022, 8:35 PM
ok, and hop on the wsl by running
wsl -d rancher-desktop
and then run
netstat -nlp | grep 1433
what do you see in there?
p

powerful-electrician-18876

11/18/2022, 8:36 PM
I get
tcp 0 0 0.0.0.0:1433 0.0.0.0:* LISTEN 14378/docker-proxy
c

calm-sugar-3169

11/18/2022, 8:36 PM
can I ask also, what version of Rancher Desktop are you using?
p

powerful-electrician-18876

11/18/2022, 8:37 PM
1.6.2#
c

calm-sugar-3169

11/18/2022, 8:38 PM
can you also share with me to output of
netsh interface portproxy show all
on windows
p

powerful-electrician-18876

11/18/2022, 8:39 PM
no result
c

calm-sugar-3169

11/18/2022, 8:40 PM
hmm, that’s weird, doesn’t seem right
can you please create an issue and include the steps to reproduce this, I will look into it
p

powerful-electrician-18876

11/18/2022, 8:41 PM
ok where should I create on git ? sorry its new to me
c

calm-sugar-3169

11/18/2022, 8:42 PM
you can choose, bug report
p

powerful-electrician-18876

11/18/2022, 8:42 PM
thank you very much I will do that now
c

calm-sugar-3169

11/18/2022, 8:42 PM
include some steps like
docker-compose.yaml
so I can reproduce it on my end
p

powerful-electrician-18876

11/18/2022, 8:43 PM
sure
c

calm-sugar-3169

11/18/2022, 8:43 PM
Thanks 🙂
@powerful-electrician-18876 I just tested this on my end it seems to be work fine 🤔
netsh interface portproxy show all

Listen on ipv4:             Connect to ipv4:

Address         Port        Address         Port
--------------- ----------  --------------- ----------
0.0.0.0         1433        172.28.84.230   1433

Listen on ipv6:             Connect to ipv6:

Address         Port        Address         Port
--------------- ----------  --------------- ----------
::              1433        fe80::215:5dff:fe20:4a78 1433
on the windows host side
TCP    0.0.0.0:1433           0.0.0.0:0              LISTENING       InHost
  TCP    127.0.0.1:1433         0.0.0.0:0              LISTENING       InHost
  TCP    [::]:1433              [::]:0                 LISTENING       InHost
  TCP    [::1]:1433             [::]:0                 LISTENING       InHost
inside the wsl vm
/mnt/c/Users/[redacted] # netstat -nlp | grep 1433
tcp        0      0 0.0.0.0:1433            0.0.0.0:*               LISTEN      21191/docker-proxy
tcp        0      0 :::1433                 :::*                    LISTEN      21199/docker-proxy
this is all correct and seems to be working fine
and I used the docker compose that shared with me
version: "3.2"
services:

  sql-server-db:
    image: "<http://mcr.microsoft.com/mssql/server:2017-CU22-ubuntu-16.04|mcr.microsoft.com/mssql/server:2017-CU22-ubuntu-16.04>"
    container_name: sqlserver-integrationtest
    ports:
      - "1433:1433"
    environment:
      SA_PASSWORD: "myPassowrdThingy"
      ACCEPT_EULA: "Y"
I wonder if you need to factory reset your rancher desktop
and remove all the edits that you did on the windows with
host
file
p

powerful-electrician-18876

11/18/2022, 9:17 PM
ok I will try that now
I get following after factory reset
c

calm-sugar-3169

11/18/2022, 9:29 PM
that looks like RD isn’t installed correctly
I would strongly recommend uninstall and do a clean install again if you can
p

powerful-electrician-18876

11/18/2022, 9:30 PM
sure I will do this I taught so as well thanks
👍 1
Hi Nino I have clean reinstalled. I have same the issue with where I couldn't use localhost. And, "netsh interface portproxy show all" doesn't yield any result. Just a not my work uses "z scaler" and its not a problem with docker desktop. Wonder if it issue with Rancher Desktop
c

calm-sugar-3169

11/21/2022, 6:09 PM
Hi @powerful-electrician-18876 out curiosity, did you install Rancher Desktop as admin or non-admin?
p

powerful-electrician-18876

11/21/2022, 8:27 PM
As admin
I checked the setup also bring OS elevate privilege screen