88

I installed Ubuntu and the resolution of the desktop is so big that it only shows about 50% of the screen, but is shows up normal while using command line.

What should I type in the command line to change the desktop screen resolution?

3
  • Follow the procedures mentioned in this answer and tell us if that method solve your problem.
    – Lucio
    Apr 14, 2013 at 21:09
  • What do you mean by "while using command line"? That is, when and how to you get to the command line?
    – Tanel Mae
    Apr 14, 2013 at 21:29
  • 1
    wiki.ubuntu.com/X/Config/Resolution
    – Raja G
    Apr 15, 2013 at 14:06

4 Answers 4

84

This worked for me:

Enumerate the names of all your video outputs, and the possible resolutions for those currently connected to a monitor:

xrandr -q

Choose the name of the output you wish to change the resolution of, and:

xrandr --output <OUTPUT> --mode 1024x768

Note: If running from a text terminal, that is not running in gfx environment, you'll have to add a -d :0 parameter, i.e:

xrandr -d :0 -q
xrandr -d :0 --output <OUTPUT> --mode 1024x768
3
  • 6
    There was an warning saying VGA1 or LVDS not found Oct 4, 2015 at 14:55
  • lookup the screen after first comment, choose the profile appear in the screen Jul 12, 2016 at 18:48
  • 10
    xrandr --output `xrandr | grep " connected"|cut -f1 -d" "` --mode 1920x1080 if you want a one-liner that auto-detects output.
    – exebook
    Nov 3, 2016 at 20:18
36

Change screen resolution:

Create a new resolution using cvt

$> cvt 1600 900 75
1600x900 74.89 Hz (CVT 1.44M9) hsync: 70.55 kHz; pclk: 151.25 MHz
Modeline "1600x900_75.00"  151.25  1600 1704 1872 2144  900 903 908     942 -hsync +vsync

Add a new mode to the existing list (newmode is the name and remaining portion is)

$ sudo xrandr --newmode "1600x900_75.00"  151.25  1600 1704 1872 2144  900 903 908 942 -hsync +vsync

Find the current display

$ xrandr | grep -e " connected [^(]" | sed -e "s/\([A-Z0-9]\+\) connected.*/\1/"
Virtual1

Add new display mode where <Virtual1> is the output from the previous command

$ sudo xrandr --addmode <Virtual1> 1600x900_75.00

This will add the new resolution to your existing list of supported resolutions. You can then choose the right option from the "display settings" or the following command

$ xrandr --output Virtual1 --mode "1600x900_75.00"

To make this change permanent,

$ cat> ~/.xprofile
sudo xrandr --newmode "1600x900_75.00"  151.25  1600 1704 1872 2144      900 903 908 942 -hsync +vsync
sudo xrandr --addmode Virtual1 1600x900_75.00
xrandr --output Virtual1 --mode "1600x900_75.00"
5
  • Thanks a lot. I thought the cable didn't support it! Aug 30, 2018 at 18:42
  • 2
    The command to change the resolution works, however the permanent part doesn work for me. The .xprofile has the command but the resolution is not set automatically after the reboot.
    – thanos.a
    Jun 9, 2020 at 22:16
  • 2
    this seems to break my linux installation in Ubuntu 20.04.
    – Irsu85
    Nov 3, 2021 at 11:26
  • The answers here don't seem to help my situation. The above does not change the size of my cursor or how fuzzy my screen is. Is there a hardware check that someone can suggest? Nov 26, 2021 at 7:51
  • upvoted for the command for finding the current display. The top answer just says to do xrandr -q, the output of which can be difficult to parse visually when your screen's resolution is stuck at the wrong size.
    – Syncrossus
    Jun 23 at 13:18
17

I know it is an old question but, for me, the simple stuff was to do:

$ xrandr -q

SZ: Pixels Physical Refresh
0 1024 x 768 ( 271mm x 201mm ) 75 70 60
1 800 x 600 ( 271mm x 201mm ) 85 75 72 60 56
2 640 x 480 ( 271mm x 201mm ) 85 75 72 60
*3 832 x 624 ( 271mm x 201mm ) *74
4 720 x 400 ( 271mm x 201mm ) 85
5 640 x 400 ( 271mm x 201mm ) 85
6 640 x 350 ( 271mm x 201mm ) 85

Or something equivalent. The * marks the screen resolution currently used. To change it to one of the supported resolutions from the list above simply run the command:

xrandr -s 800x600

and the resolution is changed.

Tested on Ubuntu 14.04

Update

Sometimes when there are a lot of refresh rates (the numbers to the right in the above sample results from xrandr -q), you need to specify the refresh rate. In that case, you should run the command:

xrandr -s 800x600 -r 85

Finally

If you have multiple outputs on your board, or the device is not reacting, then you can extend the above line with output. The value for the output is still found with xrandr -q, in my case HDMI-0. The command therefore becomes:

xrandr -s 800x600 -r 85 --output HDMI-0
1
  • 2
    worked fine with me in suse
    – ofarouk
    Nov 7, 2016 at 13:05
5
  1. Run xrandr -q | grep "connected primary"

    This command shows all connected devices--feel free to not grep to see the list. HDMI-0 connected primary 1920x1080+0+0 means that my primary display is called "HDMI-0". Use that in the following command:

  2. xrandr --output HDMI-0 --auto

    If you have a specific desired resolution, use, for example:

    xrandr --output HDMI-0 --mode 1920x1080

    For more information, see the wiki

1
  • This worked great for me! Now I can click on scripts to change resolutions before I play games like a pro :)
    – dance2die
    Jan 12, 2021 at 0:55

You must log in to answer this question.

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