Setting up networking is quite a difficult task in VirtualBox compared to other operations. Configuring networking can be done in a few clicks but understanding what are different network modes available and you have to choose a model that satisfies your needs.
In VirtualBox, each virtual machine can have up to 8 virtual network adapters. From VirtualBox GUI manager you can configure four network adapters and using VboxManage you can configure eight network adapters in total. VirtualBox has a built-in DHCP server that assigns an IP address to Guest VM based upon the mode you choose.
See more on the modes at Learn Different Networking Options in VirtualBox
Configuring VirtualBox networking is easy, but understanding what are different network modes available and how to choose a model that satisfies your needs.