Michael Eaton
Michael Eaton

Reputation: 75

Docker for Windows with existing hyper-v virtual machine

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

Upvotes: 0

Views: 1186

Answers (1)

Remus Rusanu
Remus Rusanu

Reputation: 294177

You need to connect to the IP the VM has acquired on the External switch. Run ipconfig inside the VM to see what IP it has, then open http://<vm-ip> from your host.

Upvotes: 3

Related Questions