Networking – How to i setup a guest-guest network connection with virtualbox

nat;networkingvirtualboxvirtualization

I have setup multiple guest hosts with NAT networking. On each hosts i have some portforwards so i can connect from my host (like 2222 to 22 host 1, 2223 to 22 host 2, …).

How can i setup a guest-guest network connection with virtualbox?

Best Answer

I would suggest just adding a second network adapter to each of your virtual machines that is configured with the "Host-Only" option. You could also use a bridged interface but that can do weird things if you have a wireless network adapter. The Host-only option allows your VMs to communicate with your host, as well as each other. This also means you can get rid of the port forwards on your NAT configuration as your host will be able to directly talk to each guest. There is a DHCP configured on the Host-only network by default, and it will typically hand out addresses in the 192.168.56.101-254 range - so you can use the .1-100 addresses for static assignments as well.

  • Open your VM settings
  • Choose the Network secton of the settings dialog
  • On the Adapter 2 tab
    • Check the box for Enable Network Adapter
    • Changed Attached to to Host-only Adapter

VirtualBox VM Settings - Network

Related Question