How do I boot into the console and then launch the Ubuntu desktop from it?

242,617

Solution 1

To return to the login screen

Press Ctrl+Alt+F7 to return to the login screen. You can exit your terminal session on tty1 by typing exit before you do that.

Doing startx -- :1 will start another X session under terminal tty1, logging you in directly (use :2, etc. for even more displays). Note that logging into multiple sessions as the same user is not recommended and could lead to system instability.


To skip the login screen completely, boot into the console and then start the GUI, you must modify GRUB:

  • sudo nano /etc/default/grub
  • Change line GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" to GRUB_CMDLINE_LINUX_DEFAULT="text"
  • Ctrl-X, press Y and then Enter to save and exit.
  • sudo update-grub
  • Reboot and you should come up directly in tty1 -- no need to press Ctrl-Alt-F1.
  • Login, and then startx to boot into the default desktop, or
    • unity for Unity
    • unity-2d-shell for Unity 2D
    • gnome-shell for Gnome
    • sudo service lightdm start to get the login screen (if you fix it :)

Solution 2

To skip the login GUI without using Ctrl+Alt+F1, simply do the following:

  • sudo vi /etc/default/grub
  • Press i to enter into vi edit mode.
  • Change the line that reads GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" to GRUB_CMDLINE_LINUX_DEFAULT="text"
  • Uncomment the line which reads #GRUB_TERMINAL=console by removing the leading #
  • Press Esc to exit vi edit mode.
  • Type :wq to save the change made to the /etc/default/grub file and exit vi.
  • Update /boot/grub/grub.cfg to have your change apply by running sudo update-grub

    If your computer uses systemd, you must tell systemd to skip the default login GUI thus:

    sudo systemctl enable multi-user.target --force
    sudo systemctl set-default multi-user.target
    
  • Reboot your computer: sudo reboot

Now, the login GUI will never show up.

Once you're in the terminal, run sudo systemctl start lightdm to start the default desktop.

Solution 3

If you want to load a new desktop from the terminal, type one of this things:

  • If using Unity, type unity.

  • If using Unity 2D, type unity-2d-shell.

  • If using GNOME, type gnome-shell.

Or just type startx if you want to load the default desktop environment :P

Solution 4

Temporary single boot to text mode

Another option to avoid the graphics mode at boot without completely altering your grub configuration is to press 'e' at the grub menu . This will show you the commands that grub will use to boot and allow you to change them for just this one boot. find the line that starts like:

linux  /boot/vmlinuz-{your current kernel version and root=UUID=some big long id} ro quite splash

In 14.04 that line will probably end with "quite splash" but it may end with "nomode" Whatever it ends with, change it to "text" to tell Linux that you want to boot in text mode.

Then press F10 to boot with the new temporary settings.

Add text mode menu option to grub

If you wish to add an item in the grub menu you can follow the instructions in

Add console/text booting mode to grub menu

Share:
242,617

Related videos on Youtube

doYourBit
Author by

doYourBit

Updated on September 18, 2022

Comments

  • doYourBit
    doYourBit over 1 year

    At the Ubuntu login page I have to hit Ctrl+Alt+F1 to be able to login as an user using the command line.

    But how do I get to the command line first and then start the Ubuntu desktop from it?

  • doYourBit
    doYourBit almost 12 years
    But I don't want to return to the login screen. The reason is that I can't login at the login screen because the wrong keyboard layout is available. To my idea is: login at the command line and load the ubuntu desktop (or whatever it's called).
  • ish
    ish almost 12 years
    @doYourBit please see extensive edit in the answer
  • Deepak Verma
    Deepak Verma almost 12 years
    @izs: How can you start another x session by simply typing startx. The default display, :0, is already being used, so you would need to specify a different display to use, wouldn't you? I remember doing it once in the past as an experiment, but it wasn't that simple at the time. I just tried it, and it didn't work for me.
  • ish
    ish almost 12 years
    @MartyFried : you're absolutely correct, thanks for reminding me. You'd need to do start -- :DISPLAY to be successful. I edited the answer to reflect this.
  • Christopher
    Christopher about 10 years
    You'll need to wait a bit after seeing the cursor at the top left of the screen until the login appears; or at least I did. I had - out of curiosity I logged out and into a cairo-dock session which left my laptop in an unusable state until I read these instructions.
  • Braden Best
    Braden Best almost 9 years
    @izx Weird, because my startx script has a while loop that increments $DISPLAY until it can't find a corresponding .Xn-lock file.
  • Dave Collins
    Dave Collins over 6 years
    This works perfectly! The only issue I am seeing is the 'startx' command runs a unity that has an "X" instead of a mouse pointer and no desktop, menu or other icons. Will post a separate question for that.
  • Daniel Okwufulueze
    Daniel Okwufulueze over 6 years
    @DaveCollins, thanks for the pointer. I have made a change to the command causing the issue you observed.
  • fiorentinoing
    fiorentinoing over 6 years
    I was missing the sudo systemctl enable multi-user.target --force sudo systemctl set-default multi-user.target part. Hope this help others like me.