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.


7 Answers 7


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>

  • 10
    Confirmed, it works for GNOME 3.10 as well. The absolute location of ~gdm/.config/ is /var/lib/gdm/.config/ in case anyone else wonders.
    – Forage
    Nov 28, 2013 at 19:13
  • 9
    seen on gnome 3.14: sudo cp ~/.config/monitors.xml /var/lib/gdm3/.config/
    – Francois
    Nov 20, 2016 at 10:35
  • 1
    I can confirm that this simple trick works on Ubuntu 17.04 with Gnome 3.24.2 as well. I just ran the command @Francois posted and now it works like a charm. Jul 11, 2017 at 13:19
  • 2
    Still works in 17.10 using Xorg. But don't try to get smart and symlink your user configuration. It will not work.
    – raphinesse
    Nov 4, 2017 at 12:10
  • This should be marked as the correct answer.
    – AzP
    Oct 1, 2018 at 19:00

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.

  • Yes, I use Nvidia card in TwinView mode. In this mode every screen is screen 0. So unplugging didn't help. Nov 7, 2010 at 9:36
  • Okay, no experience with TwinView so sorry can't be of any more assistance
    – spinoza666
    Nov 9, 2010 at 20:30
  • I had to start nvidia-settings, X Server Display Configuration -> Save to X Configuration File -> Show preview -> copy paste all the content to /etc/X11/xorg.conf.d/nvidia.conf
    – morhook
    Oct 3, 2023 at 20:40

Old solutions do not work because the name of the gdm folder has changed. Here is the command to fix the issue of gdm displaying on the correct screen.

sudo cp ~/.config/monitors.xml /var/lib/gdm3/.config/monitors.xml

  • 1
    Worked for me on Debian 12. Thanks!
    – scrutari
    Sep 3, 2023 at 16:28

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
  • I have only one screen defined in the xorg.conf so this doesn't help. Jan 12, 2011 at 20:48
  • @Kirill: can you swap the plugs and then change screen ordering in the nvidia settings? Jan 13, 2011 at 8:57
  • It didn't help. Mouse 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. Jan 13, 2011 at 12:08

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.

  • I've tried this, but Gnome3 crashes each time on login in this mode. Dec 2, 2011 at 19:48

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 /var/lib/gdm3/.config/.
  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.


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.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .