How to set Up Network within VirtualBox Ubuntu
First install four virtual machines on your virtual box. As shown in the picture.
Then , To Make the internal network follow the following step Select First (ubuntu) machine and go to its settings Now Go to the network->Adoptor2 the do the following setting.
Follow the same procedure for all four machines. Make sure that the Name field in the adopter section remains the same (intnet).The name of our network in intent.
Now start the Machines all together. and go to the Network->wired->options the machines as shown below.Now go to IP4 Settings->Manual and fill the new Addresses setting according to your requirement. And click save
Follow the same procedure for all the machines. Give each machine a different IP according to your network.
Now open the terminal and ping the machine to check they are in network. If you can ping the other machines successfully then your network is done.