Docker Community Forums

Share and learn in the Docker community.

Win10 Pro VM and Docker for Windows

docker

(Michael Eaton) #1

Hi,

I have the following setup:

A Windows 10 Pro Laptop (“Win10Laptop”) that has a Windows 10 Pro VM (“Win10VM”) running on Hyper-V. I have created an nginx container by running the following command on the host machine:

docker run -d -p 80:80 --name webserver nginx

While the container is running I can access http://localhost from Win10Laptop and this works fine. My question is what do I need to configure to access nginx from Win10VM? Win10VM has only one network adaptor which is configured to use the “External” Vswitch connected to my Wifi interface.

Let me know if you need any more details. I’ve tried all sorts and can’t figure it out!

Thanks,

Michael


(Sam) #2

let me feed back…

you have a windows machine as docker host (Win10Laptop), running hyperv
you start a container, mapping its port 80 to the hosts port 80.
while the container is running, http://locahost (which uses port 80 ) works correctly

now add a virtual windows 10 (Win10VM), on to that same Win10Laptop machine

from inside the VM u want to access the container app.

So, you need the IP address of Win10Laptop, which would be accessible from the container (external network)

AND the network firewall on Win10Laptop must be set to allow incoming network requests to port 80 (this is typically off by default)