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?
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.
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).