How can I reach a VM from another Mac on the LAN?

Discussions related to using VirtualBox on Mac OS X hosts.

How can I reach a VM from another Mac on the LAN?

Postby gctwnl » 30. Jan 2019, 22:01

I have a Mac (hermione, IP 192.168.2.86, macOS Mojave) that runs a Virtualbox 6.0.0 VM with address 192.168.97.1. netstat -rn on that machine says:
192.168.97         link#23            UC              2        0 vboxnet      !
192.168.97.1 a:0:27:0:0:2 UHLWI 0 4 lo0
192.168.97.100 8:0:27:f0:e0:3e UHLWIi 1 2 vboxnet 961
When I'm on that Mac, everything is fine, I can ping 192.168.97.1 (Virtualbox itself) and 192.168.1.100 (the VM).

Now, I want to be able to reach these from the outside. So on another Mac (luna) I've tried setting up routes to do that, e.g.

sudo route -v -t add -net 192.168.97 192.168.2.86

or

sudo route -v add -host 192.168.97.1 192.168.2.86

telling luna to route traffic for 192.168.97(.1) to 192.168.2.86 (the IP address of hermione)

But traffic won't get through. What am I doing wrong? Something to be set in the Virtualbox app or the macOS firewall?
gctwnl
 
Posts: 1
Joined: 30. Jan 2019, 21:51

Re: How can I reach a VM from another Mac on the LAN?

Postby mpack » 31. Jan 2019, 12:31

You need to be using bridged networking mode for that to work. NAT doesn't respond to unsolicited messages (unless you configure port forwarding), and all the other networking modes are virtual.

There could also be networking security options interfering, but that is for OS X experts to discuss.
mpack
Site Moderator
 
Posts: 29827
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP


Return to VirtualBox on Mac OS X Hosts

Who is online

Users browsing this forum: No registered users and 20 guests