restore xorg.conf (screen resolution not changing)

Asked by kjerryn

hi,
please i got a new monitor viewsonic vp201b and was trying to change the resolution to 1280x1024. the monitor when the system starts suggests a resolution of 1680x1200 or something similar. i made a backup of xorg.conf but the original has changed to what i've pasted below due to a mistake i made.

# xorg.conf (X.Org X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the xorg.conf manual page.
# (Type "man xorg.conf" at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
# sudo dpkg-reconfigure -phigh xserver-xorg

Section "InputDevice"
 Identifier "Generic Keyboard"
 Driver "kbd"
 Option "XkbRules" "xorg"
 Option "XkbModel" "pc105"
 Option "XkbLayout" "us"
EndSection

Section "InputDevice"
 Identifier "Configured Mouse"
 Driver "mouse"
 Option "CorePointer"
 Option "Emulate3Buttons" "true"
EndSection

Section "Device"
 Identifier "Configured Video Device"
EndSection

Section "Monitor"
 Identifier "Configured Monitor"
EndSection

Section "Screen"
 Identifier "Default Screen"
 Monitor "Configured Monitor"
 Device "Configured Video Device"
EndSection

Section "ServerLayout"
 Identifier "Default Layout"
 Screen "Default Screen"
EndSection

i therefore want to change what is here to
# xorg.conf (xorg X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the xorg.conf manual page.
# (Type "man xorg.conf" at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
# sudo dpkg-reconfigure -phigh xserver-xorg

Section "Files"
EndSection

Section "InputDevice"
 Identifier "Generic Keyboard"
 Driver "kbd"
 Option "CoreKeyboard"
 Option "XkbRules" "xorg"
 Option "XkbModel" "pc105"
 Option "XkbLayout" "us"
EndSection

Section "InputDevice"
 Identifier "Configured Mouse"
 Driver "mouse"
 Option "CorePointer"
 Option "Device" "/dev/input/mice"
 Option "Protocol" "ImPS/2"
 Option "ZAxisMapping" "4 5"
 Option "Emulate3Buttons" "true"
EndSection

Section "InputDevice"
 Driver "wacom"
 Identifier "stylus"
 Option "Device" "/dev/input/wacom"
 Option "Type" "stylus"
 Option "ForceDevice" "ISDV4" # Tablet PC ONLY
EndSection

Section "InputDevice"
 Driver "wacom"
 Identifier "eraser"
 Option "Device" "/dev/input/wacom"
 Option "Type" "eraser"
 Option "ForceDevice" "ISDV4" # Tablet PC ONLY
EndSection

Section "InputDevice"
 Driver "wacom"
 Identifier "cursor"
 Option "Device" "/dev/input/wacom"
 Option "Type" "cursor"
 Option "ForceDevice" "ISDV4" # Tablet PC ONLY
EndSection

Section "Device"
 Identifier "ATI Technologies Inc Rage 128 Pro Ultra TR"
 Driver "ati"
 BusID "PCI:1:0:0"
EndSection

Section "Monitor"
 Identifier "DELL M770"
 Option "DPMS"
EndSection

Section "Screen"
 Identifier "Default Screen"
 Device "ATI Technologies Inc Rage 128 Pro Ultra TR"
 Monitor "DELL M770"
 DefaultDepth 24
 SubSection "Display"
  Modes "1280x1024" "1024x768" "800x600" "720x350" "640x480"
 EndSubSection
EndSection

Section "ServerLayout"
 Identifier "Default Layout"
 Screen "Default Screen"
 InputDevice "Generic Keyboard"
 InputDevice "Configured Mouse"

# Uncomment if you have a wacom tablet
# InputDevice "stylus" "SendCoreEvents"
# InputDevice "cursor" "SendCoreEvents"
# InputDevice "eraser" "SendCoreEvents"
EndSection

this is what was there before the error.
also there is nowhere on this LCD that i see dell. how come its in the list?

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu xorg Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
kjerryn (kjerryn) said :
#1

pls take a look at this to
kwam@kwam-desktop:~$ gkgksudo gedit /etc/X11/xorg.confsudo gedit /etc/X11/xorg.conf
bash: gkgksudo: command not found
kwam@kwam-desktop:~$

Revision history for this message
Tom (tom6) said :
#2

    OK, first off Dont Panic - this is fairly easy to fix :)

    Open a terminal console ;-

    Applications menu from the top taskbar - Accessories - Terminal

    Into the terminal/command window/console type

su
<password, this is your normal password not the Root one>
cd /etc/X11
LS
    actually that should have been a little ls
cp xorg.conf xorg.090115
LS
    so now you can see that we've backed up your xorg.conf
    and given it todays date backwards.
    Now look for the one you think is the backup from before
    (see why i use a backwards date?) and type

gedit xorg.bak

    (or whatever it was called, can always try 1 at a time
    but you might need a LiveCd,
    although your Ubuntu disc can do that - see later)
    From gedit choose 'Save As ...' and rename the file as
xorg.conf
    allow it to overwrite the existing one

Job done :)

Just close the terminal window and reboot. If you have problems booting back in then use you Ubuntu disc as a 'Live Cd' (=bootdisk) and "Try Ubuntu without installing" then do the same as above but remember its the xorg on your hard-drive not the one on your Live Session so navigate to the hard drive after doing the su bit.

Blimey i made that as clear as mud. Good luck following that. Please ask questions and let me (or someone else) clarify it better.

Regards from
Tom :

Revision history for this message
kjerryn (kjerryn) said :
#3

kwam@kwam-desktop:~$ su
Password:
su: Authentication failure
kwam@kwam-desktop:~$ su
Password:
su: Authentication failure
kwam@kwam-desktop:~$

i know only one password for my machine

Revision history for this message
Hemanth (hemanth-hm) said :
#4

This must do the job :

kwam@kwam-desktop:~$ cd /etc/X11

kwam@kwam-desktop:~$ sudo mv xorg.bak xorg.conf

Revision history for this message
kjerryn (kjerryn) said :
#5

hi pls kwam@kwam-desktop:~$ sudo gedit /etc/X11/xorg.conf
gives this

# xorg.conf (xorg X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the xorg.conf manual page.
# (Type "man xorg.conf" at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
# sudo dpkg-reconfigure -phigh xserver-xorg

Section "Files"
EndSection

Section "InputDevice"
 Identifier "Generic Keyboard"
 Driver "kbd"
 Option "CoreKeyboard"
 Option "XkbRules" "xorg"
 Option "XkbModel" "pc105"
 Option "XkbLayout" "us"
EndSection

Section "InputDevice"
 Identifier "Configured Mouse"
 Driver "mouse"
 Option "CorePointer"
 Option "Device" "/dev/input/mice"
 Option "Protocol" "ImPS/2"
 Option "ZAxisMapping" "4 5"
 Option "Emulate3Buttons" "true"
EndSection

Section "InputDevice"
 Driver "wacom"
 Identifier "stylus"
 Option "Device" "/dev/input/wacom"
 Option "Type" "stylus"
 Option "ForceDevice" "ISDV4" # Tablet PC ONLY
EndSection

Section "InputDevice"
 Driver "wacom"
 Identifier "eraser"
 Option "Device" "/dev/input/wacom"
 Option "Type" "eraser"
 Option "ForceDevice" "ISDV4" # Tablet PC ONLY
EndSection

Section "InputDevice"
 Driver "wacom"
 Identifier "cursor"
 Option "Device" "/dev/input/wacom"
 Option "Type" "cursor"
 Option "ForceDevice" "ISDV4" # Tablet PC ONLY
EndSection

Section "Device"
 Identifier "ATI Technologies Inc Rage 128 Pro Ultra TR"
 Driver "ati"
 BusID "PCI:1:0:0"
EndSection

Section "Monitor"
 Identifier "DELL M770"
 Option "DPMS"
EndSection

Section "Screen"
 Identifier "Default Screen"
 Device "ATI Technologies Inc Rage 128 Pro Ultra TR"
 Monitor "DELL M770"
 DefaultDepth 24
 SubSection "Display"
  Modes "1280x1024" "1024x768" "800x600" "720x350" "640x480"
 EndSubSection
EndSection

but screen resolution is at 800x600 at 60hz
what happens now?
Section "ServerLayout"
 Identifier "Default Layout"
 Screen "Default Screen"
 InputDevice "Generic Keyboard"
 InputDevice "Configured Mouse"

# Uncomment if you have a wacom tablet
# InputDevice "stylus" "SendCoreEvents"
# InputDevice "cursor" "SendCoreEvents"
# InputDevice "eraser" "SendCoreEvents"
EndSection

Revision history for this message
Hemanth (hemanth-hm) said :
#6

Did you do this :

cd /etc/X11

sudo mv xorg.bak xorg.conf

sudo shutdown -r now

Revision history for this message
Tom (tom6) said :
#7

Yes i got several things completely wrong. Sorry about the confusion there, i suffered a glitch in my main processing unit. Thankfully Hermanth has corrected me :)

I was wrong about the password and also about using gedit. There's a much easier way than using. Thanks Hermanth :)
.

   In a terminal console please try

kwam@kwam-desktop:~$ cd /etc/X11
kwam@kwam-desktop:~$ LS

   actually that should have been a little ls
   ls shows what's in the folder but its typical of linux to colour code everything :)
   Note what's in the folder & please tell us so we can help.

kwam@kwam-desktop:~$ sudo cp xorg.conf xorg.090115
[sudo] password for user: <enter the only password you know>
kwam@kwam-desktop:~$ LS

    again that should have been small letters. This should show that we've
    backed up your xorg.conf and given it todays date backwards.

kwam@kwam-desktop:~$ sudo gedit xorg.conf

    It shouldn't ask for a password this time as you have a 15min break from that.
    Also open the file (if there is one) that has all the text you want to put into
    xorg.conf to replace what's there at the moment
    Save it as "xorg.090115old" if you can.
    Also do Ctrl A and then Ctrl C or select all the text and use the copy command
    Now in the xorg.conf in gedit do Ctrl A and delete
    Ctrl V should now put all the right text back into xorg.conf
    Save xorg.conf

At last i think we might have sorted it out. There isn't now some text near the end in xorg.conf saying "but screen resolution is at 800x600 at 60hz what happens now?" is there? If there is then just put a # at the beginning of each line it's on. Is it all looking ok now?

Don't worry too much about it saying "Dell" here and there, i think these are only setting up a name and definition and then calling the definition into the right place. Difficult for me to explain because i dont know the right terms in object-oriented programming. I'd have to say that at one point it defines a "sub-routine" and names it "Dell" and then at another point it says "bring me the info from the sub-routine i called "Dell"". Sorry my understanding and language is inadequate to explain. I think it's fine though, that's what i am trying to say.

If it's all looking ok then try rebooting. I'm sure there is a more elegant way but i'm a noob at a lot of this clever linux stuff. Reboot will definitely force xorg.conf to be used.

Please let us know if that's fixed it.
Definitely let us know if it hasn't.

Good luck and sorry i've been a bit rubbish at helping you here.
Regards from
Tom

Revision history for this message
Tom (tom6) said :
#8

Dohhh, halfway through i realised that gedit was a good plan so i went with it.

One thing you have consistently shown is that you have access to the text we need inside xorg.conf. What we still don't know is where that text is. If it is in a file then the file's name hasn't been mentioned in this thread (not that i've seen anyway). If we knew the name of the file we could avoid using gedit and instead stick with "cp" and "mv" from the command line. Both are much more elegant ways than copying a huge block of text and pasting it directly into a super-user-opened-gedit to replace everything that was in there. lol

Good luck with this
Please let us know how it goes
Regards
Tom

Revision history for this message
Tom (tom6) said :
#9

The file with the correct text could easily have been xorg.bak as Hermanth said but i just wasn't certain. If he was right about the name then his way was more elegant and should have worked.

The "sudo" command only needs the normal user password which is the password you know whereas "su" requires the Root-password.

Revision history for this message
kjerryn (kjerryn) said :
#10

kwam@kwam-desktop:/etc/X11$ sudo gedit /etc/X11/xorg.conf

gives this

DefaultDepth 24
 SubSection "Display"
  Modes "1280x1024" "1024x768" "800x600" "720x350" "640x480"
 EndSubSection
EndSection

so why can't the resolution be changed?

Revision history for this message
Tom (tom6) said :
#11

Ok?

So xorg.conf is fixed back the way it was before. Or at least its working?

Please follow similar questions and the faq

https://answers.launchpad.net/ubuntu/+source/xorg/+question/57583
https://answers.launchpad.net/ubuntu/+faq/128

I'm not sure if i can help but hopefully these will. Good luck in hunting for an answer to this
Regards from
Tom

Revision history for this message
kjerryn (kjerryn) said :
#12

hi i reinstalled ubuntu and its OK now but the default resolution now is 1680x1050 but does not look like it on screen. its more like 1280x1024. is this normal or do i have to do something
Thank you.

Revision history for this message
kjerryn (kjerryn) said :
#13

how do you feel about this
when preferences--screen resolution gives some other types of resolutions
kwam@kwam-desktop:~$ sudo gedit /etc/X11/xorg.conf

# xorg.conf (xorg X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the xorg.conf manual page.
# (Type "man xorg.conf" at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
# sudo dpkg-reconfigure -phigh xserver-xorg

Section "Files"
EndSection

Section "InputDevice"
 Identifier "Generic Keyboard"
 Driver "kbd"
 Option "CoreKeyboard"
 Option "XkbRules" "xorg"
 Option "XkbModel" "pc105"
 Option "XkbLayout" "us"
EndSection

Section "InputDevice"
 Identifier "Configured Mouse"
 Driver "mouse"
 Option "CorePointer"
 Option "Device" "/dev/input/mice"
 Option "Protocol" "ImPS/2"
 Option "ZAxisMapping" "4 5"
 Option "Emulate3Buttons" "true"
EndSection

Section "InputDevice"
 Driver "wacom"
 Identifier "stylus"
 Option "Device" "/dev/input/wacom"
 Option "Type" "stylus"
 Option "ForceDevice" "ISDV4" # Tablet PC ONLY
EndSection

Section "InputDevice"
 Driver "wacom"
 Identifier "eraser"
 Option "Device" "/dev/input/wacom"
 Option "Type" "eraser"
 Option "ForceDevice" "ISDV4" # Tablet PC ONLY
EndSection

Section "InputDevice"
 Driver "wacom"
 Identifier "cursor"
 Option "Device" "/dev/input/wacom"
 Option "Type" "cursor"
 Option "ForceDevice" "ISDV4" # Tablet PC ONLY
EndSection

Section "Device"
 Identifier "ATI Technologies Inc Rage 128 Pro Ultra TR"
 Driver "ati"
 BusID "PCI:1:0:0"
EndSection

Section "Monitor"
 Identifier "Generic Monitor"
 Option "DPMS"
 HorizSync 30-70
 VertRefresh 50-160
EndSection

Section "Screen"
 Identifier "Default Screen"
 Device "ATI Technologies Inc Rage 128 Pro Ultra TR"
 Monitor "Generic Monitor"
 DefaultDepth 24
EndSection

Section "ServerLayout"
 Identifier "Default Layout"
 Screen "Default Screen"
 InputDevice "Generic Keyboard"
 InputDevice "Configured Mouse"

# Uncomment if you have a wacom tablet
# InputDevice "stylus" "SendCoreEvents"
# InputDevice "cursor" "SendCoreEvents"
# InputDevice "eraser" "SendCoreEvents"
EndSection

Revision history for this message
Hemanth (hemanth-hm) said :
#14

$ xrandr --output LVDS --mode 1280x1024

Give any good resolution you like :)

You can also set the frequency , do so if you are sure about your refresh rate .

$ xrandr --output LVDS --mode 1280x1024 --rate 75

But , xrandr lasts for the current session only , so you can add new resolution , which is not found in your settings , to do so you need to do this :

$ xrandr --addmode S-video 1280x1024

So , check which resolution is the best for you , add it if not found and logout and login back to see the effect.

Revision history for this message
kjerryn (kjerryn) said :
#15

kwam@kwam-desktop:~$ xrandr --output LVDS --mode 1280x1024
kwam@kwam-desktop:~$
kwam@kwam-desktop:~$ xrandr --output LVDS --mode 1280x1024
kwam@kwam-desktop:~$ xrandr --output LVDS --mode 1280x1024 --rate 75
kwam@kwam-desktop:~$

Revision history for this message
Tom (tom6) said :
#16

If you are happy with the way the screen resolution looks now then i reckon it's worth leaving. If you're not happy then take care to backup xorg.conf to something like xorg.090117old so that you know what the filename is if you make an error and need to restore the one that works.

Regards from
Tom

PS i'm really sorry with the confusion i caused before if that's what made you have to reinstall Ubuntu. I hope you didn't lose anything because of my advice.

Revision history for this message
Tom (tom6) said :
#17

If you are still having trouble with this then please post it as a new question. Only the most recent questions tend to get looked at so posting/reposting a question just before america arrives online gives the best chance of getting a good few answers.

If the problem has been resolved then please follow the link to the forum thread and mark it as Solved.

Good luck and many regards from
Tom :)

Can you help with this problem?

Provide an answer of your own, or ask kjerryn for more information if necessary.

To post a message you must log in.