Virtual Box networking options

1

I have virtual box installed on a laptop and am confused by the various networking option. I would like

  • Whether the host is connected to a network or working standalone
    • Connect using SSH, HTTP between guests and between host and guest (ideally both ways)
    • When host is connected to a network then the guests can access the internet via SSH and HTTP

Which option would suit me best for this.

One approach might be to point me to an alternative description of the various network modes, possibly including diagrams.

justintime

Posted 2011-08-31T09:58:22.937

Reputation: 2 651

Answers

0

VirtualBox (4.0) has 4 types of network avalible:

  • NAT (Network Attatched Translation). This is the default setting which guest machines typically only access out (i.e. the internet).
  • Bridged Addaptor. This means the Virtual Machine uses the host machines network card. It acts like any normal other machines on the virtual network, will get an IP from the network DHCP server, and can be port-forwared to for services such as Web servers. This is probably what you want.
  • Internal. This is a internal network that only Virtual Machines on one host can access. This is probably used most for local dev and internal server networks.
  • Finally, Host-Only. This is a local network with all Virtual Machines attatched to the host machine, including the host machines itself. This is a seprate network driver installed along with VirtualBox.

For more detailed information, check out "Chapter 6: Virtual Networking" of the VirtualBox Manual.

tombull89

Posted 2011-08-31T09:58:22.937

Reputation: 6 533

if you're in wireless, or bridged dosen't work use NAT. ele use bridged. – Journeyman Geek – 2011-08-31T10:11:16.330

My guests use Bridged over a wireless card. Also, emphisis added to answer. – tombull89 – 2011-08-31T10:12:32.850

that's odd, i'm quite sure its never worked with wireless. I need to give it a poke in a bit – Journeyman Geek – 2011-08-31T10:15:29.743

@Journeyman: Bridged "works" with wireless in the sense that you can access the network... But it results in a big mess, as all VMs will appear to have the host's MAC address. It's possible to make it work nicely, though (if you control the AP).

– user1686 – 2011-08-31T10:41:37.627

@grawity doesn't happen to me. I can view my AP's DHCP listings and it shows my laptop on one IP and MAC and the guest on a different IP and (vastly) different MAC. I am on Windows 7/XP though. – tombull89 – 2011-08-31T11:07:24.573

Thanks for reply and comments. Doesnt Bridged mode mean that the VMs will havce different IP addresses when the laptop is connected to a different location (sorry I diddnt make that clear in my request). – justintime – 2011-08-31T13:54:22.913

Typically, yes. If you use it on a home laptop and then take that laptop into work, the laptop will get a "new" ip address, as well as the virtual machine. – tombull89 – 2011-08-31T14:32:16.907

0

I found this overview table from https://www.thomas-krenn.com/en/wiki/Network_Configuration_in_VirtualBox (mirror) to be very clear:

enter image description here

Franck Dernoncourt

Posted 2011-08-31T09:58:22.937

Reputation: 13 518