"You do not appear to be using the nvidia x server"(screenshot included)

I am running ubuntu 11.04 at my asus laptop.

Laptop specs:

CPU: i5-2410M @ 2,3GHz
RAM: 4GB
GPU: nvidia gforce GT 520M / (also the cpu has a bult-in graphics processor)

I am getting this error when I am trying to access the X server settings:

screenshot

Also, there is no xconfig file in the etc/x11 directory. Only the "xorg.cong.backup".
I've tried sudo startx and I got this:

Fatal server error:
Server is already active for display 0
    If this server is no longer running, remove /tmp/.X0-lock
    and start again.


Please consult the The X.Org Foundation support 
     at http://wiki.x.org
 for help. 

 ddxSigGiveUp: Closing log
XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0"
      after 7 requests (7 known processed) with 0 events remaining.

What is wrong?

Thank you for your time!


Solution 1:

The GT 520M is a nVidia Optimus laptop which is unsupported in Ubuntu. There are ways to get program to run on the nvidia card though which is described in Is a NVIDIA GeForce with Optimus Technology supported by Ubuntu?

After installing Bumblebee, you are able to run nvidia-settings using:

optirun nvidia-settings -c :8

Do not just run nvidia-xconfig, it'll create the /etc/X11/xorg.conf configuration file which breaks compositing and such because the driver does not support the nvidia card out-of-the-box. If you've already ran that command, remove the file:

sudo rm /etc/X11/xorg.conf