So you may ask why would I want to make Ubuntu boot into terminal by default. Well, this post is specifically drafted for Ubuntu server, which is typically recommended to be left at commandline until a GUI environment is absolutely needed. But if have have other reasons to make your Ubuntu boot to command line then knock yourself out. I have set my Ubuntu server to boot to commandline by default for security reasons. Additionally this also reduces stress on my low power home server resources. When you really need a graphical user interface you can make Ubuntu boot to GUI with a simple command. First, I will show you how to make Ubuntu boot into terminal in 14.04 Trusty Tahr Server. This should also work in other flavors of Ubuntu. [Read: Install GUI on Ubuntu server 14.04 Trusty Tahr]
Force Ubuntu Boot into Terminal
To make Ubuntu boot command line by default, you will have to open and edit
/etc/default/grub. Open terminal, and open the file using the following command:
sudo nano /etc/default/grub
Find the line that says
GRUB_CMLDLINE_LINUX_DEFAULT. By default it should have quotation marks with nothing in between. Add the word “text” within the quotation marks as shown in the picture below.
Save the file by pressing Ctrl X, followed by “Y”. Then update Grub using the command
sudo update-grub to make Ubuntu boot into terminal on reboot.
Upon reboot, you should Ubuntu boot to commandline by default. You may watch this in action in the video tutorial below.
How to Start the GUI?
What you want to start your desktop environment or GUI? It’s easy, after you login just run the the command below and it should take you to your GUI desktop. [Read: Minimal desktop environment for Linux servers]
If you have multiple desktop environments installed then Ubuntu will start your last used GUI.
Make Ubuntu Boot to GUI
To reverse the changes and make Ubuntu boot to GUI desktop environment by default, edit the
/etc/default/grub file again and remove the word “text” from the quotes for
GRUB_CMLDLINE_LINUX_DEFAULT, as shown in the picture below.
Save (Ctrl X and then “Y” on nano editor) and exit. Upon reboot you should reach the graphical login manager directly.
In summary, some advantages to making Linux boot to command line are more security and less use of hardware resources. So if you run a Ubuntu home server, I strong recommend that you make Ubuntu boot into terminal environment by default and start GUI on demand basis. If you have other thoughts please leave a comment. Enjoy!