10.0.2.15 is the default host-only address you get in VirtualBox with the 
default NAT out to your LAN.   You likely need to expose port 1883 on the 
outside (192.168.1.x side) so that something can answer the phone, so to 
speak. 

It would be helpful if you'd draw us a network picture with which 
systems+VMs are where and what ip addresses are on which interface.

One howto for VirtualBox is 
at 
https://www.howtogeek.com/122641/how-to-forward-ports-to-a-virtual-machine-and-use-it-as-a-server/
 
- ignore the bridged example and check out how to do the port forwarding in 
the NAT'd example.   I'm guessing there's a way to do the same thing 
without a gui on the VM but I never do native VirtualBox any more, I always 
use Vagrant as a front end and then it's trivial to expose ports through 
the underlying NAT'd VM.   One example for ubuntu is 
at https://github.com/vinceskahan/weewx-vagrant/tree/master/pkg/ubuntu2004 
if you wanted to see the Vagrantfile there.   The provision.sh script will 
install a Simulator weewx and nginx and expose the web on port 8105.

Short answer is that if you use a default VirtualBox setup then you'll be 
NAT'ing and you'll need to do port forwarding in VirtualBox so that port 
1883 on your host (incoming) gets to port 1883 in the running VM on that 
host.

I would recommend not doing a bridged VM for security reasons.  Just expose 
a port and it'll work.  Really.

On Tuesday, January 26, 2021 at 3:39:35 PM UTC-8 Greg Troxel wrote:

>
> Jeff Beckman <[email protected]> writes:
>
> > I feel like I might not get much sleep this week, this is driving me 
> nuts. 
> > I installed linux on a VM on my desktop (the one that has working MQTT 
> > Explorer) and it worked. The default (oracle virtualbox) was to just 
> > attach to my NAT, so it got an IP of 10.0.2.15 (which my desktop passes 
> > through to 192.168.1.185?). Changing it to a bridge adapter, it picked 
> up 
> > a DHCP address of 192.168.1.218, and then it did not work.
>
> Unless you really know what you are doing, it seems unlikely that having
> 10.0.2.15 and 192.168.1.85 on the same LAN is sensible. Generally each
> Ethernet, real or virtual, should have one prefix and at most one DHCP
> server. Once there is address confusion, i suspect routing confusion.
>
> My advice is to first completely straighten out your home LANs
> addressing plan.
>
>
> > Here's my full setup: Router is a stand-alone box running pfsense. I 
> have 
> > a server that runs freebsd doing virtualization (static, 192.168.1.30). 
> > Home Assistant is a VM (static, 192.168.1.35). Weewx is a raspberry pi 2 
> > (static, 192.168.1.17). Desktop windows machine (DHCP, 192.168.1.185).
> >
> > I have another unrelated VM running on that free bsd machine for a 
> > minecraft server (static, 192.168.1.36). Remoting in there gives the 
> same 
> > problems trying to publish a message. This machine's network setup is 
> > almost identical to the Home Assistant machine and it is able to accept 
> > connections on its minecraft port, 1935 or something. 
>
> So where is 10/8? That's a bug, IMHO, and perhaps related, perhaps not.
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/80cecfd3-1b76-4814-8a7f-186a001e9a4dn%40googlegroups.com.

Reply via email to