How do I switch between GUI and command line startup?

Solution 1:

  1. Open a text-only virtual console by using the keyboard shortcut Ctrl+Alt+F3 (or Ctrl+Alt+F3-F6).

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

  3. At the Password: prompt type your user password and press Enter.

  4. Now you are logged in to a virtual console, and you can run terminal commands from the console. For example, you can run terminal commands from the virtual console to repair your boot problem, but Ubuntu Server boots to a virtual console by default. 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  
    
  5. If you get stuck in a virtual console, press the keyboard shortcut Ctrl+Alt+F7 to exit from the console.