How can I leave tty?

Normally, can enter a tty with Ctrl+Alt+(F1-F12), and in Ubuntu, and can exit it with Ctrl+Alt+F7. This problem is probably due to the login manager not starting. Try:

sudo service lightdm start

for the default lightdm login manager, and this for Gnome's login manager:

sudo /etc/init.d/gdm start

You can also try entering the user session directly:

startx

Pleases note that some of the above may be guesswork...