If you're using Ubuntu as a virtual machine, you can connect to the internet using a NAT connection. To do this, select "Edit" from the main menu, then "Preferences." Select "Network" from the Preferences menu and make sure that "NAT" is selected.