This message was deleted.
# rancher-desktop
a
This message was deleted.
c
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
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
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
I'am having 172.25.80.1 for wsl, and for wireless - 192.168.68.137
c
Which IP address are you binding 1433 to?
Can you bind 1433 to
0.0.0.0
and try again?
p
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 150241.56 spid18s Server is listening on [ 'any' <ipv6> 1433]. 2022-11-18 150241.57 spid18s Server is listening on [ 'any' <ipv4> 1433]. 2022-11-18 150241.59 Server Server is listening on [ ::1 <ipv6> 1434]. 2022-11-18 150241.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
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
Copy code
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
oh sorry I got confused with host and container. the DB container is created using docker-compose yaml which worked fine in docker desktop.
Copy code
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
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
ok thank you
I get TCP 127.0.0.1:1433 0.0.0.0:0 LISTENING InHost
c
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
I get
tcp 0 0 0.0.0.0:1433 0.0.0.0:* LISTEN 14378/docker-proxy
c
can I ask also, what version of Rancher Desktop are you using?
p
1.6.2#
c
can you also share with me to output of
netsh interface portproxy show all
on windows
p
no result
c
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
ok where should I create on git ? sorry its new to me
c
you can choose, bug report
p
thank you very much I will do that now
c
include some steps like
docker-compose.yaml
so I can reproduce it on my end
p
sure
c
Thanks 🙂
@powerful-electrician-18876 I just tested this on my end it seems to be work fine 🤔
Copy code
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
Copy code
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
Copy code
/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
Copy code
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
ok I will try that now
I get following after factory reset
c
that looks like RD isn’t installed correctly
I would strongly recommend uninstall and do a clean install again if you can
p
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
Hi @powerful-electrician-18876 out curiosity, did you install Rancher Desktop as admin or non-admin?
p
As admin
I checked the setup also bring OS elevate privilege screen