Tuesday, March 26, 2013

Switching ubuntu boot from graphics to text mode.

This one has always puzzled me and make me go round and round few times now on all my new VM's, so I decided to note down what I did this time.

To Change the Graphic boot to Text mode on startup all you need to do is modify your /etc/init/.cfg file.

In my case I was trying to do this with gdm.cfg based on many google results however, I missed a crucial point that I had selected another Display Manager lightdm. After trying few things I finally realized the mistake. So here is the snippet from /etc/init/lightdm.cfg (This should be same for gdm as well in gdm.cfg):
start on ((filesystem
           and runlevel [!026]
           and started dbus
           and (drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1
                or stopped udev-fallback-graphics))
          or runlevel PREVLEVEL=S)

stop on runlevel [016]
You can change the runlevel in
stop on runlevel [016]
but I didn't find it necessary, just changing it in start on section did the job.