0

I was previously running VMWare Player hosting an Ubuntu 18.04 guest VM on a Windows 10 host. In my Ubuntu guest, I was able to launch a Ruby on Rails server bound to 0.0.0.0:3000 (any network adapter, port 3000, within the Ubuntu guest). Using this configuration, I was able to access my server from Chrome in my host machine using the following URL:

http://0.0.0.0:3000

Yesterday, I purchased an upgrade to VMWare Workstation Pro. At first, my Ubuntu VM wouldn't even launch, but then I used "Repair" under Add/Remove Programs in Windows 10, and I'm able to launch my Ubuntu VM now. However, now I have a different problem: my host machine is unable to access my guest machine at http://0.0.0.0:3000.

My Ubuntu guest VM is configured to use NAT for Network Adapter.

It seems that something has changed in the network configuration for my VM. Maybe I undid some settings that allowed my host machine to see my guest machine at the IP address 0.0.0.0.

What Network Adapter (or other setting) do I need in order to access my server at 0.0.0.0?

I've seen other replies to similar questions, and I want to emphasize that I have read other issues with slightly different details:

  • VirtualBox instead of VMWare
  • Those solutions often tell the user to look up the VM's IP address - this was not necessary for me using my previous configuration. I would prefer to get this working with 0.0.0.0 so I don't have to look up my VM's IP every time.
  • Some solutions have complex answers - I'm sure I didn't do anything fancy to get this working last time, I just don't know what changed when I used "Repair".

To answer some questions:

The output of netstat -ano | findstr LISTENING on the Windows host is:

TCP    0.0.0.0:135            0.0.0.0:0              LISTENING       1156
  TCP    0.0.0.0:443            0.0.0.0:0              LISTENING       7008
  TCP    0.0.0.0:445            0.0.0.0:0              LISTENING       4
  TCP    0.0.0.0:902            0.0.0.0:0              LISTENING       5548
  TCP    0.0.0.0:912            0.0.0.0:0              LISTENING       5548
  TCP    0.0.0.0:5040           0.0.0.0:0              LISTENING       9844
  TCP    0.0.0.0:5357           0.0.0.0:0              LISTENING       4
  TCP    0.0.0.0:5432           0.0.0.0:0              LISTENING       6800
  TCP    0.0.0.0:5433           0.0.0.0:0              LISTENING       6560
  TCP    0.0.0.0:6109           0.0.0.0:0              LISTENING       5152
  TCP    0.0.0.0:7680           0.0.0.0:0              LISTENING       18224
  TCP    0.0.0.0:49664          0.0.0.0:0              LISTENING       912
  TCP    0.0.0.0:49665          0.0.0.0:0              LISTENING       832
  TCP    0.0.0.0:49666          0.0.0.0:0              LISTENING       1872
  TCP    0.0.0.0:49667          0.0.0.0:0              LISTENING       2188
  TCP    0.0.0.0:49668          0.0.0.0:0              LISTENING       2820
  TCP    0.0.0.0:49669          0.0.0.0:0              LISTENING       4452
  TCP    0.0.0.0:49670          0.0.0.0:0              LISTENING       4612
  TCP    0.0.0.0:49755          0.0.0.0:0              LISTENING       904
  TCP    127.0.0.1:5354         0.0.0.0:0              LISTENING       5000
  TCP    127.0.0.1:5939         0.0.0.0:0              LISTENING       5560
  TCP    127.0.0.1:8307         0.0.0.0:0              LISTENING       7008
  TCP    127.0.0.1:28385        0.0.0.0:0              LISTENING       4
  TCP    127.0.0.1:49350        0.0.0.0:0              LISTENING       18336
  TCP    127.0.0.1:49351        0.0.0.0:0              LISTENING       18524
  TCP    127.0.0.1:49751        0.0.0.0:0              LISTENING       11472
  TCP    127.0.0.1:58091        0.0.0.0:0              LISTENING       5248
  TCP    127.0.0.1:58101        0.0.0.0:0              LISTENING       14360
  TCP    127.0.0.1:65001        0.0.0.0:0              LISTENING       5284
  TCP    192.168.1.68:139       0.0.0.0:0              LISTENING       4
  TCP    192.168.17.1:139       0.0.0.0:0              LISTENING       4
  TCP    192.168.33.1:139       0.0.0.0:0              LISTENING       4
  TCP    192.168.47.1:139       0.0.0.0:0              LISTENING       4
  TCP    192.168.56.1:139       0.0.0.0:0              LISTENING       4
  TCP    [::]:135               [::]:0                 LISTENING       1156
  TCP    [::]:443               [::]:0                 LISTENING       7008
  TCP    [::]:445               [::]:0                 LISTENING       4
  TCP    [::]:5357              [::]:0                 LISTENING       4
  TCP    [::]:5432              [::]:0                 LISTENING       6800
  TCP    [::]:5433              [::]:0                 LISTENING       6560
  TCP    [::]:7680              [::]:0                 LISTENING       18224
  TCP    [::]:49664             [::]:0                 LISTENING       912
  TCP    [::]:49665             [::]:0                 LISTENING       832
  TCP    [::]:49666             [::]:0                 LISTENING       1872
  TCP    [::]:49667             [::]:0                 LISTENING       2188
  TCP    [::]:49668             [::]:0                 LISTENING       2820
  TCP    [::]:49669             [::]:0                 LISTENING       4452
  TCP    [::]:49670             [::]:0                 LISTENING       4612
  TCP    [::]:49755             [::]:0                 LISTENING       904
  TCP    [::1]:8307             [::]:0                 LISTENING       7008

and the output of netstat -ntlup on Ubuntu guest is:

(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:8084            0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:3000            0.0.0.0:*               LISTEN      2419/puma 4.3.3 (tc 
tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.1:6942          0.0.0.0:*               LISTEN      2020/java           
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.1:63342         0.0.0.0:*               LISTEN      2020/java           
tcp6       0      0 ::1:631                 :::*                    LISTEN      -                   
udp        0      0 0.0.0.0:35758           0.0.0.0:*                           -                   
udp        0      0 127.0.0.53:53           0.0.0.0:*                           -                   
udp        0      0 0.0.0.0:68              0.0.0.0:*                           -                   
udp        0      0 0.0.0.0:631             0.0.0.0:*                           -                   
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           -                   
udp6       0      0 :::36455                :::*                                -                   
udp6       0      0 :::5353                 :::*

Here's another interesting piece of information: the IP address where I am able to reach the Rails server from Windows is 192.168.47.128. Note that this address does not appear in the list of addresses from netstat on the Windows host, but I am able to reach the server somehow. Maybe netstat -ano | findstr LISTENING is not the appropriate command; I'll look into netstat arguments on Windows.

Edit - I've just realized that I hadn't configured NAT port forwarding, but I have done so now, and I still don't get anything from 0.0.0.0:3000 on my host. Here's a picture of the VMWare Network Editor settings:

enter image description here

After setting up port forwarding, it looks like 0.0.0.0:3000 is listening on my Windows machine, but I still can't connect in Chrome. This is the output of netstat -ano | findstr LISTENING now:

 TCP    0.0.0.0:135            0.0.0.0:0              LISTENING       1156
  TCP    0.0.0.0:443            0.0.0.0:0              LISTENING       7008
  TCP    0.0.0.0:445            0.0.0.0:0              LISTENING       4
  TCP    0.0.0.0:902            0.0.0.0:0              LISTENING       5548
  TCP    0.0.0.0:912            0.0.0.0:0              LISTENING       5548
  TCP    0.0.0.0:3000           0.0.0.0:0              LISTENING       12252
  TCP    0.0.0.0:5040           0.0.0.0:0              LISTENING       9844
  TCP    0.0.0.0:5357           0.0.0.0:0              LISTENING       4
  TCP    0.0.0.0:5432           0.0.0.0:0              LISTENING       6800
  TCP    0.0.0.0:5433           0.0.0.0:0              LISTENING       6560
  TCP    0.0.0.0:6109           0.0.0.0:0              LISTENING       5152
  TCP    0.0.0.0:7680           0.0.0.0:0              LISTENING       18224
  TCP    0.0.0.0:49664          0.0.0.0:0              LISTENING       912
  TCP    0.0.0.0:49665          0.0.0.0:0              LISTENING       832
  TCP    0.0.0.0:49666          0.0.0.0:0              LISTENING       1872
  TCP    0.0.0.0:49667          0.0.0.0:0              LISTENING       2188
  TCP    0.0.0.0:49668          0.0.0.0:0              LISTENING       2820
  TCP    0.0.0.0:49669          0.0.0.0:0              LISTENING       4452
  TCP    0.0.0.0:49670          0.0.0.0:0              LISTENING       4612
  TCP    0.0.0.0:49755          0.0.0.0:0              LISTENING       904
  TCP    127.0.0.1:5354         0.0.0.0:0              LISTENING       5000
  TCP    127.0.0.1:5939         0.0.0.0:0              LISTENING       5560
  TCP    127.0.0.1:8307         0.0.0.0:0              LISTENING       7008
  TCP    127.0.0.1:28385        0.0.0.0:0              LISTENING       4
  TCP    127.0.0.1:49350        0.0.0.0:0              LISTENING       18336
  TCP    127.0.0.1:49351        0.0.0.0:0              LISTENING       18524
  TCP    127.0.0.1:49751        0.0.0.0:0              LISTENING       11472
  TCP    127.0.0.1:58091        0.0.0.0:0              LISTENING       5248
  TCP    127.0.0.1:58101        0.0.0.0:0              LISTENING       14360
  TCP    127.0.0.1:65001        0.0.0.0:0              LISTENING       5284
  TCP    192.168.1.68:139       0.0.0.0:0              LISTENING       4
  TCP    192.168.17.1:139       0.0.0.0:0              LISTENING       4
  TCP    192.168.33.1:139       0.0.0.0:0              LISTENING       4
  TCP    192.168.47.1:139       0.0.0.0:0              LISTENING       4
  TCP    192.168.56.1:139       0.0.0.0:0              LISTENING       4
  TCP    [::]:135               [::]:0                 LISTENING       1156
  TCP    [::]:443               [::]:0                 LISTENING       7008
  TCP    [::]:445               [::]:0                 LISTENING       4
  TCP    [::]:5357              [::]:0                 LISTENING       4
  TCP    [::]:5432              [::]:0                 LISTENING       6800
  TCP    [::]:5433              [::]:0                 LISTENING       6560
  TCP    [::]:7680              [::]:0                 LISTENING       18224
  TCP    [::]:49664             [::]:0                 LISTENING       912
  TCP    [::]:49665             [::]:0                 LISTENING       832
  TCP    [::]:49666             [::]:0                 LISTENING       1872
  TCP    [::]:49667             [::]:0                 LISTENING       2188
  TCP    [::]:49668             [::]:0                 LISTENING       2820
  TCP    [::]:49669             [::]:0                 LISTENING       4452
  TCP    [::]:49670             [::]:0                 LISTENING       4612
  TCP    [::]:49755             [::]:0                 LISTENING       904
  TCP    [::1]:8307             [::]:0                 LISTENING       7008

Ok, I've found that I can access my guest VM at 127.0.0.1:3000 with the configuration above, but it still isn't working with 0.0.0.0. I guess this works well enough for me, but I would still be interested to know how 0.0.0.0 was working previously.

This seems to be kind of a subtle question. Many Google hits point out that binding to 0.0.0.0 for a server process (rails) makes sense, but trying to access 0.0.0.0 from a browser as an IP address doesn't really make sense, because it's the equivalent of a wildcard.

This raises the question: how does this work on Mac and Ubuntu? I see other posts confirming that it's normal to be able to access development servers at 0.0.0.0:3000 on an Ubuntu or Mac machine, but 'something is different' on Windows. What is that something?

6
  • 1
    0.0.0.0 is not a target address. it is a route reference. you cannot ping or send traffic to 0.0.0.0. threatbrief.com/0-0-0-0-ip-address-uses it literally means "unspecified address". what is the output of netstat -ano | findstr LISTENING (windows) or netstat -ntlup in linux? Commented Jun 5, 2020 at 20:49
  • Provided you aren't really using virtual networks or a fancy configuration, I recommend using Bridged networking, so that your guest is on your LAN with your other PCs, and will get an IP address from your DHCP server, or let you set a static IP that other systems can reach. docs.vmware.com/en/VMware-Workstation-Pro/15.0/… Commented Jun 5, 2020 at 21:05
  • The thing is, 0.0.0.0 definitely works (at least from within the guest VM). I've been able to get this working with bridged networking, but then I have the annoying step of having to look up the IP of my VM rather than using 0.0.0.0 which is much easier to remember. If what you're saying is true about 0.0.0.0 (cannot send traffic to... etc), how is it possible that this works if I access this route within the VM?
    – afarley
    Commented Jun 5, 2020 at 21:09
  • @FrankThomas, I've updated my question with the output of those commands. The output of netstat makes sense w.r.t to what I'm seeing (0.0.0.0:3000 is listening inside the guest, but not the host). I guess the question is, how do I make the listening socket in the guest also appear on the host?
    – afarley
    Commented Jun 5, 2020 at 22:26
  • so if you use 192.168.47.128:3000, does it work? in terms of remembering, I'd use a name in your host file or a dns server if you have one, so you can myrailsserver:3000 or somesuch, Commented Jun 6, 2020 at 2:46

0

You must log in to answer this question.