Did you check that the DHCP is enabled ? In VirtualBox, go to Preferences -> Network, then edit the NAT Network you created. You should have this window :
VirtualBox edit network window
If "Supports DHCP" is checked, you can also set a static IP inside your VMs. Execute the command ip address
and check your working interface (probably ens160). Edit the file /etc/sysconfig/network-scripts/ifcfg-<interface-name>
(e.g. ifcfg-ens160) and change according to your network.
You should have something like this (some lines are omitted) :
TYPE=Ethernet
IPADDR=192.168.2.10
NETMASK=255.255.255.0
GATEWAY=192.168.2.254
DNS1=8.8.8.8
DNS2=8.8.8.4
DEFROUTE=yes
NAME=ens160
DEVICE=eth0
ONBOOT=yes
Then restart the network service with sudo systemctl restart network
.