Computer Science Mojo

~ David's Notes on coding, software and computer science




Post

How to choose VM VirtualBox networking

Category: Network     Tag: Network   VirtualBox  
By: David     On: Wed 29 July 2015     

When creating a new virtual machine in VM VirtualBox, the network is set to NAT by default, and most of the time, you should have internet connection right away; but what are all the options and how do we choose among them?
Alt Text

Software

Readings

First off

The easiest way is to stick with the default and use NAT, if NAT does not work for some reason, change to Bridged Adapter.

At this point if there is still no internet connection within the virtual machine, great chances are that there is something wrong with the internet connection on the host or with the computer's hardware.

All Networking options:

NAT

  • NAT stands for "Network Address Translation".
  • VirtualBox sets up a "virtual router" inside your computer connecting the host machine to the guest machine.
  • The IP of the guest would be 10.0. something.

NAT Network

  • NAT Network can be used to set up one "virtual router" for lots of guests to use. If you have two guests on NAT running at the same time, they could not directly see each other, as they are each behind their own "virtual routers"; But by setting up a NAT Network, they can grouped to the same network
  • Can't be used right away as you need to set up a NAT Network first. Go to File > preferences >Network > NAT Network and add a Network
    Alt Text

  • It is still labeled experimental

Bridged Adapter

  • Receives a 192.168.something address and makes your virtual machine seem like another physical machine on the same network as the host (though one may recognize it is a virtual machine through port scans)
  • Most suitable if the guest is used for hacking purposes
  • This is the best networking choice if you are running a server on the virtual machine
  • To set up; in the Name section, select your host's wireless card
    Alt Text

  • There are limitations on using IPv6, see Virtual networking for details.

Internal Network

  • Allows guests to set up their "personal" network and communicate privately without the host suspecting a thing
  • If all the guests have Internal Network as their only adapter, the guests can communicate to each other in their own network but no one is able to connect to the outside internet
  • Useful to simulate a virtual network
  • You'll have to set up static addresses or vboxmanage dhcpserver for the guests
  • A simple, though technically less secure, alternative is to use Bridge Adapter

Host-Only Adapter

  • Used so Internal Networks can access the outside internet
  • You'll have to set up static addresses or vboxmanage dhcpserver for the guests

Generic Driver

  • For connecting guests machines across different hosts