This post explains how to set the display resolution to 1920x1080 (or any desired resolution) on Ubuntu.
In short, you can set the resolution to 1920x1080 with the following commands:
$ xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync $ xrandr --addmode Virtual1 1920x1080_60.00 $ xrandr --output Virtual1 --mode 1920x1080_60.00
Let's go through each of these commands.
Introduction
Recently, I installed Ubuntu for the first time.
However, the window size was too small, making it inconvenient. Adjusting the resolution to match the display seemed easy, but it took some effort.
Here's a record of the steps I followed.
# Environment in this post Ubuntu 18.04.1 LTS running in a virtual environment built on Windows 10 using VMware.
Note: This article was translated from my original post.
How to Change Ubuntu Display Resolution
Setting an Existing Resolution
You can change the existing display resolution without using commands.
Search for "Displays" from "Activities" in the top left
↓
Select your preferred resolution from "Resolution"
However, I ran into a small issue here. With the default resolution after installation, the "Apply" button in the top right corner of the window was partially off-screen. If you move the Displays window into view, you can click the "Apply" button.
Unfortunately, 1920x1080 wasn't among the existing resolutions. So I temporarily set it to 1680x1050 and looked for a way to add 1920x1080.
After some research, I found that you can add a new resolution with these steps:
- Get the parameters for the desired resolution
- Add the new resolution using the parameters you obtained
Getting the Parameters for a New Resolution | cvt
You can use the cvt
command to get the parameters for setting a display resolution.
Let's check the manual for cvt
.
$ man cvt ~ NAME cvt - calculate VESA CVT mode lines SYNOPSIS cvt [-v|--verbose] [-r|--reduced] h-resolution v-resolution [refresh] DESCRIPTION Cvt is a utility for calculating VESA Coordinated Video Timing modes. Given the desired horizontal and vertical resolutions, a modeline adhering to the CVT standard is printed. This modeline can be included in Xorg xorg.conf(5) ~
By providing your desired resolution, it outputs something called "VESA Coordinated Video Timing modes".
What is "VESA Coordinated Video Timing modes"?
According to Wikipedia:
VESA (/ˈviːsə/), formally known as Video Electronics Standards Association, is a technical standards organization for computer display standards.
And about "Coordinated Video Timing (CVT)" Wikipedia says:
Coordinated Video Timings (CVT) is a standard by VESA which defines the timings of the component video signal.
Now let's run cvt
with 1920x1080.
$ cvt 1920 1080 # 1920x1080 59.96 Hz (CVT 2.07M9) hsync: 67.16 kHz; pclk: 173.00 MHz Modeline "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
This gives us the necessary parameters for the next step.
Adding the Resolution Using the Parameters | xrandr
Use the xrandr
command to add the resolution.
Check the manual.
$ man xrandr ~ DESCRIPTION Xrandr is used to set the size, orientation and/or reflection of the outputs for a screen. It can also set the screen size. ~
It really does seem like a command to set the screen output.
Let's run xrandr
.
$ xrandr Screen 0: minimum 1 x 1, current 1680 x 1050, maximum 8192 x 8192 Virtual1 connected primary 1680x1050+0+0 (normal left inverted right x axis y axis) 0mm x 0mm 800x600 60.00 + 60.32 2560x1600 59.99 1920x1440 60.00 1856x1392 60.00 1792x1344 60.00 1920x1200 59.88 1600x1200 60.00 1680x1050 59.95* 1400x1050 59.98 1280x1024 60.02 1440x900 59.89 1280x960 60.00 1360x768 60.02 1280x800 59.81 1152x864 75.00 1280x768 59.87 1024x768 60.00 640x480 59.94 Virtual2 disconnected (normal left inverted right x axis y axis) Virtual3 disconnected (normal left inverted right x axis y axis) Virtual4 disconnected (normal left inverted right x axis y axis) Virtual5 disconnected (normal left inverted right x axis y axis) Virtual6 disconnected (normal left inverted right x axis y axis) Virtual7 disconnected (normal left inverted right x axis y axis) Virtual8 disconnected (normal left inverted right x axis y axis)
Currently, a display called "Virtual1" is connected. As you can see, 1920x1080 is not listed.
To add 1920x1080 to "Virtual1":
$ xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
Paste the output from cvt 1920 1080
after --newmode
.
After running this, check with xrandr
again to confirm it's added.
$ xrandr ~ Virtual6 disconnected (normal left inverted right x axis y axis) Virtual7 disconnected (normal left inverted right x axis y axis) Virtual8 disconnected (normal left inverted right x axis y axis) 1920x1080_60.00 (0x288) 173.000MHz -HSync +VSync h: width 1920 start 2048 end 2248 total 2576 skew 0 clock 67.16KHz v: height 1080 start 1083 end 1088 total 1120 clock 59.96Hz
Then, add the mode to "Virtual1":
$ xrandr --addmode Virtual1 1920x1080_60.00
The screen may temporarily switch to a smaller default resolution, but don't worry.
Check with xrandr
to confirm it's added.
$ xrandr Screen 0: minimum 1 x 1, current 800 x 600, maximum 8192 x 8192 Virtual1 connected primary 800x600+0+0 (normal left inverted right x axis y axis) 0mm x 0mm 800x600 60.00*+ 60.32 2560x1600 59.99 1920x1440 60.00 1856x1392 60.00 1792x1344 60.00 1920x1200 59.88 1600x1200 60.00 1680x1050 59.95 1400x1050 59.98 1280x1024 60.02 1440x900 59.89 1280x960 60.00 1360x768 60.02 1280x800 59.81 1152x864 75.00 1280x768 59.87 1024x768 60.00 640x480 59.94 1920x1080_60.00 59.96 Virtual2 disconnected (normal left inverted right x axis y axis) Virtual3 disconnected (normal left inverted right x axis y axis) ~
Finally, select 1920x1080 from "Displays" as we did at the start:
Search for "Displays" from "Activities"
↓
Select 1920x1080 from "Resolution"
Or you can set it via command as well:
$ xrandr --output Virtual1 --mode 1920x1080_60.00
Now you can use Ubuntu with 1920x1080.
Conclusion
This was a record of how to set the new resolution on Ubuntu.
I hope this helps someone!