The Shifting Desktop
In Ubuntu, the GNOME desktop environment handles display configurations. If you frequently connect your laptop to various external monitors, projectors, or TVs in different conference rooms, Ubuntu attempts to be helpful by automatically remembering the resolution you used last time and snapping to it. However, if a driver update occurs or the EDID data from a cheap monitor is misread, Ubuntu might automatically force your display into a blurry, unusable 800×600 resolution the moment you plug the cable in, overriding the crisp 4K setting you actually intended to use.
Locking the Configuration
To force consistent display settings and stop Ubuntu from automatically changing your display resolution based on faulty EDID detection, you must lock the GNOME monitor configuration file.
First, use the standard graphical Settings > Displays menu to configure your monitors exactly how you want them (correct resolution, correct refresh rate, correct physical arrangement). Once your screens look perfect, open your terminal (Ctrl+Alt+T). GNOME saves this layout in an XML file. You need to change the file permissions so the system can read it but can never modify or overwrite it again. Type chmod 444 ~/.config/monitors.xml and press Enter. The 444 permission makes the file strictly read-only for all users, including the system itself. From now on, when you plug in that specific monitor, Ubuntu will read your locked file and apply your exact preferred resolution, completely ignoring any automatic detection algorithms.