If you were trying to build the Android source with the instructions present here, and after
repo sync
stage, when you reboot the machine and it doesn't get past the splash screen, you will need to reinstall the ubuntu-desktop again. As stupid as it sounds, I spent almost a day trying to tweak VirtualBox settings with no luck. So, go ahead and just do the following:
sudo apt-get install --reinstall
Where, xX-desktop is the desktop environment you were running.e.g.
sudo apt-get install --reinstall xubuntu-desktop
sudo apt-get install --reinstall ubuntu-desktop
sudo apt-get install --reinstall kubuntu-desktop