# location of xorg.conf ?



## mdl90 (Mar 31, 2016)

I have an active xserver, but am not clear where it gets its configuration directives from.

Looking around the filesystem, I do:


```
$ sudo find / -name xorg
/usr/local/share/X11/xkb/rules/xorg
/usr/local/include/xorg
/usr/local/lib/xorg
/usr/ports/x11/xorg
$ sudo find / -name xorg.conf
$ sudo find / -name Xorg.conf
$ sudo find / -name Xorg
/usr/local/bin/Xorg
$ sudo Xorg -configure
(EE)
Fatal server error:
(EE) Server is already active for display 0
```

There is nothing like xorg.conf or xorg.conf.new

Should there be? If so, where and how do I locate it?


----------



## chrbr (Mar 31, 2016)

This should be ok. There are some locations where xorg.conf would be found and accepted as /etc/X11/ or //usr/local/etc/X11/. But it is good that it is not mandatory anymore. Please see also http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/x-config.html. In the past xorg.conf has been often difficult somehow .


----------



## kpedersen (Mar 31, 2016)

The only time I need xorg.conf these days is when using the NVIDIA driver.

To generate a new one, you can do


```
# Xorg -configure
```

Then you can fiddle with it and move it to /etc/X11/xorg.conf once you are done.


----------



## mdl90 (Mar 31, 2016)

kpedersen said:


> The only time I need xorg.conf these days is when using the NVIDIA driver.
> 
> To generate a new one, you can do
> 
> ...



Ok, so I don't need to do 
	
	



```
Xorg -configure
```
 and that's as it should be? If /etc/X11/ is empty, that's also ok.

I'm still unclear about where xorg gets its configuration from, without my doing the above. And...should I care?


----------



## mdl90 (Mar 31, 2016)

chrbr said:


> This should be ok. There are some locations where xorg.conf would be found and accepted as /etc/X11/ or //usr/local/etc/X11/. But it is good that it is not mandatory anymore. Please see also http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/x-config.html. In the past xorg.conf has been often difficult somehow .



From that URI:

*



			5.4.8. Manual Configuration
		
Click to expand...

*


> In some cases, Xorg autoconfiguration does not work with particular hardware, or a different configuration is desired. For these cases, a custom configuration file can be created.



ah, I see, though it's not exactly clear (to me) ...as you say, difficult somehow!


----------



## tobik@ (Mar 31, 2016)

mdl90 said:


> I'm still unclear about where xorg gets its configuration from, without my doing the above.


It's explained in the first paragraph of the handbook chapter chrbr linked to: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/x-config.html


> Xorg supports most common video cards, keyboards, and pointing devices. These devices are automatically detected and do not require any manual configuration.


It's worth a read if you want to override some of the default settings. It was recently updated by wblock@ and explains the modern way to configure Xorg. Creating an entire xorg.conf with `Xorg -configure` is probably not necessary.


----------



## mdl90 (Mar 31, 2016)

tobik said:


> It's explained in the first paragraph of the handbook chapter chrbr linked to: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/x-config.html
> 
> It's worth a read if you want to override some of the default settings. It was recently updated by wblock@ and explains the modern way to configure Xorg. Creating an entire xorg.conf with `Xorg -configure` is probably not necessary.



Ah, oop - I now see this implies I don't need to create or intervene in the configuration. I still wonder how Xorg manages the auto configuration.


----------



## tobik@ (Mar 31, 2016)

mdl90 said:


> I still wonder how Xorg manages the auto configuration.


I imagine it happens sort of like what the FreeBSD kernel does to select the correct driver for your hardware.  There's a probe function which checks if it can be used for the hardware you have. If yes, Xorg will use it, if not it tries with the next available driver.

What the driver actually probes is up to it, but it usually involves checking the PCI card/chip/class ids etc.

This is getting very technical but http://www.x.org/releases/X11R7.7/doc/xorg-server/ddxDesign.html seems to explain this in some detail.


----------



## tingo (Apr 5, 2016)

Since it was not mentioned already, you can find out a lot of what the X server is doing by looking at the log file /var/log/Xorg.0.log. It will tell you if it uses a config file or not, what graphics cards, input devices and so on it detects. Very useful, especially when things are not working.


----------

