Use the xrandr command to manually set the correct resolution and position for your monitors, overriding any incorrect auto-detection that causes a zoomed-in appearance. By specifying the output name and desired geometry in the terminal, you can restore normal scaling and ensure each display renders at its native pixel density without distortion.
Understanding the Zoom Issue
When you connect multiple displays to a Linux system, the X server or Wayland compositor often attempts to automatically configure the layout. This process relies on Extended Display Identification Data (EDID) sent by the monitor. Sometimes, this data is incomplete, corrupted, or misinterpreted by the graphics driver. The result is a display that appears "zoomed in," meaning only a portion of the screen is visible, or the content is scaled incorrectly because the system believes the monitor has a different resolution than it actually does. This issue is particularly common when using older monitors, HDMI splitters, or docking stations that may not pass EDID information correctly. It can also happen if the primary monitor’s settings conflict with the secondary display’s capabilities. Instead of relying on graphical interface tools which might cache bad settings, using the command line provides direct control over how the X server interprets your hardware. For users who need to enable a monitor that the system completely ignores, checking out How to Use xrandr Command to Turn On Your Monitor in Linux can provide additional context on basic output detection.Identifying Your Monitor Outputs
Before applying any fixes, you must identify the exact names assigned to your physical ports by the operating system. Linux assigns logical names likeHDMI-1, DP-2, or VGA-0 rather than generic terms like "Monitor 1." These names vary depending on your graphics card manufacturer and the specific port you used to plug in the cable.
Open your terminal and run the following command:
xrandr --query
Look for the section labeled connected. Each connected output will be listed with its current resolution and refresh rate. If a monitor is physically connected but shows as disconnected, the system cannot see it, and you may need to troubleshoot cables or drivers first. Note down the name of the monitor that appears zoomed. You will need this identifier for the next steps.
Setting the Correct Resolution Manually
Once you have identified the output name, you can force the system to use the correct resolution. Most modern monitors have a native resolution, such as 1920x1080 or 2560x1440. If the system is displaying a lower resolution or an unsupported aspect ratio, the image will stretch or zoom. To fix this, use the--output flag followed by the monitor name and the --mode flag with the desired resolution. Replace OUTPUT_NAME with the identifier you found earlier and adjust the resolution values to match your monitor's specifications.
xrandr --output OUTPUT_NAME --mode 1920x1080
If the desired resolution is not listed in the query output, you may need to add it manually using the --addmode command. This requires generating a modeline, which can be complex. However, in many cases, simply selecting a standard resolution from the existing list resolves the zooming issue by forcing the scaler to align with the panel's grid.
Adjusting Position and Scaling
Sometimes the resolution is correct, but the positioning is wrong, causing parts of the desktop to be cut off or shifted unexpectedly. You can explicitly define where the monitor sits relative to others using the--pos parameter. This takes coordinates in pixels, where 0x0 represents the top-left corner of the primary screen.
For example, if you have two monitors side-by-side and want the second one to the right of the first, you might use:
xrandr --output HDMI-1 --primary --mode 1920x1080 \
--output DP-1 --mode 1920x1080 --pos 1920x0
This command sets HDMI-1 as the primary display and places DP-1 immediately to its right. If your display still looks zoomed, check if your desktop environment has a global scaling setting enabled. Some compositors apply a scale factor (e.g., 1.25x or 2x) for HiDPI screens, which can interfere with manual xrandr settings. Disabling fractional scaling in your system settings often helps xrandr take full control. For more advanced visual adjustments, including color calibration that might complement your layout changes, refer to Adjusting Monitor Colors with 3D Aglyph, Xrandr, and Gamma.
Making Changes Persistent
Thexrandr commands applied in the terminal are temporary. They will revert to default settings after a reboot or logout. To make your configuration permanent, you need to save the command sequence.
One reliable method is to add the command to your startup applications. In most desktop environments, you can find a "Startup Applications" tool in the settings menu. Add a new entry with the full xrandr command you tested. Alternatively, you can create a script in your home directory and call it from your window manager’s configuration file, such as .xprofile or .bashrc, depending on your setup.
If you encounter issues where the second monitor remains black despite correct settings, review troubleshooting guides for specific hardware conflicts, such as those discussed in Ubuntu 22.04: Second Monitor Stays Black after NVIDIA Graphics Card Plug-in.
Frequently Asked Questions
Why does my monitor show a lower resolution than its native spec?
This usually happens because the graphics driver fails to read the monitor's EDID data correctly, defaulting to a safe, low-resolution mode. Using xrandr to manually set the mode bypasses this automatic detection error. Ensure your cable supports the bandwidth required for higher resolutions.
Can I use xrandr to rotate a monitor?
Yes, you can use the --rotate flag with values like normal, left, right, or inverted. This is useful for vertical displays or tablets. Combine this with position flags to ensure the rotated screen aligns correctly with your other monitors.
What if xrandr says the mode is not found?
If the desired resolution is not listed, the driver may not support it or the connection is unstable. Try using a different cable type, such as switching from VGA to HDMI or DisplayPort, as analog connections often struggle with high resolutions. You can also try lowering the refresh rate to see if the connection stabilizes.
Does this work on Wayland compositors?
Support varies significantly between Wayland implementations. While GNOME and KDE Plasma have their own scaling mechanisms, they may ignore xrandr commands unless running in XWayland compatibility mode. Check your session type; if you are on Wayland, consider adjusting scaling in the system settings instead.
How do I reset all display settings to default?
You can restart the display manager service, which reloads the default configuration files. On Ubuntu-based systems, you can often do this by pressing Ctrl+Alt+Backspace or restarting the gdm or sddm service. This clears any temporary xrandr overrides applied during the session.