Where is the xorg.conf file in Ubuntu 18.04?

I just installed Ubuntu 18.04. I have a machine with two gpus and 5 monitors. Getting them to work week has been challenging in the past, using previous versions of Ubuntu. In the end I manually created a xorg.conf file and worked well. Since then, every time I installed a new Ubuntu, I would just paste that file in /etc/X11/, reboot, and that would be good.

After installing Ubuntu 18.04 that strategy had not worked. I can't find where the xorg.conf file is located. Can you tell me where it is? Had there been a change in Ubuntu so that xorg is no longer used?

Thanks,


Solution 1:

Lot of info in the man pages, try this in a terminal:

man xorg.conf

tldr;

You should find your xorg.conf file or yours config files in one or more of the following directories:

/etc/X11/<cmdline> 
/usr/etc/X11/<cmdline> 
/etc/X11/$XORGCONFIG 
/usr/etc/X11/$XORGCONFIG 
/etc/X11/xorg.conf 
/etc/xorg.conf 
/usr/etc/X11/xorg.conf.<hostname> 
/usr/etc/X11/xorg.conf 
/usr/lib/X11/xorg.conf.<hostname> 
/usr/lib/X11/xorg.conf

Finally, configuration files will also be searched for in directories reserved for system use.

These are to separate configuration files from the vendor or 3rd party packages from those of local administration.

These files are found in the following directories:

/usr/share/X11/xorg.conf.d

PS: would you mind sharing your xorg.conf? I'm trying a setup similar to yours. Check my question here

Solution 2:

Just FYI, Solutions Good, but results Bad ...

The Good. To get your configurable file that we have all been used to:

/etc/X11/xorg.conf

Simply run nvidia settings, and in X Server Display Conf'n, click ...

Save to X Configuration File

The Bad is any changes now seem a LOT more likely to make your system reboot to a black screen ... i.e) ...

EDIT WITH CARE!

and just to make my point, I added it in a perfectly working system just now, with NO other changes, updated, and rebooted to a frozen login screen.

and the standard fix used a million time is (and further makes the point ...) reboot to recovery mode, or better yet log into your Gnome (i.e. Not 'Gnome on Xorg'), or Ubuntu on Wayland. In any of the 3 methods, remove the xorg.conf file, and reboot back into Ubuntu or 'Gnome on Xorg' again.

Using Terminal should you choose, this code works:

sudo rm /etc/X11/xorg.conf

Trying to help, Mark

Solution 3:

On recent Ubuntu versions, the xorg.conf file is not generated by default. All Xorg parameters are automatically set.

To generate the file, use one of these commands:

sudo dpkg-reconfigure -phigh xserver-xorg

For Nvidia card:

sudo nvidia-xconfig

For ATI (seems to contain issues):

sudo aticonfig --initial

Then the xorg.conf will be generated - most probably in /etc/X11/xorg.conf