15

I just installed Lubuntu 13.10 and I have a problem - On Windows I can go up to 2048x1536, but the display setting on Lubuntu only lets me go up to 1024x768. I already ran the update and upgrade, and the software thing shows no additional updates.

My display is: Intel G965 Express [No Nvidia or AMD graphics]

Venkatesh
  • 2,331
  • 4
  • 27
  • 52
Kyodo
  • 375
  • 1
  • 4
  • 14
  • 1
    Try to get a up-to-date driver using the Intel Linux Graphics installer: https://01.org/linuxgraphics/downloads/2014/intelr-graphics-installer-1.0.4-linux – s3lph Apr 15 '14 at 12:17
  • I installed it [took a long time ~.~] and it didnt change anything after restarting ;/ – Kyodo Apr 15 '14 at 12:56
  • You need to run the program you installed – s3lph Apr 15 '14 at 13:08
  • yeah I know.. I did that and restarted, but no change – Kyodo Apr 15 '14 at 13:28
  • Please post this as an answer and accept it so other persons immediately see that there's a solution – s3lph Apr 15 '14 at 14:56
  • Related to https://askubuntu.com/questions/377937/how-to-set-a-custom-resolution, but this one goes a little further by autodetecting the resolution. – Dan Ross Oct 23 '15 at 09:45

3 Answers3

26

It is probable that your graphic driver is not detecting that resolution. Follow the instructions below; it might help. It helped me in my Ubuntu(using unity) which installed in my desktop that has a dedicated AMD Radeon 5570HD(which uses Gallium REDWOOD drivers i.e the default open source drivers). First type this in your terminal(You can open terminal with Ctrl+Alt+t) :-

cvt 2048 1536

You will get something like this :-

# 2048x1536 59.95 Hz (CVT 3.15M3) hsync: 95.45 kHz; pclk: 267.25 MHz
Modeline "2048x1536_60.00"  267.25  2048 2208 2424 2800  1536 1539 1543 1592 -hsync +vsync

Now do this:-

xrandr --newmode "2048x1536_60.00"  267.25  2048 2208 2424 2800  1536 1539 1543 1592 -hsync +vsync

Then this:-

xrandr 

You will get an output similar to this(maybe not exactly this):-

Screen 0: minimum 320 x 200, current 1368 x 768, maximum 8192 x 8192
DisplayPort-0 disconnected (normal left inverted right x axis y axis)
HDMI-0 disconnected (normal left inverted right x axis y axis)
DVI-0 connected primary 1368x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   1024x768       60.0  
   800x600        60.3     56.2  
   848x480        60.0  
   640x480        59.9  
   1368x768_60.00   59.9* 

Here the connected monitor is DVI-0 according to the above output. So one would do this next:-

xrandr --addmode DVI-0 2048x1536_60.00

Instead of DVI-0 you should type in whichever is your connected monitor. This should work. I am assuming from your description above that 2048x1536 works on your monitor. If it doesn't you can try whichever resolution will work for you.

Now if you want this to take effect every login without having to type all of this again, follow the instructions below.

Open gedit or any other text editor. Type the following:-

#!/bin/sh
xrandr --newmode "2048x1536_60.00"  267.25  2048 2208 2424 2800  1536 1539 1543 1592 -hsync +vsync 
xrandr --addmode DVI-0 2048x1536_60.00
xrandr --output DisplayPort-0 --off --output DVI-0 --mode 2048x1536_60.00 --pos 0x0 --rotate normal --output HDMI-0 --off

You must edit the last line according to your PC. Save the above file as lightdmxrandr.sh in /usr/bin .Then make it executable by this command:-

sudo chmod a+x /usr/bin/lightdmxrandr.sh

Then open /etc/lightdm/lightdm.conf(If this file is not there then read the "PS" below) by the command:-

sudo gedit /etc/lightdm/lightdm.conf

You can use your own text editor instead of gedit. The file must contain something like this:-

[SeatDefaults]
user-session=ubuntu

Add the below lines to the file:-

greeter-session=unity-greeter
display-setup-script=/usr/bin/lightdmxrandr.sh
session-setup-script=/usr/bin/lightdmxrandr.sh

Now save the file and reboot. You must have your desired resolution both in the login screen and your desktop session. This should most probably work. But if it doesn't then read on and follow the below instructions.

Open a terminal(if you are stuck on the login screen and you can't open a terminal then drop into a tty with Ctrl+Alt+F1) and type in the following :-

sudo nano /etc/lightdm/lightdm.conf

This will open the lightdm.conf file which we edited above. Now remove the below line alone from the file:-

session-setup-script=/usr/bin/lightdmxrandr.sh

Press Ctrl+x to exit the file and then press y to save it before exit which it will prompt you to. Then type :-

sudo reboot

to reboot your PC. This should get you into your desktop(If it doesnt read "PS" below). Now go to System Settings>Displays. You might find your desired resolution there(This might happen since we ran the script above with lightdm.conf). Then select that resolution and reboot to have your desired resolution. But if you don't find your desired resolution there, you may try this.

Open Startup Applications from dash. This should give you something like this(but not exactly like this) :-

enter image description here

Press Add. You will get this :-

enter image description here

Give some name you like. Then press browse and select the script which we created(Remember that we saved it as /usr/bin/lighdmxrandr.sh ). If you want give a description. Then press Add. Before closing Startup Applications check if the entry you just added has a tick mark next to it. Now reboot your PC. This should get you the desired resolution in both the login screen as well as in the desktop.

PS:-

  1. If /etc/lightdm/lightdm.conf ain't there then you must be having /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf . Edit this file instead of lightdm.conf .
  2. If none of the above works and you are stuck at login then drop into a tty and type :-

sudo nano /etc/lightdm/lightdm.conf

Now remove all the editing we did and press Ctrl+x and then press y to save the file. Now type :-

sudo reboot

This should get you back to your desktop, but, of course, without your desired resolution and with your default resolution. Then try System Settings>Displays and check if your desired resolution is there(This might happen since we ran our script with lighdm.conf ). Now select that resolution and reboot. You will get your desired resolution now.

Credits go to these three questions:-

Venkatesh
  • 2,331
  • 4
  • 27
  • 52
  • 1
    all-in-one solution that works with recent lightdm, I remember a similar problem :) – Sylvain Pineau Apr 15 '14 at 15:00
  • Would this solution make the new resolution an option for any monitor that is plugged in to DVI-0 (in your example)? I have a 4k monitor external monitor at home, but at work, my secondary monitor is regular HD. They are both labelled HDMI-0 for me, when I switch from one to the other. Even if this is the case, this solution is still a big improvement for me, +1. – Dan Ross Oct 23 '15 at 09:50
  • 1
    This answer is helpful, but does it answer the question? That is a ton of manual coding to get Ubuntu to “detect” the screen resolution. – Randy Cragun Jan 30 '21 at 21:17
0

A bit late for this, but the above didn't help me because whenever I tried to set a new resolution mode with xrandr I would get failed to get size of gamma for output default.

Will not help everyone, but doing a full system clean solved the issue for me:

sudo rm /var/lib/apt/lists/lock
sudo rm /var/lib/dpkg/lock
sudo rm /var/lib/dpkg/lock-frontend
sudo dpkg --configure -a
sudo apt clean
sudo apt update --fix-missing
sudo apt install -f
sudo dpkg --configure -a
sudo apt upgrade
sudo apt dist-upgrade
sudo reboot

Source: https://ostechnix.com/how-to-fix-broken-ubuntu-os-without-reinstalling-it/

  • 1
    I am very surprised that that helped. Might it have been a coincidence, like, perhaps just rebooting would have done the job? – Zanna Aug 04 '21 at 09:05
  • @Zanna Unfortunately no, I rebooted about a dozen times while trying different stuff to solve this, even changing monitors :). My guess is that there was an update that didn't go as planned and this routine cleaned it. – Luis Da Silva Aug 05 '21 at 13:21
  • 1
    It helped me as well! – dariush Oct 20 '21 at 15:39
  • This solved it for me as well. Unfortunately, I don't know the cause. – Tobe Osakwe Mar 08 '23 at 16:53
0

With my installation (16.04 LTS) it was having a lot of trouble and wouldn't even boot into X after installation. It did when I selected recovery mode and let it boot. Then it would not go any higher than described above. I switched to a term and ran "dpkg -l| grep xserver-xorg-video" and xserver-xorg-video-intel was not in the list! Solution was simply to install it then reboot. Logged in and now it's at 1920x1080. Very happy, but it seems like a fairly major bug that doesn't install the intel video driver. I checked before installing it that the hardware was recognised by the OS (it was).

Mike W
  • 21
  • With the latest 16.04, this package is already there after default installation (and the problem still exists). – matanox Feb 21 '18 at 23:43