Black screen on boot. FailsafeX: "Screen not found"

I had same problem today on Lenovo P50. The issue was that I switching to nvidia driver from stock open source driver. The display would go black when I boot and login gets stuck in loop when I go to recovery mode. When doing Ctrl+Alt+F1 and trying to startx I saw errors such as screen not found. The solution was simply to roll back to stock drives using this command line:

sudo apt-get remove --purge nvidia-*

Voila! I'm back in but then xorg reported some error. So I did,

sudo apt-get install --reinstall ubuntu-desktop

Now there are no issues.

Refrences:

  • How do you remove Nvidia's proprietary drivers?
  • startx doesn't work
  • X fails to load
  • Ubuntu gets stuck in a login loop