10

I recently installed Ubuntu 18.04 (previously 16.04) and an important feature is missing: the option to switch between GUI and TTY.

From the GUI I can switch to one of 5 TTY, by Ctrl-Alt-F2 to Ctrl-Alt-F6. I can login in the tty, do whatever I wish. When I Press Alt-F1, I get to the login-screen, not back to running GUI session. Alt-F7 leads to a black screen.

When I switch to the login screen, and login, I get a fresh GUI-Login. The programs have been terminated, the unsaved data and status is lost. This is annoying.

In previous versions, Alt-F7 brought me to the original, running GUI. Alt-F1 brought me to the console of the GUI. This is how I want it to be. The particular order of screens does not matter - the crucial item is to get back.

How can I customize 18.04 in this way?

PS: I basically have the default 18.04.4 desktop install using GNOME-shell (not unity). The only thing remotely non-standard is that it is MBR/Legacy, not GPT/UEFI install.

4
  • Did you try Ctrl-Alt-F2
    – Jean-Marie
    Apr 26 '19 at 13:14
  • 1
    Sure - it leads to one of the TTYs.
    – Andreas H
    Apr 30 '19 at 10:46
  • My system is like yours and Ctrl-Alt-F2 brings me back to the original GUI. But if I login another user, it all changes. Once I found the original GUI at Ctrl-Alt-F8 but it seems unpredictable with the few tests I made
    – Jean-Marie
    Apr 30 '19 at 13:05
  • same problem. i use nvidia drivers
    – Ferroao
    Jun 14 '19 at 15:29
12
+25

The part you are look for is at the bottom from: Switch to Console in Ubuntu 18.04 - How to Leave GUI?

In Ubuntu 18.04, they have changed things around and you cannot get to tty1, it is always showing the display manager / login screen. If you log in, you then cannot get to tty2 because it becomes the GUI for the first logged in user. The tradition of both GUIs showing on tty7 has ended.

You can get to tty3 by pressing Ctrl+Alt+F3, tty4 by pressing Ctrl+Alt+F4, tty5 by pressing Ctrl+Alt+F5 and tty6 by pressing Ctrl+Alt+F6.

You can then switch between tty3-6 by pressing Alt with the appropriate F-key.

Finally, you can get back to the GUI with Alt+F1 for the login chooser or Alt+F2 for the logged-in user's desktop.

To make a long story short use: Alt+F2


If the function keys don't work you can try these instructions.

In summary you can type:

sudo chvt 2

to switch to TTY2.

There is a lot more you can do with commands to bypass the function keys. Please read the link.

4
  • I'm on Ubuntu 18.04.3 LTS and TTY2 shows a text console instead of going back to the GUI. Any idea?
    – rbarriuso
    Aug 26 '19 at 16:09
  • Try sudo chvt 2 Aug 26 '19 at 17:04
  • Thanks but it just goes to the TTY2 console
    – rbarriuso
    Aug 27 '19 at 7:51
  • @rbarriuso did you try to push alt + F2? for me in 18.04 this works like described..
    – JoeFox
    Sep 2 '19 at 14:03
0

After some tests I have discovered the following using nvidia drivers:

When working in an external screen as the main screen:

CtrlAltF2-F6 goes to the differen ttys

CtrlAltF1 goes to the login screen and I lose my job after logging in

After being in one of the virtual consoles (ttys2-6), they can be changed with AltF2-F6 (AltF1 goes to the log in screen). Changing tty is also possible with Altrightarrow or Altleftarrow.

When working in the laptop screen as the main screen (booting without any external screen) I just have to do CtrlAltF1 to return to GUI. CtrlAltF2-F6 goes to the differen ttys

Answer to the question, when on an external main screen:

The only possibility to return to GUI, without losing work (logging in), is to disconnect the external screen or make the laptop be the main one - or mirror them BEFORE going to tty (virtual consoles), and then (after using tty) CtrlAltF7 or pressing altrightarrow from tty 6.

0
0

If I read your question correctly, the issue you are having is as follows:

  1. You login to your desktop manager session (GUI)
  2. At some later point, you need to switch to another tty, which you do so with CTRL+ALT+F2 through CTRL+ALT+F6 (the one for CTRL+ALT+F1 is a little special, as you can notice when you switch to it and see the tail portion of service startup log)
  3. Once done with all the work in the separate tty, you then attempt to switch back to your desktop environment usually found at tty7 accessible with CTRL+ALT+F7 (while it is usually at tty7, nothing prevents the user from starting a desktop session from another tty)
  4. When you get back to tty7 with CTRL+ALT+F7 you see graphical environment, BUT you find that your session has been forcefully logged out, and when you log in again all your previously open windows and work in progress gets lost in the ether.

If this is the situation you are encountering, there can be multiple reasons for it, however thankfully the info regarding it can be found in either

/var/crash or ~/.xsession-errors

Could you post the last lines of these logs.

In addition, when you switch to another tty, please run

sudo loginctl list-sessions and then once you find the session with the GUI desktop environment run sudo loginctl session status [ID] . this will tell you what is happening and what has already happened with the graphical session. You will be able to pinpoint if the error occurs when you switch from GUI, or later when you switch back to the graphical user interface.

0

BEWARE if running Linux in a VirtualBox on Windows: Geforce Experience uses Alt-F1, Alt-F2 & Alt-F3. You can delete the GeForce Experience shortcut by going into Settings, IN-GAME Overlay settings, Keyboard shortcuts, click on the shortcut, then clear it out using the Delete key.

0

In my case, to solve GUI error, I had to ubuntu-desktop package. So I logged in tty1 and ran

sudo apt-get update 
sudo apt-get install ubuntu-desktop
reboot

If the installation shows that you have broken packages, then you have to run sudo apt-get autoremove and retry the installation.

0

If your gui is not switching and if it doesn't connect to Internet even though you have then you can do :

dhclient eno1
systemctl start systemd-resolved

After that follow these commands from answer by shubham Gaonkar :

sudo apt-get update
sudo apt-get install Ubuntu-desktop
reboot

This solution is working for Ubuntu 20.04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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