{"id":6705,"date":"2017-04-16T17:05:59","date_gmt":"2017-04-16T17:05:59","guid":{"rendered":"http:\/\/ubuntuhandbook.org\/?p=6705"},"modified":"2025-05-22T11:00:50","modified_gmt":"2025-05-22T11:00:50","slug":"custom-screen-resolution-ubuntu-desktop","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2017\/04\/custom-screen-resolution-ubuntu-desktop\/","title":{"rendered":"How to Set A Custom Screen Resolution in Ubuntu Desktop"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-6706\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/display-icon245.jpg\" alt=\"\" width=\"245\" height=\"250\" \/><br \/>\nYour preferred screen resolution is not available in the Display settings? Well, here I&#8217;m going to show you how to add a custom screen resolution in your Ubuntu desktop.<\/p>\n<p>On my Ubuntu Desktop, the default 1920X1080 (16:9) resolution is kinda high for me. Though there are options to scale for menu, title bars, and text, I prefer 1400X900 (3:2) which however is not available to choose from display setting panel.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/display-no14900.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-48953\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/display-no14900-700x494.webp\" alt=\"\" width=\"610\" height=\"430\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/display-no14900-700x494.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/display-no14900-300x212.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/display-no14900-768x542.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/display-no14900.webp 1033w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>To do the job, I found 2 solutions that work in all current Ubuntu releases:<\/p>\n<ul>\n<li>add <b>Kernel parameter<\/b> at startup, which works in both Wayland and Xorg sessions.<\/li>\n<li>use <b>xrandr<\/b>, but it works for X11\/Xorg session only.<\/li>\n<\/ul>\n<p><b>And they are tested and work in my case in Ubuntu 18.04, 20.04, 22.04, 24.04, and 25.04.<\/b><\/p>\n<h3>Method 1: Add custom screen resolution as Kernel parameter<\/h3>\n<p><b>1. Find out display device name<\/b>.<\/p>\n<p>Before getting started, you need to find out the device name of your displays.<\/p>\n<p>For <b>X11\/Xorg<\/b> session, simply press <code>Ctrl+Alt+T<\/code> to open terminal. Then, run the command below:<\/p>\n<pre>xrandr<\/pre>\n<p>It will output all connected displays as well as available screen resolutions. Here you need to find out and remember the display names. In my case as the screenshot shows, it&#8217;s <b>DP-1<\/b>.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/xrandr-displayname.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-48954\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/xrandr-displayname-700x433.webp\" alt=\"\" width=\"610\" height=\"377\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/xrandr-displayname-700x433.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/xrandr-displayname-300x186.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/xrandr-displayname.webp 706w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>For <b>Wayland<\/b>, which is the default session since Ubuntu 22.04, open terminal and run the command below instead:<\/p>\n<pre>for p in \/sys\/class\/drm\/*\/status; do con=${p%\/status}; echo -n \"${con#*\/card?-}: \"; cat $p; done<\/pre>\n<p>This command will look for all devices under <code>\/sys\/class\/drm<\/code> directory, print the names and their status (connected or not). In my case, I have 2 displays connected. They are <b>eDP-1<\/b> laptop built-in display, and <b>DP-1<\/b> external display.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/wayland-checkdisplay.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-48955\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/wayland-checkdisplay-700x440.webp\" alt=\"\" width=\"610\" height=\"383\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/wayland-checkdisplay-700x440.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/wayland-checkdisplay-300x189.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/wayland-checkdisplay.webp 762w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p><b>2. Add Kernel Parameter<\/b>.<\/p>\n<p>For Ubuntu booted with its built-in Grub boot-loader, user can edit the <code>\/etc\/default\/grub<\/code> file to add kernel parameters.<\/p>\n<p>First, press <code>Ctrl+Alt+T<\/code> on keyboard to open terminal, and run command to edit that file:<\/p>\n<pre>sudo gnome-text-editor \/etc\/default\/grub<\/pre>\n<p><i>For non-GNOME desktop, replace <code>gnome-text-editor<\/code> with your desktop text editor, or use <code>nano<\/code> cli tool that works in most Linux<\/i><\/p>\n<p>When file opens, add <b>video=DP-1:1400&#215;900@60<\/b> value for GRUB_CMDLINE_LINUX_DEFAULT. And, here:<\/p>\n<ul>\n<li><b>DP-1<\/b> is the device name of target display.<\/li>\n<li><b>1400&#215;900<\/b> is the desired screen resolution.<\/li>\n<li><b>60<\/b> is the refresh rate.<\/li>\n<\/ul>\n<p>NOTE: You can&#8217;t set a resolution higher than the one your physical display can handle.<\/p>\n<p>And, <b>for multiple display<\/b>, add either:<\/p>\n<ul>\n<li><code>video=1400x900@60<\/code> (skip device name) that works for all connected displays,<\/li>\n<li>or <code>video=eDP-1:1360x700@60 video=DP-1:1600x900@60<\/code> to set video size separately.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/kernel-videosize.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-48956\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/kernel-videosize-700x456.webp\" alt=\"\" width=\"610\" height=\"397\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/kernel-videosize-700x456.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/kernel-videosize-300x196.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/kernel-videosize-768x501.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/kernel-videosize.webp 959w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p><b>3. Update Grub to apply change<\/b><\/p>\n<p>After edited the file, save it (for nano press Ctrl+S to save, then Ctrl+X to exit), and run the command below to apply change:<\/p>\n<pre>sudo update-grub<\/pre>\n<p>Finally, restart computer and go &#8220;Display&#8221; setting page for the new screen resolution.<\/p>\n<p><b>Tips:<\/b> For users who have <a href=\"https:\/\/ubuntuhandbook.org\/index.php\/2022\/04\/install-grub-customizer-ubuntu-2204\/\" target=\"_blank\" rel=\"noopener\">Grub Customizer<\/a> installed, then just launch the tool and navigate to <b>General Settings<\/b> page to add kernel parameters.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/grub-multivideomode.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-33692\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/grub-multivideomode-600x405.jpg\" alt=\"\" width=\"600\" height=\"405\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/grub-multivideomode-600x405.jpg 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/grub-multivideomode-300x203.jpg 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/grub-multivideomode-768x519.jpg 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/grub-multivideomode.jpg 937w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<h3>Method 2: Use xrandr command<\/h3>\n<p>For the classic X11\/Xorg session, that&#8217;s default in current MATE, XFCE, etc desktop environments, there&#8217;s a built-in <b>xrandr<\/b> command line tool to set screen size.<\/p>\n<p><b>1.<\/b> First open terminal by pressing <code>Ctrl+Alt+T<\/code> key combination on keyboard. When it opens, run command:<\/p>\n<pre style=\"border: none;\">xrandr<\/pre>\n<p>As mentioned above, this command output all connected displays as well as their screen resolutions. You need to find out and remember the target display name<\/p>\n<p><b>2.<\/b> Run command to calculate VESA CVT mode lines by given resolution:<\/p>\n<pre>cvt 1400 900 60<\/pre>\n<p>Here replace <code>1400 900<\/code> with your desired screen resolution. The refresh rate 60 is optional, though you may replace it with yours.<\/p>\n<p><b>3.<\/b> Copy the Modeline in the last command output, and run command to add new mode:<\/p>\n<pre style=\"border: none;\">sudo xrandr --newmode <span style=\"color: red;\">\"1400x900_60.00\"  103.50  1400 1480 1624 1848  900 903 913 934 -hsync +vsync<\/span><\/pre>\n<p>NOTE here you need to replace the section in red after <code>--newmode<\/code> with the output in last command.<\/p>\n<p><b>4.<\/b> Finally add the new created mode for your display device:<\/p>\n<pre style=\"border: none;\">sudo xrandr --addmode <span style=\"color: red;\">DP-1<\/span> <b>\"1600x900_60.00\"<\/b><\/pre>\n<p>Replace <b>DP-1<\/b> (see step1) and <code>\"1400x900_60.00\"<\/code> (Step 2 or 3) in the command.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/xrandr-setresolution.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-48957\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/xrandr-setresolution-700x345.webp\" alt=\"\" width=\"610\" height=\"301\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/xrandr-setresolution-700x345.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/xrandr-setresolution-300x148.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/xrandr-setresolution.webp 706w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>After that, you can open Settings and navigate to Display pane, finally choose the new &#8220;1400&#215;900&#8221; screen resolution and apply.<\/p>\n<p><b>5.<\/b> The steps above work only for current login.<\/p>\n<p><b>To make it permanent<\/b>, open HOME folder and press <code>Ctrl+H<\/code> to show hidden files. Next, find out and click edit <b>.profile<\/b> file.<\/p>\n<p>When the file opens, add the commands in step 3 &amp; 4 (skip sudo) and save.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/xrandr-profile.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-48958\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/xrandr-profile-700x457.webp\" alt=\"\" width=\"610\" height=\"398\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/xrandr-profile-700x457.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/xrandr-profile-300x196.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/xrandr-profile-768x501.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/xrandr-profile.webp 1232w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>Your preferred screen resolution is not available in the Display settings? Well, here I&#8217;m going to show you how to add a custom screen resolution in your Ubuntu desktop. On my Ubuntu Desktop, the default 1920X1080 (16:9) resolution is kinda high for me. Though there are options to scale for menu, title bars, and text, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[1435,920],"class_list":["post-6705","post","type-post","status-publish","format-standard","hentry","category-howtos","tag-custom-resolution","tag-screen-resolution"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/6705","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=6705"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/6705\/revisions"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=6705"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=6705"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=6705"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}