I'm building a virtual cluster with VirtualBox and Opensuse. I have 10 physical machines and need several vms on each. The virtual machines are supposed to be in a "private" network, but still have internet access. I was asked to set up a virtual head node working as DHCP server. I installed DHCP server on the virtual head node and it seems works. On VirtualBox I set 2 network adapters to the head node, one bridged adapter and one internal network. One vm on the same physical machine has been set nic as internal network adapter. The vm can get IP address (so DHCP works) but can't access internet. What should I do? Specifically, what network adapter should I choose for head-node and work-nodes in VirtualBox? What in the virtual machines should I do?

  • Can you define what you mean by a private network? Is physically isolated needed? Is ethernet LAN segment isolation sufficient? Is private IP isolation sufficient? Is it OK for another machine on your network to have a private IP in the same IP subnet? – Skaperen Sep 13 '12 at 13:05

Your proposed set up will be a huge pain to implement the way you describe.

You can save yourself a headache if your physical machines have 2 physical ethernet ports. If they do, connect the 2nd port on each machine to a physical switch/router and use that physical port for the VMs. Then connect the switch/router to the internet.

  • Thanks for the answering, it seems promising.Yes physical machines have 2 ethernet ports. I also have a switch to connect all the physical machines. Then which VirtualBox network for VMs should be used, NAT or bridge? If I do this way, those VMs still need to access DHCP so to acess internet, right? – Tony Sep 12 '12 at 14:53
  • Bridged would have to be used. Since you have separate physical machines and VM hosts, NAT would cause you issues (part of the pain I was mentioning). – Keltari Sep 12 '12 at 16:57
  • I tried and the VMs can access internet. But since they get IP address from the router which is 192.168.x.x, I can't ssh to any of them from outside. Is there any way to change so I can ssh? Or at least let me access work VMs from the head VM? – Tony Sep 12 '12 at 20:56
  • well, you can set up a VPN server... I told you this proposed setup is a nightmare if you want it segregated from the rest of the LAN. – Keltari Sep 13 '12 at 1:27
  • If your need for isolation is an external requirement, you may need to be able to demonstrate that isolation exists. A physical isolation of the host machines would achieve that. But if you need to SSH in from some other machine, that doesn't seem so isolated. – Skaperen Sep 13 '12 at 13:07

Finally I figured out how to do this, and thanks to @Keltari, your answer is very helpful. Here is how I did it: 1. Set 2 network adapter for both head node and work node VMs. The physical node that hold head VM has 2 physical NIC, I connect one of them to a router(eth1), another one to the internet(on the wall, eth0). 2. For head VM: Setup a DHCP server on head VM with virtual NIC eth1 which been set as "internal network", set virtual NIC eth0 been bridge to physical eth0(direct internet). 2. Set one of the 2 virtual NIC of work VMs be "bridge", link to physical eth1(router); another virtual NIC been "internal network". 3. Then all work VMs can get IP from head VM so they can talk to each other through ssh via internal network. The work VMs can also have internet with the eth1(through router).

  • Can you draw a picture? I'm not following your terminology. – Skaperen Sep 14 '12 at 3:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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