I am looking to run Ubuntu/Xubuntu in a complete non-GUI mode. Like, when the system starts it needs to log in into console. That is all, no loading of any display manager, x server, GUI-based app support, nothing in the background either for GUI.
What you want is can be achieved by installing Ubuntu Server Edition which does not has a display manager, X server etc. But if you do have an Ubuntu or a Xubuntu installation in your computer and want to work in a non-GUI environment, you can use virtual consoles which are called tty.
- Close all opened applications.
- press ctrl+alt+F2
- Log in with you user name and password.
- Stop display server and Xserver by giving
sudo service lightdm stopcommand.
To restart GUI,
sudo service lightdm start command is enough.
And you are ready to work in an environment as you described in your post.
Another workaround you can use to remove a lot of packages to obtain "pure Ubuntu" as described in this blog post. For Xubuntu, the command that will leave you with "pure Ubuntu" is
I removed the last command, which is
apt-get install ubuntu-desktop, that installs packages like Unity and turn your Xubuntu to Ubuntu. As you can see, there are a lot of packages that is very hard to track and you may need some packages. Since I do not use Xubuntu, I can not say which packages must be kept.
You can simply disable X from startup. Install rcconf:
sudo apt-get install rcconf
Run it with sudo:
And search for the entry x11-common, disable it and select OK. Then reboot.
If you ever change your mind, Xorg will be still installed, but it won't load on startup so you just need to re-run rcconf and re-enable x11-common.
Actually it is easy to do but it would be little risky for beginners.
Also it would not be the best way but you can easily achieve this. I'm posting the way to make Ubuntu to run without GUI mode also how to revert:
Make Ubuntu to run without GUI
You have to un-install the only display manager installed to your system. It would be
lightdm display manager. so to remove it execute this command:
sudo apt-get remove lightdm
Then restart your system. Your system will start in CLI mode. You may have to press Ctrl+Alt+F1 to go to CLI
Revert Back to GUI Mode
Again install the display manager to get the display. Use following command to do so:
sudo apt-get install lightdm
and restart your system with:
That's it. Reply if you need any help or something goes wrong.
Updating grub file's parameters worked for me.
First backup original grub file.
sudo cp -n /etc/default/grub /etc/default/grub.orig
If for some reason you want to revert to original settings, just run command below in terminal:
sudo mv /etc/default/grub.orig /etc/default/grub && sudo update-grub
Now edit the grub file
sudo nano /etc/default/grub
- Comment the line GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash”, by adding # at the beginning, which will disable the Ubuntu purple screen.
- Change GRUB_CMDLINE_LINUX=”" to GRUB_CMDLINE_LINUX=”text”, this makes Ubuntu boot directly into Text Mode.
- Uncomment this line #GRUB_TERMINAL=console, by removing the # at the beginning, this makes Grub Menu into real black & white Text Mode (without background image)
Finally run grub update and restart the system. Next time it will come up with terminal mode.
As explained here.
To ensure a complete non-GUI mode boot on Ubuntu without installing or uninstalling anything, do the following:
/etc/default/grubfile with your favourite text editor. I use vi:
sudo vi /etc/default/grub
- Press i to enter into vi edit mode.
- Look for the line that reads
#GRUB_TERMINAL=consoleand uncomment it by removing the leading
- Press Esc to exit vi edit mode.
- Type :wq to save the change made to the
/etc/default/grubfile and exit vi
sudo update-grubon your terminal to apply the modification you made to
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:
Now, every time you boot your system, you'll boot into a terminal.
But if you change your mind and want the login GUI to come up, simply run the following on the terminal that you booted into:
sudo systemctl start lightdm.service