Score:0

How to configure Windows>Vmware>Docker>nginx so I can access http

cn flag

On my PC I have this stack:

  • Microsoft Windows [Version 10.0.19042.1110]
  • VmWare Player 16.1.2 build-17966106 installed in windows
  • CentOS Stream 8 installed in a VM
  • Docker 20.10.7 installed on CentOS
  • nginx latest launched via docker run -p 8000:80 nginx

How can I access nginx from Windows chrome browser?

Within the VM it works - I can browse to http://localhost:8000 and see the nginx landing page, but same url opened from windows returns ERR_CONNECTION_REFUSED.

I've tried the configuration below with no success.

VmWare network adapter is configured "Bridged" (unchecked Replicate physical network).

After configuring firewall in guest sudo firewall-cmd --list-all shows this:

public (active)
  target: default
  icmp-block-inversion: no
  interfaces: ens33
  sources: 
  services: cockpit dhcpv6-client http ssh
  ports: 8000/tcp
  protocols: 
  forward: no
  masquerade: no
  forward-ports: 
  source-ports: 
  icmp-blocks: 
  rich rules: 

The ifconfig ens33 command returns:

ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.167  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 2600:1700:9450:61a0:20c:29ff:fe61:e09a  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::20c:29ff:fe61:e09a  prefixlen 64  scopeid 0x20<link>
        inet6 2600:1700:9450:61a0::22  prefixlen 128  scopeid 0x0<global>
        ether 00:0c:29:61:e0:9a  txqueuelen 1000  (Ethernet)
        RX packets 142905  bytes 202802932 (193.4 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 70060  bytes 5010134 (4.7 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

From windows prompt, ipconfig includes the adapters below (I can ping 192.168.159.1 and 192.168.181.1 successfully) :

Ethernet adapter VMware Network Adapter VMnet1:

   Connection-specific DNS Suffix  . : 
   Link-local IPv6 Address . . . . . : fe80::4c50:95ea:37ab:119e%7
   IPv4 Address. . . . . . . . . . . : 192.168.181.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 

Ethernet adapter VMware Network Adapter VMnet8:

   Connection-specific DNS Suffix  . : 
   Link-local IPv6 Address . . . . . : fe80::bc63:e5b3:244d:f11c%9
   IPv4 Address. . . . . . . . . . . : 192.168.159.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 

I've seen suggestions to use the Virtual Network Editor to configure things, but that's not included with VMWare Player.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.