6

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_DEFAULT=0 #GRUB_HIDDEN_TIMEOUT=0 GRUB_HIDDEN_TIMEOUT_QUIET=true GRUB_TIMEOUT=10 GRUB_DISTRIBUTOR=lsb_release -i -s 2> /dev/null || echo Debian GRUB_CMDLINE_LINUX_DEFAULT="text" GRUB_CMDLINE_LINUX="text"

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 ...)

#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

Uncomment to disable graphical terminal (grub-pc only)

GRUB_TERMINAL=console

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'

#GRUB_GFXMODE=640x480

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

#GRUB_DISABLE_LINUX_UUID=true

Uncomment to disable generation of recovery mode menu entries

#GRUB_DISABLE_RECOVERY="true"

Uncomment to get a beep at grub start

#GRUB_INIT_TUNE="480 440 1"

1 Answers1

8
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.

Stephan
  • 2,911