https://rancher.com/ logo
#rancher-desktop
Title
# rancher-desktop
w

witty-librarian-14389

08/11/2022, 3:37 PM
Let me rephrase my question - when setting up RD on a mac, there is a network created between LIMA and Mac - there is an IP assigned to the mac as well as the linux box on this network. Is there a hostname that is automatically available that points to the Mac’s IP that can be used from the containers? I found that the networking is there, I can connect on those - but I am trying to allow other people to do the same instead of hardcoding the IP address that is likely specific to my machine 😕
i

icy-insurance-45500

08/11/2022, 8:12 PM
hi 👋 not sure if i understood your question correctly… If i remember well, reaching host should be available through
host.docker.internal
w

witty-librarian-14389

08/11/2022, 8:25 PM
this is where the language/vm nature becomes an issue -
host.docker.internal
is the IP of the Linux (lima) host, I need the IP of the Mac host
i

icy-insurance-45500

08/11/2022, 8:30 PM
I’ve just tried running a simple php server on Mac directly and accessed demo endpoint through
host.docker.internal
from java container ( curl ) using intel mac ( 2017 )
b

billowy-waitress-80413

08/11/2022, 8:33 PM
I think M3 wants the reverse.. sort of.
host.docker.internal
points your native php script on the mac to the lima VM (your java container), I think M3 wants to connect from a container out to the mac host. @witty-librarian-14389 - can you run
ifconfig
inside the VM? I've done this before to setup xdebug within a container to point to a running debugger on the host.
i

icy-insurance-45500

08/11/2022, 8:34 PM
host.docker.internal
points to
192.168.5.2
while LIMA VM has default
192.168.5.15
b

billowy-waitress-80413

08/11/2022, 8:34 PM
I think you can potentially use the
docker0
IP returned
p

proud-jewelry-46860

08/11/2022, 8:34 PM
The VM should have a 192.168.5.15 or something along those lines (host-only SLIRP), plus if you give it the password when it prompts, a vmnet interface that DHCPs on your local network.
b

billowy-waitress-80413

08/11/2022, 8:34 PM
but I guess that's not quite a host
w

witty-librarian-14389

08/11/2022, 8:39 PM
let me try a sanity check on this
Ok, It works fine when I tried manually - but did not work before in use, let me check what I screwed in practical use. Thanks
i

icy-insurance-45500

08/11/2022, 8:45 PM
could you just let us know which proposal worked ? - might come handy xD
w

witty-librarian-14389

08/11/2022, 8:46 PM
I had some hackery added to deal with minikube’s inability to resolve
host.docker.internal
properly - removing it, i can just use
host.docker.internal
and it points to the mac.
i

icy-insurance-45500

08/11/2022, 8:46 PM
great 👍
w

witty-librarian-14389

08/11/2022, 8:46 PM
i.e. as said in the very first reply, it just works unless you explicitly go and break it
😆 2
Thank you!!!
this saves me a lot of work
i

icy-insurance-45500

08/11/2022, 8:50 PM
just for the ref, just found a doc specifying HostIP… https://github.com/lima-vm/lima/blob/master/docs/network.md as said… might come handy 🙂
👍 2
w

witty-librarian-14389

08/11/2022, 9:09 PM
Thanks again
👍 1
4 Views