My xorg.conf file is missing as I deleted accidentally for some reason. Now, Xorg try to probe my hardware on every startup. How do I configure Xorg under Debian or any Linux distro / operating systems?
The latest X server versions are designed to work out-of-the-box, with no need to manually edit Xorg’s configuration files. However, you can use the following generic steps to edit or create xorg.conf file.
Stop X Windows Manager
First, you need to shutdown X and its manager. The simplest way to do is login to a console as root and type the following commands to stop kdm or gdm:
# /etc/init.d/kdm stop
How Do I Configure X?
You can type any one of the following command:
# dpkg-reconfigure xserver-xorg
The above is Debian / Ubuntu Linux specific command. The generic command for Linux and UNIX is as follows to configure X:
# cd /etc/X11/ && Xorg -configure
Now, just follow on screen instructions to configure Xorg. You can configure Video (mostly auto detected), keyboard and so on.
Testing new config
The above command will create a new Xorg conf file. You can test with the following command:
# X -config -retro /root/xorg.conf.new
# X -config -retro /etc/X11/xorg.conf
If everything looks good, try startx to start up your X server (swtich to another virtual console (Ctrl + Alt + F2) and type the following command):
$ startx
Fine Tuning Xorg
You can edit /etc/X11/xorg.conf to make changes such as setting a new driver, adding fonts path, video resolution and so on.
# cp /etc/X11/xorg.conf /etc/X11/xorg.conf.working
# vi /etc/X11/xorg.conf
In this example, set video size to 1440x900:
Section "Screen" Identifier "Default Screen" Device "RadeonHD 4550" Monitor "Generic Monitor" DefaultDepth 24 SubSection "Display" Depth 24 Modes "1440x900" EndSubSection EndSection
Save and close the file. You need to restart or reload X to see changes.
Xorg log file
You can see error or warning log file for troubleshooting purpose at the following location:
- /var/log/Xorg.?.log
Use the tail or grep command to view log file:
tail -f /var/log/Xorg.2.log grep 'something' /var/log/Xorg.2.log
Recommend readings:
- Xorg wiki
- man page - xorg.conf
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
- RSS feed or Weekly email newsletter
- Share on Twitter • Facebook • 3 comments... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
Xorg has not required a config file for some time and can run just fine without it. Unless you have some special hardware that is not detected, or need some obscure option, there is no reason to make a xorg.conf file any more.
use HAL, or udev configuration for this… But xorg.conf is still allowed and used, only it is not needed…
I’d like to force X to use my xorg.conf file, as it is normal in my circumstance a monitor is not connected at time of startup. I use kvm style switch on multiple systems.
Anyone know how to force x to do this, and not probe at startup, as i get a failed “no screens found” message when this is the case.