We had a complaint recently from a customer that received a server we shipped out that their monitor just showed a black screen. It turns out that they’d hooked it up to an ancient POS with 800x600 as its best resolution, and gdm in CentOS 7 apparently assumes at least 1024x768. It was apparently a major hassle for them to hunt down a reasonable monitor for us.
Since we almost never use the GUI on these things, we thought we’d solve that problem going forward by shipping these boxes out to use a fixed 800x600, so they’ll work on any monitor the user plugs in.
The first problem you run into is that the Settings > Devices > Display GUI only affects the login you do it under. GDM doesn’t pay attention to this, not even to the configuration set as root!
Then you go web searching and find solutions involving xrandr and advice to just put it in /etc/gdm/Init/Default, but that doesn’t seem to work.
I then got soooo close when I found the advice to set the monitor configuration in the GUI, then copy ~/.config/monitors.xml to /var/lib/gdm/.config. That works…until you plug in a different monitor, because that file has a hard tie to the monitor brand, model and *serial number*!
The monitors.xml file looks like this:
<monitors version="2">
<configuration>
<migrated/>
<logicalmonitor>
<x>0</x>
<y>0</y>
<primary>yes</primary>
<monitor>
<monitorspec>
<connector>VGA-1</connector>
<vendor>SAM</vendor>
<product>SyncMaster</product>
<serial>H1AK500000</serial>
</monitorspec>
<mode>
<width>800</width>
<height>600</height>
<rate>60</rate>
</mode>
</monitor>
</logicalmonitor>
</configuration>
</monitors>
I have tried:
1. Removing the <monitorspec> section entirely. gdm then gives me a black screen on “systemctl restart gdm” from a text console.
2. Filling out all fields except <connector> with values like “default”, “generic”, “any”, “*”, etc. GDM decides you couldn’t possibly mean for this configuration to apply to that monitor, since it differs, so it ignores you and does whatever it likes instead.
3. Lots and lots of web searching for documentation on the file format to see if I can find out if there is a different way of specifying “any monitor, I don’t care”.
I was about to go reading the source code, but I thought I’d ask here first.
Keep in mind that we ship these systems out without knowing what monitor they’ll plug in, and once the systems are out in the field, it’s often difficult to get remote access to them. That means we can’t just log in with SSH, probe it with xrandr, and fix it remotely; we’re probably having the customer log in via the GUI to fix the problem that prevents us from SSHing in in the first place!
It’s fine in our case to pin the configuration to “VGA-1”, because we know what connectors are on the server itself. We just don’t know what the customer will plug into it.
I assume there’s a minimum screen resolution for CentOS 7, probably 1024x768, but we’re installing these systems with a reasonable screen. We only need this low resolution post-install, and then only so the customer can pull up a terminal and maybe run the Network settings tool. For that, 800x600 is fine. You do have to drag the Settings app around a bit to see everything, but it works.
Our current fallback is Ctrl-Alt-F2 and nano, which is tolerable for some things — “Okay, type ‘ifconfig’…now find the line that has ‘inet’ in it, and read that back to me…’ — but remotely talking someone through changing ifcfg-noisenoise via nano is a minor nightmare, especially now that Confusing Network Device Naming is the default.