Het grootste fysieke ICT Expertisenetwerk van ondernemers in Nederland



Setting up a NAT network in VirtualBox 5

Setting up a NAT network in VirtualBox 5

  • Redactie The Future Group
  • 27 September 2016
  • |  

During the past years i used Parallels Desktop for virtualizing my Oracle development environments. I chose Parallels at that time because it performed better on my old memory constrained Macbook. Recently i had to upgrade to Parallels Desktop 11 and determined that Parallels silently removed quite some functions which were present in the previous versions. One of those functions is the Advanced Networking tool which supports the creation of virtual networks. These functions are still available, but only in the Pro version. So it was time to decide to take a yearly subscription to Parallels Pro or try to setup the same virtual network structure in VirtualBox 5.

The Parallels configuration i used had a virtual network for my guest hosts which had a NAT connection to network interfaces on my host. In this same virtual network my host also could participate. The VirtualBox 5 documentation is quite sketchy on setting up a NAT network, and the resources on this subject are limited. Therefore i took me some time to figure out that in a VirtualBox NAT network with network address the gateway was on and the DNS server on In a VirtualBox NAT network the host does not participate, and therefore it cannot reach the guests. To be able to access the guests from my host, as used to with Parallels, i had to create second host-only network. All brought together i came up with the following virtual network configuration.

I chose different private network addresses for the Virtual NAT and the host-only network. I have tried to setup both networks using different subnets on but was not able get this working properly.  Guests connected to the NAT network ( do participate in the same network. The guests also can connect to the external network (accessing the internet) through the NAT connection using the hosts physical network adapter. If a guest is connected to the host-only network ( it can connect to the host and vice versa. The host is connected to the host-only address and assigned ip-address
Both networks have a DHCP-server to distribute network configuration parameters.

Not all VirtualBox network configuration settings can be configured from the VirtualBox application. Therefore the following VBoxManage instructions can be used to create the network, interface and DHCP-servers.

# create NatNetwork
VBoxManage natnetwork add --netname NatNetwork --network "" --enable --dhcp on
# add dhcp server to the NatNetwork
VBoxManage dhcpserver add --netname NatNetwork --ip --lowerip --upperip --netmask
VBoxManage dhcpserver modify --netname NatNetwork --enable

# create hostonly interface
VBoxManage hostonlyif create
VBoxManage hostonlyif ipconfig vboxnet0 --ip --netmask
# add dhcp server to the hostonly interface
VBoxManage dhcpserver add --ifname vboxnet0 --ip --lowerip --upperip --netmask
VBoxManage dhcpserver modify --ifname vboxnet0 --enable

When the instructions have been completed successfully the configuration can be viewed from the VirtualBox application. Go to Preferences > Network to open the network configuration panels.


To configure guests-hosts to use the NAT Network and Host-only adapter, open the settings panel for  the guest-vm and select the Network tab. Attach Adapter 1 to NAT Network NatNetwork.


And attach Adapter 2 to the Host-only Adapter vboxnet0.


Good-bye Parallels, hello VirtualBox !


The post Setting up a NAT network in VirtualBox 5 appeared first on Reddipped.com.

Partner ImagePartner ImagePartner ImagePartner ImagePartner ImagePartner ImagePartner ImagePartner ImagePartner ImagePartner Image