How to change display resolution by using xrandr ?
Environment
- Red Hat Enterprise Linux 7
- Red Hat Enterprise Linux 6
- Red Hat Enterprise Linux 5
Issue
- The past method of changing display resolution was to use the
system-config-display
application. - Is there an alternative solution to modifying the display configuration in RHEL ?
Resolution
- To switch the desired display resolution, list the detected resolutions for the display by running the following command:
$ xrandr -q
- From here check the display sizes that the display driver can detect will work using the monitor. Here is an example:
$ xrandr -q
Screen 0: minimum 320 x 200, current 3840 x 1080, maximum 4096 x 4096
DVI-I-1 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 477mm x 268mm
1920x1080 60.0*+
1600x1200 60.0
1680x1050 60.0
1280x1024 75.0 60.0
1440x900 59.9
1280x960 60.0
1280x800 59.8
1152x864 75.0
1024x768 75.1 70.1 60.0
832x624 74.6
800x600 72.2 75.0 60.3 56.2
640x480 72.8 75.0 66.7 60.0
720x400 70.1
DVI-I-2 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 477mm x 268mm
1920x1080 60.0*+
1600x1200 60.0
1680x1050 60.0
1280x1024 75.0 60.0
1440x900 59.9
1280x960 60.0
1280x800 59.8
1152x864 75.0
1024x768 75.1 70.1 60.0
832x624 74.6
800x600 72.2 75.0 60.3 56.2
640x480 72.8 75.0 66.7 60.0
720x400 70.1
- From the above see that there are 2 displays connected to the system with the various display sizes detected and listed. In this instance, to change the resolution the first display on run the command below:
$ xrandr --output DVI-I-1 --mode 1680x1024
- Verify the display for the X11 session reflects the targeted resolution change
Diagnostic Steps
- Make certain that the display is "connected" as the output from the query above shows.
- Additionally, the settings will be lost after the session is restarted (logout or reboot). So for persistent changes it may be more beneficial to generate a xorg.conf file that is not used by default in RHEL 6 and 7.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments