“Boot into the command line console in Ubuntu 16.04”

My business partner, Alexis, posted a good blog for us old Linux fogies. I also used to start X from a console window. Ubuntu kind of cured me of that habit (I use lightdmexclusively). Anyway, here are his trials and tribulations trying to get Ubuntu 16.04 to behave. I’ve mirrored his text here so it’s mobile friendly:

As I just upgraded my 14.04 installation to 16.04, it booted right up to lightdm.

I had it properly setup to boot in a console before, but somehow it changed the behavior on me.

This is because the computer is now using systemd to boot.

I already had the GRUB variables setup as expected:


But this is not enough if you want to start in the console when running systemd (which is running since 15.04).

systemd has a list of variables you can tweak using the systemctl command. To boot in the console, you have to set that as the default:

sudo systemctl set-default

This prevents the graphical boot and starts using the console instead.

To go back to graphical boot, use the graphical target instead:

sudo systemctl set-default

And you will get the usual lightdm (or gmd) prompt instead of a console.

Now you may want to start X11 once in a while. I actually work in X11, but log out nightly so that way memory is not as tight and X11 is reset at least daily. As of 2016, the memory footprint may be a less of a problem, but it still cleans up all sorts of things, especially when upgrades happen. So… to start X11, I was used to run:

startx           # not working well with Ubuntu 16.04 / Unity

Instead of startx, we now want to run X11 with systemd which will make sure that all the necessary parts get loaded as expected. That is, startx will start the X11 screen but not Unity. You can do that manually (or many tweak a personal script that gets run by startx) with:

setsid unity

However, since 15.10, or maybe even 15.04, Ubuntu uses systemd whic is expected to be used to start the X11 environment. This works with the following command:

sudo systemctl start

The command will start X11 and Unity as expected. You can do that instead of startx. Only this won’t give you the option of logging out of X11 as you could before with the log out menu. Instead, you have to switch back to multi-users with a similar command:

sudo systemctl isolate

The commands switch you back to the standard super fast text consoles.

The switch back will generally take you to TTY 7 or 8 which is likely to be a black screen or have some boot logs, not a login prompt or the console you started from. To fix that problem, you may use the chvt command line option:

sudo chvt 1 && sudo systemctl isolate

Of course, you may just decide not to have to deal with that sort of things anymore and just stay in your X11 console throughout time… You can simply reboot once in a while when the environment decays too much…

Note: My previous version was saying to use “start” to “restart” the “”. That ended up breaking not too long ago so now I have to use “isolate”, which anyway is most certainly better.

Leave a Comment

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s