13

After I press ctrl + alt + f4 the virtual terminal appears but I can't exit anymore because it is always back to "input username" and "password". Any idea how to go back to my desktop?

  • 2
    In Ubuntu 18.04 Bionic Beaver the login screen now uses virtual terminal 1 instead of virtual terminal 7 – Arun Jun 28 '18 at 6:32
18

@Kerth G. if you press these buttons: Ctrl+Alt+(F1 to F6), you will get TTY, to exit from that you have two ways:

  1. Press Ctrl+Alt+F7, if you have function keys enabled press Ctrl+Alt+Fn+F7.
  2. Log into TTY with your user credentials, then in TTY type command: init 5, press Enter, now you will get Graphical User Interface.
| improve this answer | |
  • In my case with function keys I had to Ctrl+Alt+Fn+F1 to switch to terminal. But then to go back I had to Ctrl+Alt+F7, withouth Fn! – tokosh Aug 24 '16 at 15:37
  • 1
    Note that on Gnome the GUI could be on TTY2. – Nonny Moose Jun 28 '18 at 13:52
  • 1
    And if you want to exit tty first type exit or press Ctrl+D to logout. Afterwards in ubuntu the GUI can be found with Ctrl+Alt+F2. – abu_bua Jun 28 '18 at 15:05
4

To log out of a virtual console, you need to type exit.

Your Desktop Environment will be started in one of the virtual terminals. On Ubuntu, it is on tty7. So to get to it, press Ctrl + Alt + F7.

| improve this answer | |
  • oh yeah it works, thanks dude but can i ask something? what is the use of virtual terminals? – Kerth G. Aug 8 '15 at 5:00
  • 1
    @KerthG. It's beautifully explained here. Also, if I solved your issue, please mark it as an answer. – daltonfury42 Aug 8 '15 at 5:02
  • @KerthG. If you think more about it, actually there are only virtual terminals. In one of the virtual terminals, you run your desktop. In servers, for example, there is no GUI, and all the user had are a set of virtual terminals/consoles. He could switch between terminals and run commands. What you do when you type some commands from the GUI is to open a terminal emulator, which runs four command on the shell. – daltonfury42 Aug 8 '15 at 5:14
  • 2
    @KerthG. To add to his point, the vterms are not created and destroyed as you switch among them; they are always there unless you go out of your way to remove them. Additionally, a simple use case is if your desktop is hanging because of firefox or something and you want to use a vterm to kill it. You can also use it to log in as another user to perform some CLI commands while leaving the desktop session open. – MGodby Aug 8 '15 at 5:49
  • 1
    yah, now i understand how the vterminal works so it means its like DOS command in windows. This is my first time to switch ni linux OS so I think I need to learn some keywords and command. By the way thanks for very informative answer. I appreciate it @MGodby I thinks someday I gonna master Ubuntu and other linux base OS – Kerth G. Aug 8 '15 at 8:52
2

I tried all the other answers here, and none worked for me (Ubuntu VM)

To fix it, I logged in with my credentials and typed init 6 and chose to load the Ubuntu OS.

| improve this answer | |
2

Usually one virtual terminal (1 or 7) is reserved for the graphical environment, so to come out of a virtual terminal either try CTRL + ALT + F1 or CTRL + ALT + F7.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.