Gnome Login Menu On Wrong Screen

When I connect my notebook to an external monitor the Gnome login menu is displayed on my notebook instead of the external screen. The external screen is configured as primary monitor in the Gnome settings and I’m using Fedora 30. Do you have a tip on how I can configure the login screen to be displayed on the external screen?

Something like this:

sudo cp -f ~/.config/monitors.xml ~gdm/.config/monitors.xml
sudo chown $(id -u gdm):$(id -g gdm) ~gdm/.config/monitors.xml
sudo restorecon ~gdm/.config/monitors.xml

Assuming you have the same session type:

grep -r -e Session /var/lib/AccountsService/users
1 Like

Thanks for the tip. Unfortunately it didnt work after restarting I still have the same situation. Not sure about the session type:

$grep -r -e Session /var/lib/AccountsService/users
/var/lib/AccountsService/users/gnome-initial-setup:XSession=
/var/lib/AccountsService/users/silas:Session=
/var/lib/AccountsService/users/silas:XSession=gnome
/var/lib/AccountsService/users/gdm:XSession=
sudo ls -Z -l ~gdm/.config/monitors.xml
sudo cat ~gdm/.config/monitors.xml

What does it say?

➜  ~ ls -Z -l ~gdm/.config/monitors.xml
ls: cannot access '/var/lib/gdm/.config/monitors.xml': Permission denied
➜  ~ cat ~gdm/.config/monitors.xml
cat: /var/lib/gdm/.config/monitors.xml: Permission denied
➜  ~ sudo !!
➜  ~ sudo cat ~gdm/.config/monitors.xml
<monitors version="2">
  <configuration>
    <logicalmonitor>
      <x>0</x>
      <y>0</y>
      <scale>1</scale>
      <primary>yes</primary>
      <monitor>
        <monitorspec>
          <connector>eDP-1</connector>
          <vendor>AUO</vendor>
          <product>0x1536</product>
          <serial>0x00000000</serial>
        </monitorspec>
        <mode>
          <width>1920</width>
          <height>1080</height>
          <rate>59.963344573974609</rate>
        </mode>
      </monitor>
    </logicalmonitor>
  </configuration>
  <configuration>
    <logicalmonitor>
      <x>1280</x>
      <y>0</y>
      <scale>1</scale>
      <primary>yes</primary>
      <monitor>
        <monitorspec>
          <connector>HDMI-2</connector>
          <vendor>SAM</vendor>
          <product>S24E650</product>
          <serial>H4ZH100392</serial>
        </monitorspec>
        <mode>
          <width>1920</width>
          <height>1200</height>
          <rate>59.950672149658203</rate>
        </mode>
      </monitor>
    </logicalmonitor>
    <logicalmonitor>
      <x>0</x>
      <y>0</y>
      <scale>2</scale>
      <monitor>
        <monitorspec>
          <connector>eDP-1</connector>
          <vendor>AUO</vendor>
          <product>0x1536</product>
          <serial>0x00000000</serial>
        </monitorspec>
        <mode>
          <width>2560</width>
          <height>1440</height>
          <rate>60.048812866210938</rate>
        </mode>
      </monitor>
    </logicalmonitor>
  </configuration>
  <configuration>
    <logicalmonitor>
      <x>0</x>
      <y>0</y>
      <scale>2</scale>
      <monitor>
        <monitorspec>
          <connector>eDP-1</connector>
          <vendor>AUO</vendor>
          <product>0x1536</product>
          <serial>0x00000000</serial>
        </monitorspec>
        <mode>
          <width>2560</width>
          <height>1440</height>
          <rate>60.048812866210938</rate>
        </mode>
      </monitor>
    </logicalmonitor>
    <logicalmonitor>
      <x>1280</x>
      <y>0</y>
      <scale>1</scale>
      <primary>yes</primary>
      <monitor>
        <monitorspec>
          <connector>DP-1</connector>
          <vendor>APP</vendor>
          <product>LED Cinema</product>
          <serial>2A0493466JL</serial>
        </monitorspec>
        <mode>
          <width>2560</width>
          <height>1440</height>
          <rate>59.9510498046875</rate>
        </mode>
      </monitor>
    </logicalmonitor>
  </configuration>
  <configuration>
    <logicalmonitor>
      <x>0</x>
      <y>0</y>
      <scale>1</scale>
      <primary>yes</primary>
      <monitor>
        <monitorspec>
          <connector>eDP-1</connector>
          <vendor>AUO</vendor>
          <product>0x1536</product>
          <serial>0x00000000</serial>
        </monitorspec>
        <mode>
          <width>1920</width>
          <height>1080</height>
          <rate>59.963344573974609</rate>
        </mode>
      </monitor>
    </logicalmonitor>
    <logicalmonitor>
      <x>1920</x>
      <y>0</y>
      <scale>1</scale>
      <monitor>
        <monitorspec>
          <connector>HDMI-2</connector>
          <vendor>BNQ</vendor>
          <product>BenQ PJ</product>
          <serial>0x00000b92</serial>
        </monitorspec>
        <mode>
          <width>1920</width>
          <height>1080</height>
          <rate>60.000495910644531</rate>
        </mode>
      </monitor>
    </logicalmonitor>
  </configuration>
  <configuration>
    <logicalmonitor>
      <x>0</x>
      <y>0</y>
      <scale>2</scale>
      <monitor>
        <monitorspec>
          <connector>eDP-1</connector>
          <vendor>AUO</vendor>
          <product>0x1536</product>
          <serial>0x00000000</serial>
        </monitorspec>
        <mode>
          <width>2560</width>
          <height>1440</height>
          <rate>60.048812866210938</rate>
        </mode>
      </monitor>
    </logicalmonitor>
    <logicalmonitor>
      <x>1280</x>
      <y>0</y>
      <scale>1</scale>
      <primary>yes</primary>
      <monitor>
        <monitorspec>
          <connector>HDMI-2</connector>
          <vendor>SAM</vendor>
          <product>S24E650</product>
          <serial>H4ZH101485</serial>
        </monitorspec>
        <mode>
          <width>1920</width>
          <height>1200</height>
          <rate>59.950672149658203</rate>
        </mode>
      </monitor>
    </logicalmonitor>
  </configuration>
</monitors>

Please, check the permissions again with sudo.
And perhaps you should edit the file leaving only one <configuration> section.

It seems there’s a bug, I’m not sure if it is still relevant, but there’s a workaround as well.
My testing abilities are currently limited, so we need to wait for someone with dual-monitor setup.

I’ve managed to test the dual-monitor setup.
Everything is configured by default with no workarounds: Fedora 30, Gnome Shell, GDM, Wayland, Intel video.

Summary
$ hostnamectl 
   Static hostname: vglaptop
         Icon name: computer-laptop
           Chassis: laptop
        Deployment: production
          Location: aetera
        Machine ID: f6498891daa4453d9b7665681e21747c
           Boot ID: 929f42627b474684a0f93784b4d3dff3
  Operating System: Fedora 30 (Workstation Edition)
       CPE OS Name: cpe:/o:fedoraproject:fedora:30
            Kernel: Linux 5.1.17-300.fc30.x86_64
      Architecture: x86-64

$ lspci -k -n -n | grep -A 3 -e VGA
00:02.0 VGA compatible controller [0300]: Intel Corporation HD Graphics 630 [8086:591b] (rev 04)
	Subsystem: Lenovo Device [17aa:38e1]
	Kernel driver in use: i915
	Kernel modules: i915
--
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP106M [GeForce GTX 1060 Mobile] [10de:1c20] (rev a1)
	Subsystem: Lenovo Device [17aa:38e1]
	Kernel driver in use: nouveau
	Kernel modules: nouveau

$ echo $XDG_SESSION_TYPE 
wayland

$ grep -e Session= /var/lib/AccountsService/users/*
/var/lib/AccountsService/users/gdm:XSession=
/var/lib/AccountsService/users/vgaetera:XSession=

The method described above works for me with no issues.


I recommend you to delete and regenerate your current configuration:

gio trash ~/.config/monitors.xml
gnome-control-center display

Ensure that GDM session is closed:

sudo loginctl terminate-user gdm

And then try again.

1 Like

Thank you for the tips. I deleted the current configuration, closed the session. But still no luck :-(.

➜  ~ grep -r -e Session /var/lib/AccountsService/users

/var/lib/AccountsService/users/gnome-initial-setup:XSession=
/var/lib/AccountsService/users/silas:Session=
/var/lib/AccountsService/users/silas:XSession=gnome
/var/lib/AccountsService/users/gdm:XSession=
➜  ~ sudo ls -Z -l ~gdm/.config/monitors.xml
[sudo] password for silas: 
-rw-r--r--. 1 gdm gdm unconfined_u:object_r:xdm_var_lib_t:s0 1012 Jul 17 22:38 /var/lib/gdm/.config/monitors.xml
➜  ~ sudo cat ~gdm/.config/monitors.xml
<monitors version="2">
  <configuration>
    <logicalmonitor>
      <x>0</x>
      <y>0</y>
      <scale>2</scale>
      <monitor>
        <monitorspec>
          <connector>eDP-1</connector>
          <vendor>AUO</vendor>
          <product>0x1536</product>
          <serial>0x00000000</serial>
        </monitorspec>
        <mode>
          <width>2560</width>
          <height>1440</height>
          <rate>60.048812866210938</rate>
        </mode>
      </monitor>
    </logicalmonitor>
    <logicalmonitor>
      <x>1280</x>
      <y>0</y>
      <scale>1</scale>
      <primary>yes</primary>
      <monitor>
        <monitorspec>
          <connector>HDMI-2</connector>
          <vendor>SAM</vendor>
          <product>S24E650</product>
          <serial>H4ZH101485</serial>
        </monitorspec>
        <mode>
          <width>1920</width>
          <height>1200</height>
          <rate>59.950672149658203</rate>
        </mode>
      </monitor>
    </logicalmonitor>
  </configuration>
</monitors>

➜  ~ hostnamectl                       
   Static hostname: alpha
         Icon name: computer-laptop
           Chassis: laptop
        Machine ID: 12b897d5a8cf4e95a5c41ae3157031c6
           Boot ID: 3ff2d185213a43fab71de2799b74058c
  Operating System: Fedora 30 (Workstation Edition)
       CPE OS Name: cpe:/o:fedoraproject:fedora:30
            Kernel: Linux 5.1.17-300.fc30.x86_64
      Architecture: x86-64
➜  ~ lspci -k -n -n | grep -A 3 -e VGA
00:02.0 VGA compatible controller [0300]: Intel Corporation HD Graphics 620 [8086:5916] (rev 02)
	Subsystem: Lenovo Device [17aa:224b]
	Kernel driver in use: i915
	Kernel modules: i915
➜  ~ echo $XDG_SESSION_TYPE 
wayland
➜  ~ grep -e Session= /var/lib/AccountsService/users/*
/var/lib/AccountsService/users/gdm:XSession=
/var/lib/AccountsService/users/gnome-initial-setup:XSession=
/var/lib/AccountsService/users/silas:Session=
/var/lib/AccountsService/users/silas:XSession=gnome

First of all, I’ve been using a solution @vgaetera provided for quite a few Fedora versions on my desktop (not laptop) computer at work. I vouch for it, it works.

Secondly, I did some testing just now. In my case I edit ~gdm/.config/monitors.xml either by moving line <primary>yes</primary> to one monitor, then another, or by setting primary to yes for one monitor, and to no for another. I save the file, then just press [Ctrl-Alt-F1] to switch to gdm login screen – and I see the change right away. I don’t need to reboot, close session, etc. Then I switch back to my current workspace (for me it’s at [Ctrl-Alt-F2]), change the file again, switch to gdm to see the change applied.

Also – just to be safe – please check

cat /etc/gdm/custom.conf | grep Wayland

Is the line WaylandEnable=false commented (as it is by default) or not?

1 Like

loginctl indicates that GDM session is terminated automatically in several seconds if you switch back to your own one, so there’s usually no need to terminate it manually to apply the settings.

Can you please provide a command to see this? I don’t know how and am interested.

Here it is, though I’m not sure where the GDM session timeout is specified:

$ loginctl; sleep 10; loginctl
SESSION  UID USER     SEAT  TTY  
      2 1000 vgaetera seat0 tty2 
     25    0 root           pts/1
     c6   42 gdm      seat0 tty1 

3 sessions listed.
SESSION  UID USER     SEAT  TTY  
      2 1000 vgaetera seat0 tty2 
     25    0 root           pts/1

2 sessions listed.

Ok, thanks. Another indication (indirect as well) is the reply to the terminate-user command you’ve posted earlier, or to the

$ sudo loginctl user-status gdm
Failed to get user: User ID 42 is not logged in or lingering
1 Like

I just tried again and it still doesn’t work. I don’t understand it as the after the login the menu bar is correctly displayed on the external monitor. I played a bit around with the primary setting in the ~gdm/.config/monitors.xml file but the behavior is always the same. the login screen is displayed on the notebook display. Might there be a setting overruling the monitors.xml file? such as some x configuration file or so?

The waylandenable line is commented out:

➜  .config cat /etc/gdm/custom.conf | grep Wayland
#WaylandEnable=false

By default there isn’t, as it works for me and @vgaetera at least. Also I found it as a proper solution several Fedora versions ago, and it worked for me ever since.

So basically it looks like gdm ignores monitors.xml file in your case. You can try to verifiy it by playing, for example, with scale settings in the file (changing scale works for me).

Is it a fresh F30 install or have you upgraded?

Do you, by any chance, use proprietary NVidia driver?

One other thought. You can try the following.

  1. Uncomment #WaylandEnable=false in /etc/gdm/custom.conf – to force GDM to start in xorg, not wayland.

  2. Login into “Gnome on Xorg” session.

  3. Delete and recreate your monitors.xml, then copy it to ~gdm – as you did earlier.

  4. I think (not sure) that under xorg you’ll have to reboot or at least logout to apply the new monitor.xml.

Basically, monitors.xml under for xorg and gdm is different (primarily “connector” fields would be different for the same monitors). If you generate your monitors.xml in a wayland session, it won’t apply to Xorg session and vice versa. Also there can be cases when gdm runs under Xorg though it’s configured to run under wayland.

So maybe (a) your gdm session runs under Xorg, and/or (b) monitors.xml will be applied correctly when you force gdm to run under Xorg. You’ll have additional info and will decide how to proceed from there.

There’s useful general info in Arch wiki

I tried but couldn’t find the info on how to log/debug monitors.xml parsing/usage.

Thank you I really appreciate your help on this issue. I dont understand why it doesnt work for me. I think your assumption regarding gdm ignoring my monitors.xml file is correct. When I change the file directly nothing happens after I logout and login again. Changing settings i.e. in the gnome-control-center display will change the content of the monitors.xml file. also within the desktop environment everything is correct. Its just that the login screen doesnt respect the settings. The F30 is not fresh. I installed F28 and upgraded since then. I dont think i have a properietary NVidia driver but I might be wrong. How can I check that?

Also I disabled Wayland used Xorg deleted and recreated the monitors.xml copied it to ~gdm but that didnt work as well.

So at least it seems to be consistently ignored under both Xorg and Wayland.

Then question regarding NVidia is null, moreover, if you had proprietary drivers you would’ve installed them manually ==> you would know you use them.

I have no more ideas. All the questions/bugs I could find regarding monitors.xml being ignored were either about Xorg <–> Wayland confusion or about some settings in the file which gdm wouldn’t support (such as screen rotation, for example).

That’s totally as expected. Your own graphical settings (“within the desktop environment”) are stored in a configuration specific to your user account. Login screen runs under it’s own user (named gdm), so it has it’s own graphical settings stored under gdm’s account.

Yep, but these changes are again specific to your user account and doesn’t apply to other users including gdm user.

This is why you’ve had to manually copy monitors.xml to gdm’s home directory – so that settings you’ve configured for yourself could be applied for gdm (on the login screen).

They’re been ignored… the question is why – and sadly I don’t know what else to try to pinpoint this “why”.

One more question. I have no notebook to check, I have a desktop with two monitors.

On the login screen – is the second monitor actually on and displaying sonmething? It should have a grey background and you should be able to move your mouse pointer to it, and see your mouse pointer moving.

Yes, the second monitor is on and has this grey texture as background.

Ok ) then I have no idea how to debug this. Maybe someone more knowledgeable will chime in.

You can try to create a bugreport, maybe even you should. Problem is, even if it’s bug (and not some configs remained from F28, let’s say), it isn’t easily reproducible by other people (it works as intended for me and others), and as such would be hard for developers to act upon. But maybe they’ll tell you what information you need to provide and how to get it to make the bugreport more useful.