How to Stop Ubuntu Forgetting Your Dual-Monitor Left and Right Arrangement After Rebooting

Dragging your external monitor to the right side of your laptop inside Ubuntu Display settings so your mouse crosses seamlessly — only to power back on the next morning and discover Ubuntu reset the monitors back to backwards left-right order or stacked on top of each other — wears thin immediately. Usually, either the settings were not saved cleanly into your monitors.xml file, Ubuntu’s login screen uses a different monitor profile before desktop loads, or a USB-C/DisplayPort dock reports a fresh monitor ID each wake-up.

1. Save and Lock the Arrangement Correctly Inside Display Settings

First verify Ubuntu actually wrote your manual screen drag to its configuration file cleanly (and check setting your primary monitor in Ubuntu Display Settings if your top bar and dock keep jumping screens too):

  1. Click the top-right system menu > Settings > Displays.
  2. Drag screen 1 and screen 2 into their true physical left/right or up/down desk layout, then click the green Apply button at the top right and click Keep Changes within 20 seconds.
  3. Open Terminal (Ctrl + Alt + T) and check that Ubuntu saved the file right away:
    ls -l ~/.config/monitors.xml

If ~/.config/monitors.xml is missing or shows an old timestamp, verify your user owns ~/.config/ rather than root (fix if needed via sudo chown -R $USER:$USER ~/.config) and click Apply in Displays once more.

2. Copy Your Layout to the GDM Login Screen So It Matches Immediately

Notice why your mouse jumps backwards on the password prompt before switching cleanly (or sometimes fails to switch smoothly at login): Ubuntu’s GDM login greeter ignores your user account’s monitors.xml and uses its own system default until copied across:

  1. Open Terminal and copy your working desktop arrangement cleanly to GDM:
    sudo cp ~/.config/monitors.xml /var/lib/gdm3/.config/monitors.xml
  2. Ensure the login service can read it:
    sudo chown gdm:gdm /var/lib/gdm3/.config/monitors.xml

From your very next reboot, both the password login screen and your desktop match your exact desk layout immediately — and if an un-docked window ever gets trapped off-screen afterwards, review our quick shortcut guide to bringing lost off-screen windows back in Ubuntu.

3. Check USB-C Hub Wake Delays on Laptops

If Ubuntu still forgets order strictly when waking from sleep on a multi-monitor Thunderbolt or USB-C dock, unplugging and replugging the dock forces monitor ports to enumerate in a slightly different order. Turning off deep DisplayPort power saving inside the external monitor’s own on-screen menu keeps monitor IDs identical on wake so monitors.xml matches reliably every time.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.