How can I change resolution using xrandr? [duplicate]

I have a dual monitor setup. 2nd monitor has a VGA connection. Resolution 1366x768 not found in display settings or randr. How do I add resolution 1366x768 to output. I have tried this:

VGA-0 connected primary 1024x768+0+190 (normal left inverted right x axis y axis) 0mm x 0mm
   1024x768       60.0* 
   800x600        60.3     56.2  
   848x480        60.0  
   640x480        59.9  

Did xrandr -s 1366x768:

Size 1366x768 not found in available modes

And xrandr --output vga-0 --mode 1366x768:

warning: output vga-0 not found; ignoring

Solution 1:

And xrandr --output vga-0 --mode 1366x768:
warning: output vga-0 not found; ignoring

Terminals are case sensitive(may not be for windows BUT), vga-0 is not equal to VGA-0 and hence the problem.


Did xrandr -s 1366x768:
Size 1366x768 not found in available modes

You can create a custom screen resolution when not listed and your display supports it. Check this ubuntu handbook guide : http://ubuntuhandbook.org/index.php/2017/04/custom-screen-resolution-ubuntu-desktop/

If you want to follow the part

IMPORTANT: To make Ubuntu remember the new created screen resolution at next start, you have to edit the .profile via command:

Then to avoid the sudo: no tty present and no askpass program specified error after each login, you might follow a working answer of this StackOverflow Question : https://stackoverflow.com/questions/21659637/how-to-fix-sudo-no-tty-present-and-no-askpass-program-specified-error