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:
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:
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?
netstat -ano | findstr LISTENING
(windows) ornetstat -ntlup
in linux?