Home page of this blog

Thursday, October 29, 2009

New way to stop or start gdm/X server in Ubuntu Karmic 9.10 using service command

Today I was trying to install nvidia drivers manually on Ubuntu Karmic 9.10 (got installed using daily build of Ubuntu) as version 190.42 allowed controlling power options of nvidia card from nvidia settings.  see http://news.softpedia.com/news/Nvidia-190-42-Linux-Display-Driver-Has-Support-for-OpenGL-3-2-125389.shtml

First I removed nvidia drivers from Hardware Drivers (System --> Administration --> Hardware Drivers)

After removing the drivers given by Ubuntu which were old (185.36), I gave Ctrl + Alt + F1 and tried to install nvidia drivers as mentioned in softpedia. But nvidia kept complaining my X is running and I bruteforced by killing X, gdm using killall. None of them worked as ubuntu somehow managed to respawn X/gdm again with login prompt sound.

Then after trying for another 2 hours by searching in /etc/init.d folder I figured out the new interesting way to start or stop X/gdm at will in Ubuntu Karmic 9.10

This is how it is to be done and it looks cool and very easy

To stop gdm from virtual console (after going to virtual console by giving Ctrl + Alt + F1)

sudo service gdm stop

To start after installing nvidia drivers or whatever we did in console, to start it is as simple as stopping

sudo service gdm start

Here are the screenshots of the new powermizer settings of 190.42 nvidia driver settings after I managed to stop gdm, install nvidia driver manually and start gdm. Wow, I love ubuntu

Caution: Don't ever stop gdm from gnome-terminal as gnome-terminal is inside running gdm/gnome and you will be abruptly seeing a blank window. Please use Ctrl + Alt + F1 to goto first virtual console or Ctrl + Alt + F2 to second virtual console, login using ur credentials into ubuntu and you are set to call sudo service gdm stop/start


  1. Hi there,
    interesting post. By the invoked command you just stop GDM. Is it not needed to kill/stop X also?

    I have some troubles installing Arch in an old laptop with a nVidia card. If it works on Arch it would help.

    By the way. Is there a way to know which card driver is installed without editing xorg.conf?
    It seems that 9.10 has no xorg.conf on a fresh install.

  2. Hi,

    Answer to question 1 (does killing gdm, kill X in ubuntu, in short yes)

    There is no need to kill X in Ubuntu explicitly. By just stopping this gdm, it stops the entire X server. Ubuntu has tweaked all its startup scripts and you can find them inside /etc/init.d/

    All the files under /etc/init.d/ which has "execute" permission, can be controlled using service command

    Answer to question 2 (if you use archlinux, use pacman to install nvidia driver)
    I have arch linux with NVIDIA driver 190.42. Actually, I find arch linux far easier to configure than Ubuntu

    In archlinux it is quite simple to install nvidia as they have put the nvidia binary driver inside their extra repository. These are the set of commands to pull nvidia driver

    as root

    pacman -Syu

    after the above command succeeds,

    pacman -S nvidia nvidia-utils

    packagemanager will pull all dependicies, for X server and nvidia automatically

    after above installation reboot your box (or stop X server and start X server) and you should be running nvidia

    Answer to question 3

    Newer X server does not need Xorg.conf anymore!! Even inside archlinux, I don't have a Xorg.conf file to run X or nvidia driver. Everything is auto configured

    To know about your hardware in Ubuntu

    sudo lshw

    In archlinux install hwdetect and run it

    And if you face struggle installing nvidia driver in archlinux, give a try to chakra linux which is an arch distrolet (an arch distro, with customized installer and all hardware and gui configurations along with media codecs ready for you to play movies/songs)


    follow the above link to get hold of Chakra Linux

  3. Hi

    To stop and start X server in archlinux follow these steps

    1. Ctrl + Alt + F1
    2. Login with your credentials
    3. Become root using sudo su or su
    4. change runlevel by invoking the following command
    init 3
    5. rmmod nvidia
    6. modprobe nvidia
    7. nvidia-xconfig (this step is optional, if you wan't an Xorg.conf for your happy tweaking)
    8. init 5
    9. You should be in gdm or kdm by now
    10. If you dont have gdm or kdm, then exit out of root user and issue startx as normal user

    Hope this helps, you can follow arch wiki. Actually I have done many stupid experiments, where I ended up without gui or hang or wiped out hard drives or full of flicker, net result, I learned a lot

    For e.g, last saturday (31/Oct/2009), I recompiled glibc in ubuntu, installed it with some errors, ended up in console with no gui, then struggled another 4 hours with another full rebuild of glibc and got back to gui (actually I was trying to optimize glibc for core2)

  4. Hi again,
    Many thanks for all the provided info. I'll try it when I get some time (hope soon)
    I'll let you know...

  5. This comment has been removed by a blog administrator.

  6. That was awesome, thank you for posting that. It worked like a charm.