What I Want

I want to run a box as (typically) a 'server' (no GUI) and occasionally with the GUI because some things are easier that way. I'm working with Linux Mint 18 Cinnamon. I want to boot to console and not start mdm but I want to be able to switch back, so solutions involving totally removing mdm won't work well for me.

What I've Tried

For the default boot, I have edited grub (whole file below) GRUB_CMDLINE_LINUX="text" and run sudo update-grub but mdm still started; then I tried to set mdm to manual with echo manual | sudo tee /etc/init/mdm.override but mdm still started.

I can stop mdm manually with sudo service mdm stop which is close to what I want.

What's Wrong With My Solution

My best solution has me boot, starting mdm as usual, and then I must stop mdm manually. I want the machine to start normally from a reboot or power cycle except the GUI doesn't start at all (unless I tell it to, e.g. by editing grub or choosing a different option in the grub menu). By 'start normally' I mean that services like tomcat start and I can still rsh to the machine and/or remote debug it.

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)

# Uncomment to disable graphical terminal (grub-pc only)

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux

# Uncomment to disable generation of recovery mode menu entries

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

1 Answer 1

sudo systemctl disable mdm  

This doesn't actually 'disable' the service, it just prevents it from automatically starting.

Then if you want to go into your gui, you do

sudo systemctl start mdm

And if you want to boot to gui by default:

sudo systemctl enable mdm 

For pre-systemd systems, you'll want to delete the symlink for mdm in your /etc/rc* directories.

  • thank you, that fixed it completely. I thought "Linux Mint 18" was enough; do I need to say "Linux Mint 18 Sarah"?
    – bronzenose
    Commented Aug 13, 2016 at 0:46
  • My mistake, I overlooked where you indicated the version. Am glad it worked for you!
    – Stephan
    Commented Aug 14, 2016 at 17:48
  • Linux Mint 19 / Cinnamon uses lightdm, so sudo systemctl disable lightdm does the trick. Commented May 14, 2020 at 14:23
  • re-enable by calling sudo dpkg-reconfigure lightdm if sudo systemctl enable lightdm fails. Commented May 14, 2020 at 14:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .