Force gdm login screen to the primary monitor

I have two monitors attached to my video card. Primary monitor has a resolution equal to 1280x1024 and the second has 1920x1200. My gdm login screen always appears on the second monitor even if it is switched off. My question is how to force gdm to show the login screen always on the primary monitor with resolution 1280x1024?

I use Nvidia GT9500 videcard in Twinview mode. I can't use Xinerama because vpdau doesn't work correclty in this mode.

What I have found is that mouse pointer always appears in the center of union of the screens and center is always on the monitor with higher resolution. Login screen always shows where mouse cursor is.


Now my primary monitor has a resolution equal to 1920x1080. The problem still persists, mouse cursor always appears in the right-bottom corner of the second monitor.


For newer versions of Ubuntu such as 13.10 or upgraded 13.04 using Gnome 3.8, this procedure is different because the X configuration file no longer controls the monitor layout. You must do the following:

  1. Set the monitor layout correctly as a logged-in user (see Permanantly set monitor as primary)

  2. Copy the configuration file over to the gdm settings

    cp ~/.config/monitors.xml ~gdm/.config/
    

For more details, see https://bbs.archlinux.org/viewtopic.php?id=161903

  1. Within the monitors.xml file there are tags labeled: <primary>something</primary>

For the monitor you want to be primary put a 'yes' in between the tags and a 'no' for all other screens. ex: <primary>yes</primary>


are you using a Nvidia card with a dual-screen setup?

If so, I had the same problem, and solved it the following way: Switch off the computer, unplug the second monitor, switch the computer back on, run 'sudo nvidia-settings', plug the second monitor back in, run 'Detect Displays' in the Nvidia GUI, and make the necessary configurations before saving the settings. The IMPORTANT point is that the screen that you wish the login to show up in is set to 'Screen Number: 0'.

In my case, leaving the second monitor plugged in before running 'nvidia-settings' left it as screen 0 for some reason, but by plugging it in after, this was sorted.


If twinview does it the same way the ATI catalyst control center does it, there is a xorg.conf you can edit with gksu gedit /etc/X11/xorg.conf

The relevant part of mine looks like this:

Section "ServerLayout"
    Identifier     "amdcccle Layout"
    Screen      0  "amdcccle-Screen[1]-0" 0 0
    Screen         "amdcccle-Screen[1]-1" 1400 0
EndSection

All you have to do (after backing up your xorg.conf of course) is change the ServerLayout by swapping the Screen entries (and adapting the screen numbers), in my case that would be:

Section "ServerLayout"
    Identifier     "amdcccle Layout"
    Screen      0  "amdcccle-Screen[1]-1" 1400 0
    Screen         "amdcccle-Screen[1]-0" 0 0
EndSection

You can try "Separate X screen setting" on the NVIDIA X Server settings. If you set the desired display to 0, the login window will appear there. It's working for me.