Changing screen resolution using xorg.conf file

6,484

Okay so after scrounging the web, this is the solution I came up with. I was using the manually generated xorg.conf file by using nvidia-xconfig. Which wasn't generating the correct config. This is what finally worked for me.

Press ctrl+alt+f2 (or whatever key combination you use to get into command line mode)

Login as the administrator.

If you're using GDM like me go ahead and stop the process, using service gdm stop.

Check if your X-server is running or not. Use ps -C Xorg and then kill the process. kill -9 PID

Use Xorg -configure which will generate xorg.conf.new

now simply move the .new file to the /etc/X11/ directory, using
mv xorg.conf.new /etc/X11/xorg.conf

now restart the GDM service gdm start

And you're done.

Share:
6,484

Related videos on Youtube

Sahil
Author by

Sahil

I am an inspired student and I like solving real world problems. Also I think Python is the best programming language (for almost all the tasks). I am good at developing website backend and automating small tasks with python.

Updated on September 18, 2022

Comments

  • Sahil
    Sahil over 1 year

    I recently (today) installed Nvidia graphic drivers on my laptop, I followed the instruction on the tutorial and generated a xorg.conf file using nvidia-xconfig. I have am using a laptop and have plugged an external montior to it, The external monitor's resolution is fine however the main laptop screen has gone to 4:3 resolution. I have no idea what's in the xorg.conf file, I have never seen anything like this, can anyone help me changing the screen resolution back to 16:9, 1366x768.

    Here is the xorg.conf file.

    # nvidia-xconfig: X configuration file generated by nvidia-xconfig
    # nvidia-xconfig:  version 390.48  (buildmeister@swio-display-x86-rhel47-07)  Thu Mar 22 01:07:32 PDT 2018
    
    
    Section "ServerLayout"
        Identifier     "layout"
        Screen      0  "nvidia" 0 0
        Inactive       "intel"
        InputDevice    "Keyboard0" "CoreKeyboard"
        InputDevice    "Mouse0" "CorePointer"
    EndSection
    
    Section "InputDevice"
    
        # generated from default
        Identifier     "Keyboard0"
        Driver         "keyboard"
    EndSection
    
    Section "InputDevice"
    
        # generated from default
        Identifier     "Mouse0"
        Driver         "mouse"
        Option         "Protocol" "auto"
        Option         "Device" "/dev/psaux"
        Option         "Emulate3Buttons" "no"
        Option         "ZAxisMapping" "4 5"
    EndSection
    
    Section "Monitor"
        Identifier     "Monitor0"
        VendorName     "Unknown"
        ModelName      "Unknown"
        HorizSync       60.0 - 100.0
        VertRefresh     60.0 - 100.0
        Option         "DPMS"
    EndSection
    
    Section "Device"
        Identifier     "nvidia"
        Driver         "nvidia"
        BusID          "PCI:1:0:0"
    EndSection
    
    Section "Device"
        Identifier     "intel"
        Driver         "modesetting"
    EndSection
    
    Section "Screen"
        Identifier     "nvidia"
        Device         "nvidia"
        Monitor        "Monitor0"
        DefaultDepth    24
        Option         "AllowEmptyInitialConfiguration"
        Option         "RegistryDwords" "PrefLevelSrc=0x2222"
        Option         "TripleBuffer" "True"
        SubSection     "Display"
            Depth       24
            Modes      "nvidia-auto-select"
        EndSubSection
    EndSection
    
    Section "Screen"
        Identifier     "intel"
        Device         "intel"
        Monitor        "Monitor0"
    EndSection
    
    • nobody
      nobody about 6 years
      What is external monitor resolution? Is it 4:3? Do you have desktop mirrored to have the same picture on both screens? If you have mirrored picture than the resolution will be the same on both.