How to edit the xorg.conf


Solution 1

The xorg.conf does not exist by default any more. You CAN create one though.

Boot into recovery mode and select Root Shell. Then run:

X -configure


cp /root/ /etc/X11/xorg.conf

Reboot and you can edit the new Xorg.conf.

You don't even need to reboot, just do sudo /etc/init.d/gdm restart

Solution 2

This is only a thought, but it sounds like your hard drive might be mounted in Read Only mode. From a terminal window, type in mount and check for what / is mounted as.

root@terrance-Compaq:/etc/X11# mount
/dev/sda1 on / type ext4 (rw,errors=remount-ro)

after the type you should see the (rw,errors=remount-ro), if not, remount the root partition as Read / Write by typing in the following at the terminal window:

sudo mount -o remount,rw /

then try to modify your /etc/X11/xorg.conf.

NOTE: Recovery mode is always mounted Read Only. Before making any modifications in Recovery Mode, type in:

mount -o remount,rw /


Related videos on Youtube

Author by


Updated on September 18, 2022


  • kuu
    kuu 8 months

    My development environment Ubuntu14.04

    I use Ubuntu 14.04 usb boot. When I installed CUDA7.0, the black screen appeared. But, I can enter the console mode.

    so, I tried to edit the /etc/X11/xorg.conf. but, could not be edited in readonly.

    I tried it with "sudo", "su", "su - " by vim. The results of "ls" , it is shown below.

    #ls -ls
    -rw-r--r-- root root

    I can't understand that this file can't be edited by the root authority.

    #lsof |grep xorg.conf
    there is nothing.

    and I tried with recovery mode, It was the same situation. Please advice somebody.

    • Sharad Gautam
      Sharad Gautam almost 8 years
      You need to create a xorg.conf manually, see my answer below!
  • Sharad Gautam
    Sharad Gautam almost 8 years
    sudo chmod 755 /etc/X11/xorg.conf should be done in very rare cases, please add that permissions should be changed back to 744 after doing that! Then I'll remove my -1! Welcome to ASKUbuntu anyways !
  • kuu
    kuu almost 8 years
    Thanks. but I couldn't execute this code "#cp /root/ /etc/X11/xorg.conf". → permission denied.
  • Sharad Gautam
    Sharad Gautam almost 8 years
    Don't thank me! ;-) If you like my answer, just click the little grey ☑ under the "0" now turning it into beautiful green. If you do not like my answer, click on the little grey down-arrow below the 0, and if you really like my answer, click on the little grey checkmark and the little up-arrow... If you have any further questions, go to
  • kuu
    kuu almost 8 years
    I tried" mount | grep errors" and found "/dev/sdb2 on / type ext4 (rw,errors=remount-ro)". but I tried "sudo mount -o remount, rw /" same thing...
  • Terrance
    Terrance almost 8 years
    @Hiwasawa that shows that your drive is mounted in Read / Write mode, and using sudo, you should be able to modify the files. Have you tried checking your drive for errors? Reboot to Recovery Mode and choose fsck from the menu, and check your drives for errors.