Sometimes you don’t have internet on your virtualmachine, for this example I am using Fedora 25 with Virtual Box 5.1
First open a terminal and ping google.com
Click on devices, network settings, adapter: attached to: bridge adapter, name [the name of your device], advance: allow vms.
You can type: ifconfig on a terminal to see devices that you have.
if devices is not managed then type cd /etc/NetworkManger/, then ls to search NetworkManger.conf, edit it nano NetworkManager.conf and change managed to true ctrl+0 to save, ctrl+x to exit.