I tried to install an nvidia driver and there was an error saying I must not be in an X terminal when doing so. So I did a Ctrl+Alt+F1.

The resulting terminal did not allow the nvidia driver to be installed and showed the same error message. How do I revert back to the Unity GUI?

  • 3
    Related (but not a duplicate): What does “Ctrl + Alt + F12” do? Jul 26, 2014 at 23:29
  • Thanks, @EliahKagan! Useful comments are so seldom upvoted on StackExchange. I found that related question very useful when dealing with the problem that brought me to this one, and I'm sure others have/will as well. Thank you. Aug 23, 2015 at 7:19

7 Answers 7


Ctrl+Alt+F1 to F6 are the virtual consoles provided by the getty/agetty programs. Ctrl+Alt+F7 is the console where your X server is running. The GUI (Gnome/KDE or any other) runs over X. So to get back into your GUI window manager: type:






With 17.10 and newer, the login screen is on virtual terminal 1, and logged-in users' GUI sessions on VT2 and onwards. So, you may need to use Ctrl+Alt+F2 or Ctrl+Alt+F1 instead.

  • 3
    Be forewarned -- if you're trying this with a VM while in Windows, this can disable your extended displays -- use Win + P to recover with Extend Sep 7, 2016 at 21:24
  • 1
    Ctrl+Alt+F1 works for me.
    – joseluisq
    Jan 23, 2020 at 7:37

When you are in a virtual console just press Alt+RightArrow or Alt+LeftArrow to move to next/previous virtual console respectively. Console with X is usually seventh.

  • 1
    What i like about this is that this works accross the distros Apr 12, 2015 at 6:57
  • 1
    how to close them all then? Aug 4, 2017 at 20:00

For completeness, I'll mention the chvt command. The virtual terminal offers a login prompt, and if you have logged in, you can switch to other VTs:

chvt 7

will probably get you back to the GUI, since it usually runs on VT7, as mentioned in the other answers. This is useful for scripting (for example, when taking a screenshot of LightDM).


To revert to the GUI desktop you have to press:


  • 14
    Or just Alt+F7. Holding down Ctrl is only necessary when switching from the GUI to a text-based virtual console. Switching from one text-based virtual console to another (or to X11) can be accomplished with just Alt+Fn. Jun 29, 2012 at 14:44
  • On Freebsd with Lxde, I use Alt+F9 to return to Gui from other virtual consoles.
    – Hakim
    Sep 13, 2014 at 10:04

Ctrl+Alt+F7 does not work on LM13 Cinnamon. However, Alt+F8 brings it back to GUI.


You can determine on which terminals you and any other users are logged in with the who command. For me it was tty9, so I had to press Ctrl+Alt+F9.


It has been already mentioned that cycling with Alt+ArrowLeft until you get back to your bellowed desktop also works, especially accross distro's (my Fedora 20, for instance, has GUI on F2), so it's convenient.

There's also a crude method: login and run sudo service lightdm restart, which will restart your session ( so yes, you will be logged out and will get back to login screen ). This answer also takes into account that your login manager might not be lightdm, but the idea is the same.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .