# How to get a copy of the xorg.conf that startx uses when none is present?



## msplsh (Jun 8, 2022)

I tried `Xorg -configure` but that gave me a non-working configuration.


----------



## Profighost (Jun 8, 2022)

Xorg -configure is strongly discouraged to use, since it produces nothing useful, really.

Simply place a config-file like from handbook's chapter 5.4.5 in /usr/local/etc/X11/xorg.conf.d/ (copy paste) - In most cases (such as if your card ain't not on an "exotic" PCIe-Slot) that will be all you need.

I had a similar issue a couple of weeks ago, nearly despaired








						Solved - New FreeBSD 13 installation, X finally runs - DRM?
					

...'D#§M&F/$4'... I am messing around with my xorg for several days on my new machine until I found out:  For current graphics-adapters there are no "classical drivers" no more. So forget xf86-video-....etc. One have to install drm-kmod  (via ports make install according to hb 5.4.5 [btw, HB...




					forums.freebsd.org
				



and I learned:
If xorg will not start automatically after standard installation (just like written in handbook) you either may have not installed the right packages for you graphics adapter (e.g. drm or nvidia [don't forget the correct entries in /boot/loader.conf and /etc/rc.conf!]), or your card is not supported by X.
I also nearly despaired after several complete reinstallations until I realized what I didn't want to be true:
My brandnew Radeon card was simply not supported by X.
I bought a Nvidia and - voilà - running X.


----------



## msplsh (Jun 8, 2022)

It works with the framebuffer, I just want the configuration it used to get the framebuffer to work.


----------



## kpedersen (Jun 8, 2022)

This doesn't seem to be possible. At the very least, I believe it would end up looking like this config, that checks for matches (check out MatchDriver in the manpage for more info):


```
Section "Device"
  Identifier "Autodetected"
  MatchDriver "modesetting"
  Driver "modesetting"
EndSection

Section "Device"
  Identifier "Autodetected"
  MatchDriver "intel"
  Driver "intel"
EndSection

Section "Device"
  Identifier "Autodetected"
  MatchDriver "nv"
  Driver "nv"
EndSection

[...]
```

Instead it seems the only way (that I know of) is to look through the Xorg.#.log (in /var/log) and work out which one it matched against.


----------



## SirDice (Jun 8, 2022)

There is no 'default' xorg.conf, stop looking for it. Xorg automatically scans various devices and based on what it finds it's going to use whatever it thinks fits best. Just look through /var/log/Xorg.0.log to see what it does.

Nowadays you basically rely on this automatic configuration detection. Only if it automatically switches to a 'wrong' one should you configure for a _specific_ driver.


----------



## msplsh (Jun 8, 2022)

SirDice said:


> There is no 'default' xorg.conf, stop looking for it


I know.



SirDice said:


> Xorg automatically scans various devices and based on what it finds it's going to use whatever it thinks fits best


I know that too.  What I want is its list of decisions.



SirDice said:


> Just look through /var/log/Xorg.0.log to see what it does.


That... is like picking through poop to see what Xorg ate for dinner instead of getting a straight answer from it.



SirDice said:


> Nowadays you basically rely on this automatic configuration detection. Only if it automatically switches to a 'wrong' one should you configure for a _specific_ driver.


That's exactly what happens when I turn on the nVidia driver, which is why I want the default config so I can just switch files instead of having to reboot because some piece of trash gets left behind and Xorg keeps on trying to activate nVidia instead of the framebuffer.


----------



## kpedersen (Jun 8, 2022)

msplsh said:


> That... is like picking through poop to see what Xorg ate for dinner instead of getting a straight answer from it.


I do like this analogy. I suppose it is also suitable for explaining how I often have to obtain requirements from clients!


----------



## Phishfry (Jun 8, 2022)

msplsh said:


> What I want is its list of decisions.


But the problem ther is subsystems.
For instance xinput/libinput does a probe of its own.



msplsh said:


> That... is like picking through poop to see what Xorg ate for dinner instead of getting a straight answer from it.


I agree. Just trying to find out what driver is in use seemed way too hard.
Since we now have scfb and vesa in base Xorg it is harder to tell what driver is running.








						How to tell which Xorg video driver is in use.
					

I have figured out 2 ways from the xterm prompt.  glxgears -info|grep GL_RENDERER  glxinfo -B | grep Device  Is there any GUI utility that shows the xorg video driver in use?




					forums.freebsd.org
				



In the old days you knew. No driver. No Xorg.


----------



## Phishfry (Jun 8, 2022)

I have always found the Control-Alt-F1 to be interesting under Xorg. How can you scroll back the text?


----------



## msplsh (Jun 9, 2022)

Scroll-lock/Pause/Break key


----------

