Change LXDE Screen Resolution in Ubuntu (or Lubuntu)

Change LXDE Screen Resolution

LXDE Lightweight Desktop Environment

Changing the LXDE screen resolution is easy, but at first its not permanent. Setting a permanent resolution seems quite straightforward in Ubuntu, sometimes! You may have had a few problems setting the resolution in Ubuntu 11.10 (among other things – which has led many people to seek out new distributions).

 

I decided to try out a few distributions (Crunchbang #!, Lubuntu, Mint to name a few) but also tried to tailor Ubuntu needs – which led me to LXDE.

LXDE

LXDE is a great lightweight desktop environment compared to Gnome or Ubuntu’s Unity. There are a few quibbles which I may address in the future, but the first one that struck me was my resolution not saving after changing it through the ‘preferences->Multiple Screens’ menu.

LXDE uses a gui (called GrandR) for XrandR to change the screen resolution, which works fine until you reboot to find yourself at square 1!

XrandR/GrandR does not make permanent changes

XrandR, with or without GrandR, save the changes you make to your display set up. It simply applies some changes you make with the command.

Using this command is not the problem, the problem is running the command every time you login! To get around this we need to run it automatically at startup.

Without further ado…. the fix

Lets open up a terminal, press…

Now I’m guess if you are using LXDE your default text editor is now Leafpad, so type/copy this…

(if you use a different text editor change “leafpad” to whatever that may be)

You may be asked for a password as this file is saved as root, enter it and lets move on!

We need to enter find the correct XrandR command, you can find some help in this post about LightDM resolution, or by typing “man xrandr” to read the documentation.

Here is a sample command…

This command does the following

  •  -auto : enables connected devices in their preferred mode
  •  -output DVI-1 : selects the output device to modify
  •  -primary : specifies the selected device as primary
  •  -mode : sets a specific mode for the output device
  • -left-of DVI-0 : sets position of the devide to “left of” another device (DVI-0)

This command can be added to the end of your opened autostart file, remember to add a @ before the command. Here is my autostart file….

 

Now reboot and your resolution should be saved!

Any problems drop us a comment and we’ll try help out.

 

  • Meconio

    Does anyone knows how to implement this in ubuntu 11.10 or 12.04.

    • Sorry for the delay, what errors are you having with this?

      • FFS

        You don’t make it clear that this on it’s own does absolutely nothing without programming the desired display mode. I don’t get why the Linux geeks haven’t fixed the idiotic resolution problem, it’s been a massive bug for years. The original excuse for leaving this bug in was that older monitors broke if the res was set too high. A simple disclaimer could have fixed that, FFS.

        • Charleybert Dopalopadou

          That is not a bug, Gareth. On the Linux box in front of me, typing xrandr gives a list of available display modes which you can choose from, or you could create your own. It’s not a bug.

          Incidentally, it’s a single command to create a new mode(no programming), but yes you could fry certain types of vintage monitor (in fact, I have done that more than once). You’re unlikely to do any permanent damage to anything now.

          This is all to be found if you read the manpage.

  • Pushpdeep Mishra

    i tried all the above step.. but no use.. i am having ViewSonic LED monitor , which demands resolution of 1920×1080 please help..

  • Andrei Tanasuca

    Hi Gareth,

    I have another question .. and i was wondering if you can give me an answer.

    I have 2 machines with same hardware and software configuration and in the moment i restore the clone with clonezilla seems like startup bar of the cloned machine goes under the border of the monitor with around 100 pixels. When i set the res one step lower then the desktop are comes to normal. Do you think that it is a ghardware or software fault?

    I’m using Lubuntu 12.10.

    • I couldn’t tell you for sure without trying to replicate and I don’t have 2 identical machines so would be hard. I’ve never used clonezilla either so couldn’t say if it’s an issue there.

      I would probably suggest trying to set the resolution permanently like above (apart from the path has changed to /etc/xdg/lxsession/lubuntu/autostart in 12.04 – I think) then cloning and restoring. If that works you know your configuration isn’t being cloned properly.

      You could even try these instructions on cloning a hard drive. If that works you know for certain it’s clonezilla failing.

      • amsweitzer

        clonezilla if using default settings not expert mode will do a perfect clone if you tried expert mode to clone there could be some configs missing as clonezilla copies the particians written data in normal mode. so if you have a 500 gb hard drive with windows particians and linux particians in normal mode the particians would and copy to a 1tb drive only 500gb will be written to don’t know about expert mode every time i tried to use i had problems

  • cybercontroler

    Hello please help me I am new in linux I have a eee PC netbook with the panel broken so I am using a external 17″ CRT and I can not see all my screen at first I figured out that using the GUI I go to “Display Settings” turn off the DVI Monitor I set 1024×768 @85 and I got all perfect until I click “Save” now when do the same I lose the signal if I log via vnc I can fix it, so I prefer have it how it was at first I mean reset the default lubuntu settings I had googled bu noting, I tried playing with xrandr but I can not figured out…
    Regards

    root@lubuntu-pc:~# xrandr
    Screen 0: minimum 320 x 200, current 1366 x 768, maximum 2048 x 2048
    LVDS-0 connected 1366×768+0+0 0mm x 0mm
    1366×768 60.0*+
    S-video-0 disconnected
    S-video-1 disconnected
    VGA-0 connected 1024×768+0+0 312mm x 234mm
    1024×768 85.0*+ 75.1 70.1 60.0
    1280×1024 60.0 …………………….
    root@lubuntu-pc:~#

    • cybercontroler

      XD Hey I figured it out, I did a *.sh file and I call it from my autostart file.
      BTW I use lubuntu 12.10.
      Here the *.sh I used:

      #!/bin/sh
      xrandr -output LVDS-0 -off
      xrandr -output VGA-0 -primary
      xrandr -output VGA-0 -mode 1024×768 -rate 85

  • Pingback: [lubuntu] Lubuntu 13.04 Screen Resolution Problems | Ubuntu InfoUbuntu Info()

  • Pingback: [lubuntu] Lubuntu 13.04 Screen Resolution Problems | WyldePlayground.netWyldePlayground.net -()

  • cool19

    i am using lubuntu 13.10 and the path

    /etc/xdg/lxsession/LXDE/autostart is not valid for me. i have some folders named lubuntu, qlubuntu,….
    what should i do now?

    • samusz

      Lubuntu is the one I have modified

  • Hassan Shaikh

    All is OK except I am getting icons duplicated on right-side screen. Any suggestions?

  • ActionParsnip

    Unity is not a desktop environment like Gnome or LXDE. It is a shell. It is a plugin and nothing more than a plugin for Compiz, like wobbly-windows. Unity does not replace Gnome. When you use Unity you are _still_ using the Gnome DE.

  • Zsigmond Szilveszter

    Hello, I want to use my laptop with preferred external monitor(HDMI) and disabled laptop monitor. I use Lubuntu 13.10 and my produced command is the following:

    @xrandr -output HDMI-0 -primary -mode 1920×1080 -refresh 60 -output LVDS -off

    I have 2 question:
    1. Is that command correct for these what I want to do?
    2. In the lxsession folder wasn’t LXDE folder, so where can I find the autostart file(I have created but doesn’t work)?

    • Kyanh

      well i see two folder “Lubuntu” and “lubuntu-netbook” and both has startup flie

  • Bruce Randall

    Running VirtualBox 4.3.10. I have a 64 Linux VM with LXDE installation. The screen no longer paints 100% inside the VM window and the mouse functions and share drives no longer work. We use to just re-run the guest extensions but I don’t know how to do this with the built in LXDE.

    Any help would be great.

  • Russell

    After spending 4 hours trying everything I could find to try and solve this I finally hit upon a winning (and easy) way to do this.
    If your command line xrandr instruction works (ie changes the monitor) then go to the start menu->preferences->Default Applications for lxsession and select the autostart menu/tab.
    Put your xrandr command in the white text box EXACTLY as you typed it in the terminal and click ‘add’. Now reboot- worked for me. Now I have to do the same for the keyboard which I stupidly set up as a UK keymap : (

  • Chris

    How about you click Start(LXDE icon)>Preferences>Monitor Settings ?
    Silly linux users and their terminals …