Screen resolution is not saved after reboot

10,720

If local screen settings are not "surviving" a reboot or re- log in, your issue is almost certainly the result of a bug. For that reason, it is very hard, if possible at all, to solve without a workaround, since the issue occurs locally, and possible global settings are simply overruled with incorrect local settings.

To solve (workaround) the issue, we need to (re-) confirm our own settings on log in, by adding a command to Startup Applications.

What to do

If your screen is set correctly when using the command

xrandr -s 1440x900

(no need for sudo), just add the following to Startup Applications: Dash > Startup Applications > Add. Add the command:

/bin/bash -c "sleep 10 && xrandr -s 1440x900"

It is a workaround, but it works. The sleep 10 is needed to make sure the screen setting will not be overruled by local procedures on log in. ten seconds after log in, your screen will be set correctly automatically.

Possibly you need to play a bit with the 10 seconds.

To make it work for all users

  1. Create a .desktop file:

    [Desktop Entry]
    Name=set_screen
    Exec=/bin/bash -c "sleep 10 && xrandr -s 1440x900"
    Type=Application
    

    save it as set_screen.desktop

  2. Copy the file into /etc/xdg/autostart

Now the command will run for all users during log in.

Share:
10,720

Related videos on Youtube

Slava Fomin II
Author by

Slava Fomin II

Updated on September 18, 2022

Comments

  • Slava Fomin II
    Slava Fomin II over 1 year

    I'm using Xubuntu 15.10 on my GA-C847N motherboard.

    I can set appropriate resolution using the following command:

    sudo xrandr -s 1440x900

    However, each time after machine is rebooted I'm getting some weird distorted resolution and I need to change it manually again. During this time I can't open the Display Settings dialogue, the window of this dialogue is black and it crashes.

    I'm experiencing this problem after switching to the old monitor Acer AL1916W connected via VGA interface.

    Before that I was using a newer monitor via HDMI and it worked flawlessly.

    What could be the reason for this? How do I preserve the resolution. Maybe I need to pre-generate the xorg.conf file? How do I do that for my configuration?

    I used to have NVIDIA descrete graphic adapters and I'm not familiar with embedded ones.

    • hatterman
      hatterman about 8 years
      At the expense of sounding unhelpful .... just dont use the VGA monitor. Your system works connected via HDMI. I try hard not to give answers like this usually but wonder if you need to bother with this. That said, boot into a live 14.04 environment and see if that works for starters. I stopped using non LTS releases a while a go as I always seemed to hit issues just like this one.
    • Slava Fomin II
      Slava Fomin II about 8 years
      Sadly, this monitor only has one VGA input port. No way to use HDMI with it. And thanks for the LTS hint, I will consider it. However, I will prefer to solve this problem nevertheless. In the end current workaround is a better option than reinstalling the whole system again = )
    • hatterman
      hatterman about 8 years
      You lose nothing by booting into a live 14.04LTS disc, dont install it just run it. It will not touch your installed system. If the VGA works properly it might be food for thought.
    • Slava Fomin II
      Slava Fomin II about 8 years
      Yeah I know. I just can't see how it will help me to solve the issue with my current system though = )
    • hatterman
      hatterman about 8 years
      Because you will then know it is a 15.10 issue (or not), and can then decide whether all you can do is use a workaround. Good luck :)
  • Slava Fomin II
    Slava Fomin II about 8 years
    That's a clever automation, I was going to use something like this until I will manage to fix the problem. Thanks! But is there a way to run this code for all users of the OS? )
  • Jacob Vlijm
    Jacob Vlijm about 8 years
    @SlavaFominII Absolutely, will edit in a minute.
  • Slava Fomin II
    Slava Fomin II about 8 years
    Also, I think there should be a way to pre-generate the xorg.conf file and put this configuration option into it. However, I wasn't being able to find the way to do it. Do you have experience with it? )
  • Jacob Vlijm
    Jacob Vlijm about 8 years
    @SlavaFominII the problem is that it is a bug, (locally) overruling the screen setting on log in. Very hard to find out, if possible at all. See my latest edit.
  • Slava Fomin II
    Slava Fomin II about 8 years
    This is a pretty good workaround, I think I can live with it for now. Thanks, for helping me out ; )
  • Jacob Vlijm
    Jacob Vlijm about 8 years
    @SlavaFominII if the answer solved your problem, as you indicated, would you consider to accept the answer?
  • Jacob Vlijm
    Jacob Vlijm about 8 years
    @SlavaFominII The root of the problem is that your system and the screen do not understand each other on log in, and the system jumps to a generic setting, no matter what you set. re- confirming your own setting after login will then restore. Switching driver might help.