Force gdm login screen to the primary monitor

I have two monitors attached to my video card. Primary monitor has a resolution equal to 1280×1024 and the second has 1920×1200. 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 1280×1024?

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 1920×1080. The problem still persists, mouse cursor always appears in the right-bottom corner of the second monitor.

try switching the left/right order of your monitors, it doesn’t change which one is primary, but it might help making your GDM show up.

Answered By: hansioux

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.

Answered By: spinoza666

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

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
Answered By: Tobias Kienzler

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.

Answered By: kissgyorgy

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

  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>

Answered By: Andrew Mao

I am using Ubuntu 22.04 and for me this link works.

Only the path for copying destination changed over the last years a little bit from /var/lib/gdm/.config/ to /var/lib/gdm3/.config/.

  1. Change settings to single-mode in Settings → Displays.
  2. Copy the monitors.xml file from ~/.config/monitors.xml to
  3. Restart your PC.
  4. Change the setting back to dual screen in Settings → Displays.
  5. Copying again the monitors.xml file from ~/.config/monitors.xml to /var/lib/gdm3/.config/ (otherwise the second monitor turns on/off on boot).

That’s it.

Answered By: simpleuser43243