In Settings>Network of the VM set “Attached to: Internal network”
On host add DHCP server:
VBoxManage dhcpserver add --netname intnet --ip 10.13.13.100 --netmask 255.255.255.0 --lowerip 10.13.13.101 --upperip 10.13.13.254 --enable
To delete the server:
VBoxManage dhcpserver remove --netname intnet
This only enables communication between the VMs. If a VM needs internet access you should add a new network adapter in Settings>Network>Adapter 2>Attached to NAT and then configure the interface in /etc/network/interfaces
e.g.
# The loopback network interface auto lo iface lo inet loopback # NAT auto enp0s3 iface enp0s3 inet dhcp # Host only auto enp0s8 iface enp0s8 inet dhcp