Say you use VirtualBox for testing purposes and you need to create an isolated network such that two or more guests can communicate with one another, without affecting your company network. With this setup, you can do all the testing you want knowing there will be no ramifications on your company’s main network. Depending on the extent of your testing, that could be a must.
How do you do that? Believe it or not, it’s actually quite easy–at least with the latest releases of the software. I’m going to be demonstrating this using VirtualBox 5.2.2. What platform VirtualBox is running upon doesn’t matter. However, for the sake of transparency, mine is running on Elementary OS.
Creating a new network
If you’ve only just recently upgraded VirtualBox, you might have noticed something a bit different in the interface. In the upper right corner, there are two drop-downs: Machine Tools and Global Tools. If you click on the Global Tools drop-down, and then click on the Host Network Manager entry, a new window will appear (Figure A).
In this new window, you can create a new virtual network by clicking the Create button. This will automatically populate the necessary information with a new virtual network–one that should work for your purpose. Unless it conflicts with your company network (it shouldn’t), leave the defaults.
If you need a DHCP server on your virtual network, click on the DHCP Server tab, and then click the checkbox for Enable Server (Figure B).
You can configure your DHCP server to meet your needs, and then click Apply.
Your virtual network is now ready to use.
Using your new network
In order to configure a guest to make use of the new network, it cannot be in a running state. Shut the guest down. Once it is no longer running, select it from the main window and click the Settings button. In the resulting window, click on the Network section. In the Attached to drop-down, select Host-only Adapter. In the Name drop-down, select the newly created virtual network (Figure C).
Once you’ve set the proper network on the necessary guests and started them up, they will appear on the newly created network able to reach one another, but not your main network. You can experiment to your heart’s content, without causing any trouble for your company.
Virtual networks made easy
It is now very simple to work with virtual networks on VirtualBox. Use this method for any guest server or desktop that does not need to be reached by machines on your primary network. So long as each guest is working on the same virtual network, they’ll at least be able to see one another.