- VirtualBox 4.1.16 r78094
- OS: Debian Linux
Let's say there are 2 Guest OSs which have to connect to the Internet via NAT. And you also need both of them to communicate with each other. This is impossible if you use just NAT one each virtual machine as they can't reach each other. You have to use VirtualBox's internal network.
This is the TRICKY part.
You must have 2 network interfaces on each virtual machine.
One is set to use NAT, another one is set to use "internal network" (choose "intnet1"). Then run this command:
VBoxManage dhcpserver add --netname intnet1
VBoxManage dhcpserver modify --netname intnet1 --ip 192.168.5.1 --netmask 255.255.255.0 --lowerip 192.168.5.2 --upperip 192.168.5.254 --enable