6 พ.ค. 2553

Disable X Window

Ubuntu uses the Debian model, and the default runlevel is 2, unless otherwise configured - so init 3 won't help, I'm afraid, unless you enjoy reconfiguring runlevels .

If you have the file /etc/X11/default-display-manager you can edit it or
do
echo "false" | sudo tee /etc/X11/default-display/manager

This will disable gdm/kdm/xdm , or whatever you have in that file

You can put it back with a text editor, or do for example
echo "/usr/sbin/gdm" | sudo tee /etc/X11/default-display-manager

Of course, for a temporary disabling of X you can just do
sudo /etc/init.d/gdm stop

then use the "restart" option or the
"start" option of that init.d script to restart it.