Creating networks in VirtualBox

Published On: August 22, 2023

This article covers the step by step instruction on creating networks in VirtualBox

This article covers the step by step instruction on creating networks in VirtualBox.

About VirtualBox

VirtualBox is an OpenSource software to run virtual machines on x86 processors (most Intel & AMD processors).

When you try to run virtual environments in multiple VMs, you need to make sure that those VMs can communicate each other.

Scenario

This article focuses on two aspect of the VirtualBox networking;

  1. Virtual Machines should be reachable from one another and as well as from the host OS (ie; the OS where VirtualBox is running).
  2. The VMs should have internet access.

Creating HostOnly Network

The HostOnly Network will allow the VMs to reach each other as well as the VMs can be reachable from host OS.

Creating HostOnly Network without DHCP

  • Open VirtualBox
  • Click on Tools menu
  • Select Network

  • Click on Host-only Networks tab.
  • Click Create.

  • Select the newly created network.
  • Click DHCP Server tab.
  • Uncheck the Enable Server to disable DHCP.

Creating HostOnly Network

Creating NAT Network for Internet access

  • Click NAT Network.
  • Click Create.
  • Make sure Enable DHCP option is checked.

Selecting Networks in VM settings

In your VM network settings; Make sure to select the newly created HostOnly Network.

Make sure to select the newly created NAT Network.

A VM with this setup will have internet access as well as it can also reach other VMs running in the same host.


About the Author

Ansil

Ansil Hameed Kunju

Ansil has more than a decade of experience in different IT domains. He is an expert in DevOps.His skill set includes Linux, GCP, AWS, VMware, Nutanix, Rancher, Docker, Git, Python, Golang, Kubernetes, Istio, Prometheus, Grafana, ArgoCD, Jenkins, StackStorm and other CNCF projects.