Using an ultra-wide monitor in Ubuntu Desktop

,

So I decided to install Ubuntu Desktop on an older laptop I have. Well… It’s all fun and games until you want to use your ultra-wide monitor as a second monitor and expect Ubuntu to detect the proper resolutions for it (like Windows does). Yeah, that didn’t happen.

My setup

First, let me describe my setup a little better. Maybe future versions of Ubuntu will have better support for this. I have Ubuntu Desktop 24.04 installed on an Asus laptop from about 2014-2015 (estimated based on the CPU’s year of release). The monitor is a 34″ ultra-wide with a 21:9 aspect ratio that supports up to 3440 x 1440 @ 185Hz connected with HDMI. The laptop has an nVidia graphics card.

Default behavior

I would have expected the behavior to be the same as on Windows, plug-n-play with proper 21:9 resolutions auto-detected. I wasn’t sure I could get 3440 x 1440 because it was connected with HDMI, not Display Port, but I would have expected to see at least 2560 x 1080.

But actually initially I got a stretched out image on the second monitor (I think the resolution was 1720 x 1440). There was not resolution at all in the Display Settings with a 21:9 aspect ratio.

I also tried to connect on a mini-DisplayPort that the laptop also has, and it actually detected 3440 x 1440, but that was the only 21:9 aspect ratio resolution, nothing below it. So I can safely say I have no idea based on what the proper list of resolutions is detected, but for my setup it was clearly not working properly.

What doesn’t really work

If you look it up online, you will find a particular sequence of commands. While this does solve the problem, it is only temporary, on system restart all of it is lost and you have to do it all over again. However, the reason why I’m mentioning this solution is because it’s a good test.

$ cvt 3440 1440 30
# 3440x1440 29.95 Hz (CVT) hsync: 43.96 kHz; pclk: 196.25 MHz
Modeline "3440x1440_30.00"  196.25  3440 3600 3952 4464  1440 1443 1453 1468 -hsync +vsync
$ xrandr --newmode "3440x1440_30.00"  196.25  3440 3600 3952 4464  1440 1443 1453 1468 -hsync +vsync
$ xrandr --addmode HDMI-2 3440x1440_30.00
$ xrandr --output HDMI-2 --mode 3440x1440_30.00

I even added the commands to ~/.profile, and while the resolutions i added in ~/.profile were added to the list of resolutions, the --output command seemed to have no effect, I would have needed to select the resolution every time I started the laptop.

What actually works

What ended up working for me was to create a config file /etc/X11/xorg.conf.d/10-monitor.conf. The folder already existed, but it was empty, I had to create the file. The content of the is as follows for me in order to have 3440 x 1440 @ 30 used and 2560 x 1080 @ 60 available.

Section "Monitor"
    Identifier "eDP-1"
    Option "Primary" "true"
EndSection

Section "Monitor"
    Identifier "HDMI-2"
    Modeline "3440x1440_30.00"  196.25  3440 3600 3952 4464  1440 1443 1453 1468 -hsync +vsync
    Modeline "2560x1080_60.00"  230.00  2560 2720 2992 3424  1080 1083 1093 1120 -hsync +vsync
    Option "PreferredMode" "3440x1440_30.00"
EndSection

Section "Screen"
    Identifier "Screen0"
    Device "Device0"
    Monitor "HDMI-2"
    DefaultDepth 24
    SubSection "Display"
        Depth 24
        Modes "3440x1440_30.00"
    EndSubSection
EndSection

Section "Device"
    Identifier "Device0"
    Driver "modesetting"
EndSection

Let’s walk through it. The first section, referring to eDP-1 I had to add in order to make the laptop screen primary during the Ubuntu login screen, otherwise the secondary monitor was primary. So eDP-1 should match the identifier of the primary monitor as reported by the xrandr command.

The second section refers to HDMI-2, that one being the second monitor. HDMI-2 should match the identifier of the secondary monitory as reported by the xrandr command. The Modeline lines, representing the resolutions, should match the output of the cvt command. For example:

$ cvt 3440 1440 30
# 3440x1440 29.95 Hz (CVT) hsync: 43.96 kHz; pclk: 196.25 MHz
Modeline "3440x1440_30.00"  196.25  3440 3600 3952 4464  1440 1443 1453 1468 -hsync +vsync

The only other relevant part is the modesetting driver, which changes the nVidia driver to a generic one.

Hope this helps, have fun clickity-clacking.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *