First, verify network connectivity on your host, where the Virtual Box is running.
Second, shut your virtual ubuntu machine down.
Edit the setting, go to the network properties of the virtual machine and verify that network is bridged, cable connected is checked.
Start your virtual machine.
If using a desktop, then logon to the VM. Find the icon which looks like an up/down arrow, right click and choose edit connections.
Highlight the appropriate connection and choose edit. Verify your settings. if not using DHCP, then pay special attention to netmask and gateway properties.
Once complete, save your settings and exit the dialog.
Right click on the Up/Down Arrow icon again, select disable networking, give it a moment, the repeat the process to Enable Networking.
If logging in from a text console, e would want to verify the values in the /etc/network/interfaces file.
This will provide a list of all active network adapters the system is able to see.
sudo nano /etc/network/interfaces
The file should resemble the following, more or less:
iface lo inet loopback
iface eth0 inet dhcp
For the value shown with
ifconfig -a, substitute with eth0.
I hope this helps.