I'm a new Linux user trying to change the screen resolution as there is no option under display. I have successfully managed to add new resolutions by fluke by following online guide. I don't have a GPU, I don't know if this is the issue? Below is my xrandr -q output.

root@kali:~# xrandr -q
xrandr: Failed to get size of gamma for output default
Screen 0: minimum 1280 x 1024, current 1280 x 1024, maximum 1280 x 1024
default connected 1280x1024+0+0 0mm x 0mm
   1280x1024       0.0* 
  1920x1200_60.00 (0x145)  193.2MHz
        h: width  1920 start 2056 end 2256 total 2592 skew    0 clock   74.6KHz
        v: height 1200 start 1203 end 1209 total 1245           clock   59.9Hz
  1440x900_59.90 (0x156)  106.3MHz
        h: width  1440 start 1520 end 1672 total 1904 skew    0 clock   55.8KHz
        v: height  900 start  901 end  904 total  932           clock   59.9Hz
  • xrandr -q is not listed in their manual.
    – neverMind9
    Aug 21, 2018 at 9:01

7 Answers 7


Here are the steps you need to add a new custom resolution and apply it. Following steps are for adding a 1920x1080 resolution, but you can use it for any other resolution you want. But make sure your monitor and onboard graphics support that resolution.

# First we need to get the modeline string for xrandr
# Luckily, the tool "gtf" will help you calculate it.
# All you have to do is to pass the resolution & the-
# refresh-rate as the command parameters:
gtf 1920 1080 60

# In this case, the horizontal resolution is 1920px the
# vertical resolution is 1080px & refresh-rate is 60Hz.

# Typically, it outputs a line starting with "Modeline"
# e.g. "1920x1080_60.00"  172.80  1920 2040 2248 2576  1080 1081 1084 1118  -HSync +Vsync
# Copy this entire string (except for the starting "Modeline")

# Now, use "xrandr" to make the system recognize a new
# display mode. Pass the copied string as the parameter
# to the --newmode option:
xrandr --newmode "1920x1080_60.00"  172.80  1920 2040 2248 2576  1080 1081 1084 1118  -HSync +Vsync

# Well, the string within the quotes is the nick/alias
# of the display mode - you can as well pass something
# as "MyAwesomeHDResolution". But, careful! :-|

# Then all you have to do is to add the new mode to the
# display you want to apply, like this:
xrandr --addmode VGA1 "1920x1080_60.00"

# VGA1 is the display name, it might differ for you.
# Run "xrandr" without any parameters to be sure.
# The last parameter is the mode-alias/name which
# you've set in the previous command (--newmode)

# It should add the new mode to the display & apply it.
# Usually unlikely, but if it doesn't apply automatically
# then force it with this command:
xrandr --output VGA1 --mode "1920x1080_60.00"

Original source: https://gist.github.com/debloper/2793261

I also wrote a script that does all these steps automatically. You can try it out if the above steps seem too complicated for you: https://gist.github.com/chirag64/7853413

  • If you have some part of your second display shown on the first display after fallowing the answer above, you should re-arrange display layout from displays settings. Reason is in xrandr the number after plus sign is not refreshed after changing res from 960 to 1920: eg: 2560x1080+960+0 to 2560x1080+1920+0 Jan 16, 2019 at 11:53
  • In case you receive xrandr: cannot find output "VGA1", check your output devices with: xrandr --listmonitors (source: unix.stackexchange.com/a/413304/106621) Jan 16, 2020 at 11:17
  • 7
    X Error of failed request: BadMatch (invalid parameter attributes) Major opcode of failed request: 139 (RANDR) Minor opcode of failed request: 7 (RRSetScreenSize) Serial number of failed request: 22 Current serial number in output stream: 23 What the hell does that mean?
    – undefined
    Apr 23, 2020 at 22:03
  • 5
    Instead of gtf one may use cvt, e.g. cvt 1920 1080, which produces the same output as gtf, but it calculates also valid refresh rate. (Giving refresh rate to gtf by hand may not always give supported output values).
    – Cromax
    May 12, 2020 at 23:07
  • It helped me with VirtualBox 6.1, which forces me to use the VMSVGA graphics controller, but set the screen size to 800x600.
    – apaderno
    Aug 12, 2020 at 7:48

The option --size/-s can be used:

xrandr -s 1440x900

Should work with RandR version 1.1 or newer.

  • 3
    When i do this the response is : size 1440x900 not found in available modes
    – nick
    Sep 6, 2015 at 15:22
  • @nick From the output which you included in the question I deduced it should be available. What's the output of xrandr --verbose?
    – jimmij
    Sep 6, 2015 at 15:26
  • xrandr: Failed to get size of gamma for output default Screen 0: minimum 1024 x 768, current 1024 x 768, maximum 1024 x 768 default connected 1024x768+0+0 (0x138) normal (normal) 0mm x 0mm Identifier: 0x137 Timestamp: 5048 Subpixel: unknown Clones: CRTC: 0 CRTCs: 0 Transform: 1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 1.000000 filter:
    – nick
    Sep 6, 2015 at 15:35
  • 1024x768 (0x138) 0.0MHz *current h: width 1024 start 0 end 0 total 1024 skew 0 clock 0.0KHz v: height 768 start 0 end 0 total 768 clock 0.0Hz
    – nick
    Sep 6, 2015 at 15:35
  • So it seems the only available resolution is 1024x768. Is this resolution what you want to set?
    – jimmij
    Sep 6, 2015 at 15:41

I had the same problem. In Display setting maximum resolution was 1280x720. So:

  1. using xrandr command I have seen name of this monitor and resolution list.
  2. I 've executed the script: xrandr --output {name of monitor} --mode {resolution}

For example:

xrandr --output DP-2-1 --mode 2560x1440
  • That command gives error xrandr: Configure crtc 1 failed
    – Alex
    Dec 1, 2023 at 7:51

This is what I had to do on an #IntelMaker #Joule in order to make it work in the native resolution with a SUNFOUNDER 7 INCH TFT COLOR MONITOR, which is listed as having 1024*600 resolution, but was picked up as 1280x720 instead.

First, Intel Joule with Linux 4.4.15-yocto-standard x86_64 doesn't seem to have gtf(1), so, I had to use a different machine to calculate the appropriate numbers:

$ gtf 1024 600 60

  # 1024x600 @ 60.00 Hz (GTF) hsync: 37.32 kHz; pclk: 48.96 MHz
  Modeline "1024x600_60.00"  48.96  1024 1064 1168 1312  600 601 604 622  -HSync +Vsync


Then, create a file with the appropriate commands:

# cat > 1024x600.sh
xrandr --newmode "1024x600_60.00"  48.96  1024 1064 1168 1312  600 601 604 622  -HSync +Vsync
xrandr --addmode HDMI1 "1024x600_60.00"
xrandr --output HDMI1 --mode "1024x600_60.00"
# chmod +x 1024x600.sh

Then, startx or startxfce4, and run ./1024x600.sh, after which, the following will be reported by xrandr(1).

# xrandr
Screen 0: minimum 8 x 8, current 1024 x 600, maximum 32767 x 32767
DP1 disconnected (normal left inverted right x axis y axis)
HDMI1 connected 1024x600+0+0 (normal left inverted right x axis y axis) 697mm x 392mm
   1280x720      60.00 +  50.00    59.94  
   1920x1080     60.00    50.00    59.94  
   1920x1080i    60.00    50.00    59.94  
   1280x1024     75.02  
   1440x900      74.98    59.90  
   1024x768      75.08    70.07    60.00  
   1024x600      60.00  
   800x600       72.19    75.00    60.32    56.25  
   720x576       50.00  
   720x576i      50.00  
   720x480       60.00    59.94  
   720x480i      60.00    59.94  
   640x480       75.00    72.81    60.00    59.94  
   720x400       70.08  
   1024x600_60.00  60.00* 
HDMI2 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
  • Answer includes irrelevant personal user and host names, and doesn't clearly separate commands from their output - all of which can be confusing to the readers. A standard method of conveying that something is a command would be prefixing it simply with $. Kali's default WM is also GNOME, not XFCE, maybe it should be made clear that startxfce4 command is only for users running XFCE version 4. The likelihood that many other users will be running exactly Linux 4.4.15-yocto-standard x86_64 doesn't seem high to me, so I'd instead write that gtf (or cvt) might have to be installed first.
    – miyalys
    May 21, 2018 at 10:57
  • @miyalis aside for the unnecessary mention of the distro the rest of the solution is fine. The command you are talking about were to be pasted inside a script and they should not be prefixed by$. In this regard your comment is wrong , all the commends are prefixed with #, which is the equivalent prompt for the root user.
    – Bogdan
    Apr 15, 2022 at 23:27

I ran:

xrandr --verbose

which gave me a list of size tags and corresponding pixel values

then I used

xrandr -s 6

to select the 1920x1080 resolution


Save the script and launch it (bash script.sh 1024 720 60) you can set the custom resolution with that script but it is a temporary solution whenever you logout and login again you have to run the script again .you can add 2 lines of code in your bash.bashrc profile.to run the script directly from terminal.

# xrandr.sh
#If no argument is specified, ask for it and exit
if [[ -z "$@" ]];
echo "An argument is needed to run this script";
#Basic check to make sure argument number is valid. If not, display error and exit
if [[ $(($(echo $arg | grep -o "\s" | wc --chars) / 2 )) -ne 2 ]];
echo "Invalid Parameters. You need to specify parameters in the format "width height refreshRate""
echo "For example setResolution "2560 1440 60""

#Save stuff in variables and then use xrandr with those variables
modename=$(echo $arg | sed 's/\s/_/g')
display=$(xrandr | grep -Po '.+(?=\sconnected)')
if [[ "$(xrandr|grep $modename)" = "" ]];
xrandr --newmode $modename $(gtf $(echo $arg) | grep -oP '(?<="\s\s).+') &&
xrandr --addmode $display $modename
xrandr --output $display --mode $modename

#If no error occurred, display success message
if [[ $? -eq 0 ]];
echo "Display changed successfully to $arg"

My problem is the notebook resolution have this:

Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
eDP1 connected 1920x1080+0+0 ...
   1366x768      60.00*+  47.98  <=== MaxResolution (Default/Primary)
   1360x768      59.80    59.96  
   1280x720      60.00 ...

My primary/default screen is 1366x768.

But I would like to test a resolution 1920x1080 (DesireResolution) in my notebook.

I tried everything.

I couldn' t find a solution because my notebook don't accept addmode or newmode commands from xrandr to increase resolution, like this stackexchange question request.

So I did some maths!

1920/1366 = 1.4055636896
1080/768 = 1.40625

basically DesireResolution/MaxResolution

and run this command

xrandr --output eDP1 --mode 1366x768 --panning 1920x1080 --scale 1.40556369x1.40625

If you need restore original resolution

xrandr --output eDP1 --mode 1366x768 --panning 1366x768 --scale 1x1

You can adapt to any resolution you want.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .