How can I set my Ubuntu 12.04 LTS to boot to console without GUI?

79,993

Solution 1

That instructions works like a charm to me in my Ubuntu 12.04.1

Change (edit) in /etc/default/grub file:

From:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

To:

GRUB_CMDLINE_LINUX_DEFAULT="text"

Now you must update the grub configs:

sudo update-grub

And its done! After reboot, to start the gui just login and type:

sudo service lightdm start

Solution 2

On the How do I boot into console mode? question, user Michael K mentions that:

" Okay another way would be to disable the lightdm service in init:

/etc/init/lightdm.conf

in there there is a section like this:

start on (filesystem
and started dbus
and (drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1
or stopped udev-fallback-graphics))

"

Then to call the GUI I just need to run lightdm.

Share:
79,993

Related videos on Youtube

Johnny Bigoode
Author by

Johnny Bigoode

nothing yet

Updated on September 18, 2022

Comments

  • Johnny Bigoode
    Johnny Bigoode over 1 year

    So I installed Ubuntu server to run some tests on a VM. For various reasons I couldn't get a specific DEB file, and instead of using a shared folder I decided it would be a good idea to install ubuntu-desktop so I can run Firefox and grab the file directly from the web.

    Now, every time I boot my machine I get the graphical interface, but I have no reason for it since I'm running tests with the LAMP server.

    I tried this

    How do I boot into console mode?

    And this

    Possible to install ubuntu-desktop and then boot to no GUI

    If anyone has any idea for a solution, I'd appreciate it.

    BTW: I thought about simply uninstalling ubuntu-desktop, but I feel like I might need it in the future, so, I really just want to disable the GUI.

    EDIT:

    While this solution is not perfect I realized, it works for now:

    On the How do I boot into console mode? question, user Michael K mentions that:

    " Okay another way would be to disable the lightdm service in init:

    /etc/init/lightdm.conf
    

    in there there is a section like this:

    start on (filesystem
    and started dbus
    and (drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1
    or stopped udev-fallback-graphics))
    

    "

    While this worked perfectly, I can't access the GUI with the startx command - the system just crashes. And I guess I'll need to uncomment the section to load startx.

    Considering the fact that I want to keep the server running for as long as possible, having to restart it every time I want to log in the GUI is kinda unproductive.

    EDIT2:

    I guess it's possible simply to kill the GUI ( How to stop the Unity Desktop ) when I log in the system, it's still counter productive, but it works too.

    EDIT3:

    Michael K's reply worked fine. I just realized that to call the GUI I need to run lightdm and not startx

    • Marco Scannadinari
      Marco Scannadinari almost 12 years
      Maybe you could delete the Unity + 2D sessions and see what happens: cd /usr/share/xsessions, ls, then delete all of them: rm x.desktop rm y.desktop ...etc.
    • Marco Scannadinari
      Marco Scannadinari almost 12 years
      Yes. Although I am not sure what could happen, it's only a guess - so it might destroy everything, or it could fallback into a prompt.
    • Johnny Bigoode
      Johnny Bigoode almost 12 years
      Meh, who cares? It's a VMBox, and I already managed to learn a lot =p. Anyways, I deleted them all, and I still get the GUI.
  • vincent mathew
    vincent mathew almost 10 years
    In case 'startx' doesnot work try 'sudo start lightdm'