user1050619
user1050619

Reputation: 20856

Connect multiple vms to external network

Currently, I have 2 VM's(Ubuntu) running on my mac machine. Now, I need following things to happen -

  1. VM's needs to communicate with each other.
  2. VM's needs to communicate external as well(eg: able to ping google.com)

I'm able to do either one of these but could not get both working.

For VM's to communicate each other, I setup a host only adapter which assigns a ip for each vm's and its able to communicate but this cuts the communication to the external work.

If I setup to NAT, the VM's are able to talk externally but not within each other.

How can I accomplish this?

Upvotes: 0

Views: 1015

Answers (2)

yogipriyo
yogipriyo

Reputation: 635

As an alternative to NAT mode, you can also get what you want by using the bridged network mode. It will allow your host and VMs to communicate each other as if they are all connected in the same network, and if your host is connected to the internet then your VMs are connected to the internet as well.

Upvotes: 0

darklion
darklion

Reputation: 1055

There are two types of networks with NAT in their name in VirtualBox. The base one, "NAT", does not allow VMs to see each other even though it allows contact to the external network.

The newer, experimental one called "NAT Network" or NAT Networking Service" (https://www.virtualbox.org/manual/ch06.html#network_nat_service) allows both internal and external communication much like machines connected to a home router (to paraphrase the documentation).

Upvotes: 1

Related Questions