The following simple configuration works for me, and when connected, my monitor automatically uses the correct resolution without any manual intervention.
sudo nano /etc/X11/xorg.conf
Note that this file may or may not already exist. Add the following:
Section "Monitor"
Identifier "VGA1"
Modeline "1440x900_60.00" 106.50 1440 1528 1672 1904 900 903 909 934 -hsync +vsync
EndSection
Then reboot. If all goes well, then things should just work.
Background
I have a UX32VD laptop, and I wanted to have 4K over HDMI, even though there is no 3840x2160 option in the display settings.
My first task was to compute the modeline. Skip this step if you already know the modeline. (The modeline below may work for you.) I downloaded umc-0.2.tar.gz, extracted, and ran ./configure
and make
. To get the 25Hz Reverse Blanking Timing mode, I ran
umc-0.2/src/umc 3840 2160 25 --rbt
which outputs
# 3840x2160x24.99 @ 54.625kHz
Modeline "3840x2160x24.99" 218.500000 3840 3888 3920 4000 2160 2163 2167 2186 +HSync -VSync
Next I wanted to test this modeline. Running xrandr
with no arguments, I saw that my HDMI device is named HDMI-1
. I tested this mode by running commands analogous to Jacob's:
xrandr --newmode "3840x2160x24.99" 218.500000 3840 3888 3920 4000 2160 2163 2167 2186 +HSync -VSync
xrandr --addmode HDMI-1 "3840x2160x24.99"
xrandr --output HDMI-1 --mode "3840x2160x24.99" --preferred
Finally, to make the resolution permanent, I created /etc/X11/xorg.conf
with the following contents:
Section "Monitor"
Identifier "HDMI-1"
Modeline "3840x2160x24.99" 218.500000 3840 3888 3920 4000 2160 2163 2167 2186 +HSync -VSync
EndSection
To test, restart the computer.
I should note that I am running nvidia-driver-390
on Ubuntu 18.04. Hopefully my technique generalizes well to other configurations. (Please let me know in the comments.)