Is there a way to boot Ubuntu 16.04 into command line only (do not start GUI)?

Hi,

Is there a way to disable ubuntu GUI? I almost do not use its GUI, I was wondering if there is a way to disable it (not uninstall, in case I will need it for future) . i.e., pretty much like respberry’s respbian, just use startx to start up guo when I do need it.

I haven’t tried this on a TX2 yet, but see if this works:

sudo systemctl disable lightdm.service
sudo systemctl stop lightdm.service
sudo chmod -x /usr/sbin/lightdm

If you want to just stop the GUI for just one session then you can do something like this.

Click
Ctrl + Alt + F1
at
Login

and after you login,
sudo service lightdm stop

sudo systemctl stop lightdm.service

does work on TX2, memory usage reduced to 400MB after stopping it. Thanks!

Ctrl + Alt + F1

Also works but seems that it doesnot release resource (xorg is still running on backend)

Thanks!

If you never want the GUI then sudo systemctl set-default multi-user.target will result in booting to the command prompt instead of the desktop.

The systemd way to stop “lightdm.service” from starting on boot on Ubuntu 16.04 on the TX2 is

$ sudo systemctl stop lightdm.service
$ sudo systemctl mask lightdm.service

Re-enable it to start at boot with

$ sudo systemctl unmask lightdm.service

Changing the systemd “target” won’t affect it (as suggested by @sperok), nor will “systemctl disable” (as suggested by @linuxdev)

400MB? Not good enough! ;-) Here’s the output from TX2 with no GUI and some custom daemons running in the background (main app is down):

root@tx2:/usr/src/read_temp# free
total used free shared buff/cache available
Mem: 8043188 137816 7670824 12896 234548 7824588
Swap: 0 0 0
root@tx2:/usr/src/read_temp#

-albertr

Has anyone succeeded to boot the TX2 into command line ?

I was able to stop it from running on boot by running

sudo systemctl set-default multi-user.target

and commenting out the line that reads

service lightdm restart

in

/etc/systemd/nvfb.sh