Ubuntu – Switching between virtual console and GUI

command linegui

How to switch between virtual console and GUI in Ubuntu? I wanted to see what key functions would allow me to switch between the two.

Best Answer

By default Ubuntu has 6 virtual consoles tty1-tty6 which are accessed by the keyboard combinations Ctrl+Alt+F1 to Ctrl+Alt+F6. The virtual console can also be accessed from a black screen if the boot process stops at a black screen when booting. To access the GUI from any virtual console press the keyboard combination Ctrl+Alt+F7.

Starting with Ubuntu 17.10 the virtual consoles are accessed by the keyboard combinations Ctrl+Alt+F3 to Ctrl+Alt+F6. To access the GUI from any virtual console press the keyboard combination Ctrl+Alt+F2.

To login from a virtual console:

  1. At the login: prompt type your username and press Enter.

  2. At the Password: prompt type your user password and press Enter. After you have logged in, you can run commands from the virtual console.

  3. To bring up the normal Ubuntu login screen run this command:

    sudo systemctl start lightdm.service  
    

    In 16.04 and later run this command instead to bring up the normal Ubuntu login screen:

    sudo systemctl start graphical.target