ubuntu change resolution

The native resolution of your screen is usually the one that works best. Selecting the incorrect resolution can result in a stretched/pixelated screen and a poor viewing experience overall. If you’re stuck in a similar situation, the steps from this article will help you change your screen resolution on Ubuntu.

Set Resolution via Display Settings

The easiest way to change the resolution is from the Display Settings window. You can right-click the desktop and select Display Settings to access it, or you can search and open Display Settings from the Activities overview.

Select the new resolution here and press Apply. Then, click on Keep Changes to set the new resolution.

Use XRandR to Change Resolution

XRandR is a CLI tool that allows you to set the size of the output for a screen. By default, it’ll list the outputs and the existing modes for each of them.


Change to Existing Resolution

You can use the following command to change the screen resolution, replacing the values inside the brackets with your own.

xrandr --output [display-name] --mode [resolution]

For instance, in the above image, the display-name is Virtual-1 and the current resolution is 1366×768. You could change the resolution to an existing mode like 1600×900 like so

xrandr --output Virtual-1 --mode 1600x900

Note: This change will revert upon restarting or logging out. Check the last section for steps on making the change persistent.

Set Custom Resolution

Let’s say you want to use a custom resolution (e.g., 1600×1000) that doesn’t currently exist. You can use cvt to calculate the parameters for such resolutions.

cvt 1600 1000

Copy the parameters after Modeline. Then, enter xrandr --newmode and paste the parameters like so

xrandr --newmode "1600x1000_60.00"  132.25  1600 1696 1864 2128  1000 1003 1009 1038 -hsync +vsync

After creating the new mode, use the mode name from above to add it to your display like so

xrandr --addmode Virtual-1 "1600x1000_60.00"

Finally, you can set the new resolution as done earlier.

xrandr --output Virtual-1 --mode 1600x1000_60.00

Changing the Resolution Permanently

As mentioned earlier, changes made with xrandr are temporary. In order to make them stick past a reboot, you can create a simple shell script in the /etc/profile.d/ directory. This script will auto-run at login.

We’ll use nano to create the script.

sudo nano /etc/profile.d/monitorres.sh

Let’s say you want to set the resolution to 1600×1000 like above. Copy the same commands and replace all the values with your own.

Additionally, you can also replace “1600x1000_60.00” with your own mode name like “customres”.

xrandr --newmode "customres"  132.25  1600 1696 1864 2128  1000 1003 1009 1038 -hsync +vsync
xrandr --addmode Virtual-1 "customres"

Now, save the changes (Ctrl + O and Ctrl + X in nano) and log out/restart your machine. The selected resolution should be available as an option when you log in.

Anup Thapa

Senior Writer

Anup Thapa is a Linux enthusiast with an extensive background in computer hardware and networking. His goal is to effectively communicate technical concepts in a simplified form understandable by new Linux users. To this end, he mainly writes beginner-friendly tutorials and troubleshooting guides. Outside of work, he enjoys reading up on a range of topics, traveling, working out, and MOBAs.