Hope you are doing good.
Please follow the below given steps to resolve the issue:
(i) Please power off the VM and then go to network settings in Virtual box
(ii) Set Adapter 1 as NAT and Adapter 2 as Hosts Only Adapter as shown below:
(iii) Then open the VM and follow the same as shown:
Now open the terminal and give ifconfig for the ip address.
Please let us know if the issue persist.
I will wait for your response.