Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to set up a pair of virtual (Win 2008 Server) servers on my laptop for demo'ing Velocity. I've got my first server setup with VirtualBox, but I'm slightly clueless about how to set up the networking so that host and guest can talk to each other. Both guests will also need to be able to talk to each other. The guests don't need to be able to talk to the outside Internet though it may be nice to have.

Do I need a virtual network? How do I set it up?

share|improve this question

3 Answers 3

The simplest approach would be to set the networking mode to bridged and just let your existing network stack handle everything.

To enable bridged networking, all you need to do is to open the Settings dialog of a virtual machine, go to the “Network” page and select “Bridged network” in the drop down list for the “Attached to” field. Finally, select desired host interface from the list at the bottom of the page, which contains the physical network interfaces of your systems.

share|improve this answer
    
Tried this, but when I select 'Bridged Adapter', I don't get a list of the hosts network adapters, I just get 'Not Selected' in the dropdown, and VirtualBox won't let me save it like this. Have I done something wrong in the initial configuration? –  PhilPursglove Jul 9 '09 at 9:19
    
What host OS are you running on and what version of VirtualBox? –  EasyEcho Jul 9 '09 at 11:24
    
Host OS is Win Xp Pro. VirtualBox version is 3.0.0 r49315. –  PhilPursglove Jul 9 '09 at 13:39

Another alternative is to port forward using the default virtual nat network. As long as the host and all running virtuals don't use the same ports you'll be fine.

  • Virtual #1 - db running on port x
  • Virtual #2 - velocity running on port y
  • Virtual #3 - lucene running on port z
  • etc.

Many examples and howto's online, here's the first from a web search

http://sk.c-wd.net/wp/2008/08/17/virtualbox-port-forwarding-with-windows-host/

share|improve this answer
    
Be careful, the NAT mode has some limitations (documented in the manual). –  wolfgangsz Aug 23 '09 at 17:18

I would recommend that you read the manual for VirtualBox, which is excellent in explaining the various options around networking. But essentially, EasyEcho has got it right, you want to set up a bridge and then connect the virtual adapters to the bridge. Each one of them will get it's own IP address from your DHCP server and they will all be able to talk to each other. If you need to be able to use this in a situation where you are not connected to any network, then you will have to manually configure the individual network devices. This will have to be done from inside the Guest OS. In this case just make sure that they are all on the same subnet as the bridge itself (which also needs manual configuration through the Host OS) and have the same subnet mask.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.