If you use bridge then you virtual machine adapter should get your DHCP range IP address like 192.168.40.xx or
if you use NAT then host machine should get this range IP address 192.168.40.xx and your virtual machine should get different range IP address.
Please confirm this two condition then you must get internet to your virtual machine.